From a43be980b3cf9c72f4bac4c7ce043e52004c6d90 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Sun, 10 Apr 2011 20:23:02 -0300 Subject: [PATCH] [media] anysee: add support for Anysee E7 TC It is ZL10353, TDA10023 and TDA18212. Tuner is inside of Samsung DNOD44CDH086A tuner module. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/anysee.c | 76 ++++++++++++++++++++++++++++++ drivers/media/dvb/dvb-usb/anysee.h | 1 + 2 files changed, 77 insertions(+) diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index 3c8a3abae831..fa5acd040e93 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c @@ -505,6 +505,66 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) break; } break; + case ANYSEE_HW_508TC: /* 18 */ + /* E7 TC */ + + /* enable transport stream on IOA[7] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOA, (1 << 7), 0x80); + if (ret) + goto error; + + if (dvb_usb_anysee_delsys) { + /* disable DVB-C demod on IOD[5] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5), + 0x20); + if (ret) + goto error; + + /* enable DVB-T demod on IOD[6] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 6), + 0x40); + if (ret) + goto error; + + /* enable IF route on IOE[0] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 0), + 0x01); + if (ret) + goto error; + + /* attach demod */ + adap->fe = dvb_attach(zl10353_attach, + &anysee_zl10353_tda18212_config, + &adap->dev->i2c_adap); + if (adap->fe) + break; + } else { + /* disable DVB-T demod on IOD[6] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 6), + 0x40); + if (ret) + goto error; + + /* enable DVB-C demod on IOD[5] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 5), + 0x20); + if (ret) + goto error; + + /* enable IF route on IOE[0] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 0), + 0x01); + if (ret) + goto error; + + /* attach demod */ + adap->fe = dvb_attach(tda10023_attach, + &anysee_tda10023_tda18212_config, + &adap->dev->i2c_adap, 0x48); + if (adap->fe) + break; + } + break; } if (!adap->fe) { @@ -590,6 +650,22 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) &adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A); break; + case ANYSEE_HW_508TC: /* 18 */ + /* E7 TC */ + + /* enable tuner on IOE[4] */ + ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10); + if (ret) + goto error; + + /* attach tuner */ + fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap, + &anysee_tda18212_config); + if (!fe) + ret = -ENODEV; + + break; + default: ret = -ENODEV; } diff --git a/drivers/media/dvb/dvb-usb/anysee.h b/drivers/media/dvb/dvb-usb/anysee.h index 0f7b4d48a5c8..c6181047b978 100644 --- a/drivers/media/dvb/dvb-usb/anysee.h +++ b/drivers/media/dvb/dvb-usb/anysee.h @@ -66,6 +66,7 @@ struct anysee_state { #define ANYSEE_HW_507DC 10 /* E30 C Plus */ #define ANYSEE_HW_507SI 11 /* E30 S2 Plus */ #define ANYSEE_HW_507FA 15 /* E30 Combo Plus / E30 C Plus */ +#define ANYSEE_HW_508TC 18 /* E7 TC */ #define REG_IOA 0x80 /* Port A (bit addressable) */ #define REG_IOB 0x90 /* Port B (bit addressable) */ -- 2.39.5