dtv_demod: add tuner mxl661 to aml_dvb_probe list

PD#165368: dtv_demod: add tuner mxl661 to aml_dvb_probe list

Change-Id: If37f8973306af69bc7d89c1776f2a1dfb40b74fc
Signed-off-by: manhao liang <manhao.liang@amlogic.com>
This commit is contained in:
manhao liang
2018-05-08 16:04:35 +08:00
committed by Dongjin Kim
parent ac36c789d0
commit 57e7a10398
2 changed files with 23 additions and 1 deletions

View File

@@ -35,4 +35,9 @@ static inline struct dvb_frontend* si2151_attach (struct dvb_frontend *fe,struct
{
return NULL;
}
static inline struct dvb_frontend* mxl661_attach (struct dvb_frontend *fe,struct i2c_adapter *i2c,u8 i2c_addr/*,
struct si2151_config *cfg*/)
{
return NULL;
}
#endif /*__AML_DEMOD_GT_H__*/

View File

@@ -50,6 +50,7 @@ typedef enum __tuner_type
{
TUNER_INVALID,
TUNER_SI2151,
TUNER_MXL661,
TUNER_MAX_NUM
}tuner_type;
@@ -1868,6 +1869,14 @@ static int aml_dvb_probe(struct platform_device *pdev)
pr_inf("si2151 attach sucess\n");
s_tuner_type = TUNER_SI2151;
}
}else if(!strcmp(str,"mxl661_tuner")) {
if (!dvb_attach(mxl661_attach, frontend,i2c_adapter,i2c_addr)) {
pr_error("dvb attach mxl661_attach tuner error\n");
goto error_fe;
} else {
pr_inf("mxl661_attach attach sucess\n");
s_tuner_type = TUNER_MXL661;
}
}else {
pr_error("can't support tuner type: %s\n",str);
}
@@ -1887,6 +1896,9 @@ error_fe:
if (s_tuner_type == TUNER_SI2151) {
dvb_detach(si2151_attach);
s_tuner_type = TUNER_INVALID;
}else if (s_tuner_type == TUNER_MXL661) {
dvb_detach(mxl661_attach);
s_tuner_type = TUNER_INVALID;
}
return 0;
}
@@ -1923,8 +1935,13 @@ static int aml_dvb_remove(struct platform_device *pdev)
}
if (s_tuner_type == TUNER_SI2151) {
dvb_detach(si2151_attach);
}else if (s_tuner_type == TUNER_MXL661) {
dvb_detach(mxl661_attach);
}
if (frontend && (s_tuner_type == TUNER_SI2151)) {
if (frontend && \
((s_tuner_type == TUNER_SI2151) || (s_tuner_type == TUNER_MXL661)) \
)
{
dvb_unregister_frontend(frontend);
dvb_frontend_detach(frontend);
}