mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
b2f8ee7c6a
PD#SWPL-109718 Problem: can not search channel at platform which only use an internal demod. Solution: optimize tuner and demod attach. Verify: verified by T + smith Change-Id: I7386d6070675f09a29f6481b68d62dab7f0fec65 Signed-off-by: min.yang <min.yang@amlogic.com>
79 lines
2.2 KiB
C
79 lines
2.2 KiB
C
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
/*
|
|
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __AML_TUNER_H__
|
|
#define __AML_TUNER_H__
|
|
|
|
#include <linux/amlogic/aml_demod_common.h>
|
|
#include <media/dvb_frontend.h>
|
|
|
|
struct tuner_module {
|
|
char *name;
|
|
|
|
u8 id;
|
|
u8 delsys[AML_MAX_DELSYS]; /* Delivery system supported by tuner. */
|
|
u8 type[AML_MAX_FE]; /* FE type supported by tuner. */
|
|
|
|
void *attach_symbol; /* The actual attach function symbolic address. */
|
|
|
|
struct dvb_frontend *(*attach)(const struct tuner_module *module,
|
|
struct dvb_frontend *fe, const struct tuner_config *cfg);
|
|
int (*detach)(const struct tuner_module *module);
|
|
int (*match)(const struct tuner_module *module, int std);
|
|
int (*detect)(const struct tuner_config *cfg);
|
|
};
|
|
|
|
typedef struct dvb_frontend *(*tn_attach_cb)(struct dvb_frontend *fe,
|
|
const struct tuner_config *cfg);
|
|
|
|
#if (defined CONFIG_AMLOGIC_DVB_EXTERN ||\
|
|
defined CONFIG_AMLOGIC_DVB_EXTERN_MODULE)
|
|
enum tuner_type aml_get_tuner_type(const char *name);
|
|
int aml_get_dts_tuner_config(struct device_node *node,
|
|
struct tuner_config *cfg, int index);
|
|
void aml_show_tuner_config(const char *title, const struct tuner_config *cfg);
|
|
const struct tuner_module *aml_get_tuner_module(enum tuner_type type);
|
|
|
|
int tuner_attach_register_cb(const enum tuner_type type, tn_attach_cb funcb);
|
|
void aml_set_tuner_attach_cb(const enum tuner_type type, tn_attach_cb funcb);
|
|
|
|
#else
|
|
static inline __maybe_unused enum tuner_type aml_get_tuner_type(
|
|
const char *name)
|
|
{
|
|
return AM_TUNER_NONE;
|
|
}
|
|
|
|
static inline __maybe_unused int aml_get_dts_tuner_config(
|
|
struct device_node *node, struct tuner_config *cfg, int index)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline __maybe_unused void aml_show_tuner_config(const char *title,
|
|
const struct tuner_config *cfg)
|
|
{
|
|
}
|
|
|
|
static inline __maybe_unused int tuner_attach_register_cb(const enum tuner_type type,
|
|
tn_attach_cb funcb)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline __maybe_unused void aml_set_tuner_attach_cb(const enum tuner_type type,
|
|
tn_attach_cb funcb)
|
|
{
|
|
}
|
|
|
|
static inline __maybe_unused const struct tuner_module *aml_get_tuner_module(
|
|
enum tuner_type type)
|
|
{
|
|
return NULL;
|
|
}
|
|
#endif
|
|
|
|
#endif /* __AML_TUNER_H__ */
|