From 57e7a1039831f59d40219c66805e8f5f163ec79f Mon Sep 17 00:00:00 2001 From: manhao liang Date: Tue, 8 May 2018 16:04:35 +0800 Subject: [PATCH] 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 --- .../parser/hw_demux/aml_demod_gt.h | 5 +++++ .../stream_input/parser/hw_demux/aml_dvb.c | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_demod_gt.h b/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_demod_gt.h index cc341cd8e361..6bbaf63c22cf 100644 --- a/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_demod_gt.h +++ b/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_demod_gt.h @@ -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__*/ diff --git a/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_dvb.c b/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_dvb.c index f38c6df401b0..35b0f947099e 100644 --- a/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_dvb.c +++ b/drivers/amlogic/media_modules/stream_input/parser/hw_demux/aml_dvb.c @@ -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); }