diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-14 07:11:21 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 08:45:27 -0500 |
commit | 6a58bc0f506c1825cb8f8b81a5123e26bf70902c (patch) | |
tree | 173ab53880d396100bcfe5e30fcc773632fe10a1 /drivers/media/video/saa7134/saa7134-dvb.c | |
parent | 6183040680c56ec4bd3d7c9398cbc05e84d60c1f (diff) |
[media] saa7134: Fix digital mode on Kworld SBTVD
This patch fixes digital mode on Kworld SBTVD. Unfortunately, it disables
analog mode.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 064bf2cd5f2..d2a12df28af 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -236,13 +236,38 @@ static struct tda18271_std_map mb86a20s_tda18271_std_map = { | |||
236 | 236 | ||
237 | static struct tda18271_config kworld_tda18271_config = { | 237 | static struct tda18271_config kworld_tda18271_config = { |
238 | .std_map = &mb86a20s_tda18271_std_map, | 238 | .std_map = &mb86a20s_tda18271_std_map, |
239 | .gate = TDA18271_GATE_ANALOG, | 239 | .gate = TDA18271_GATE_DIGITAL, |
240 | }; | 240 | }; |
241 | 241 | ||
242 | static const struct mb86a20s_config kworld_mb86a20s_config = { | 242 | static const struct mb86a20s_config kworld_mb86a20s_config = { |
243 | .demod_address = 0x10, | 243 | .demod_address = 0x10, |
244 | }; | 244 | }; |
245 | 245 | ||
246 | static int kworld_sbtvd_gate_ctrl(struct dvb_frontend* fe, int enable) | ||
247 | { | ||
248 | struct saa7134_dev *dev = fe->dvb->priv; | ||
249 | |||
250 | unsigned char initmsg[] = {0x45, 0x97}; | ||
251 | unsigned char msg_enable[] = {0x45, 0xc1}; | ||
252 | unsigned char msg_disable[] = {0x45, 0x81}; | ||
253 | struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2}; | ||
254 | |||
255 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { | ||
256 | wprintk("could not access the I2C gate\n"); | ||
257 | return -EIO; | ||
258 | } | ||
259 | if (enable) | ||
260 | msg.buf = msg_enable; | ||
261 | else | ||
262 | msg.buf = msg_disable; | ||
263 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { | ||
264 | wprintk("could not access the I2C gate\n"); | ||
265 | return -EIO; | ||
266 | } | ||
267 | msleep(20); | ||
268 | return 0; | ||
269 | } | ||
270 | |||
246 | /* ================================================================== | 271 | /* ================================================================== |
247 | * tda1004x based DVB-T cards, helper functions | 272 | * tda1004x based DVB-T cards, helper functions |
248 | */ | 273 | */ |
@@ -1639,10 +1664,21 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1639 | &kworld_mb86a20s_config, | 1664 | &kworld_mb86a20s_config, |
1640 | &dev->i2c_adap); | 1665 | &dev->i2c_adap); |
1641 | if (fe0->dvb.frontend != NULL) { | 1666 | if (fe0->dvb.frontend != NULL) { |
1667 | #if 0 | ||
1668 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | ||
1669 | &dev->i2c_adap, 0x4b, | ||
1670 | &tda829x_no_probe); | ||
1671 | #else | ||
1672 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | ||
1673 | &dev->i2c_adap, 0x4b, NULL); | ||
1674 | #endif | ||
1642 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1675 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1643 | 0x60, &dev->i2c_adap, | 1676 | 0x60, &dev->i2c_adap, |
1644 | &kworld_tda18271_config); | 1677 | &kworld_tda18271_config); |
1678 | fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_gate_ctrl; | ||
1645 | } | 1679 | } |
1680 | |||
1681 | /* mb86a20s need to use the I2C gateway */ | ||
1646 | break; | 1682 | break; |
1647 | default: | 1683 | default: |
1648 | wprintk("Huh? unknown DVB card?\n"); | 1684 | wprintk("Huh? unknown DVB card?\n"); |