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 | |
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')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 5 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 38 |
2 files changed, 41 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index b2426000e1d8..dea90a19043f 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -5179,7 +5179,11 @@ struct saa7134_board saa7134_boards[] = { | |||
5179 | [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = { | 5179 | [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = { |
5180 | .name = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid", | 5180 | .name = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid", |
5181 | .audio_clock = 0x00187de7, | 5181 | .audio_clock = 0x00187de7, |
5182 | #if 0 | ||
5182 | .tuner_type = TUNER_PHILIPS_TDA8290, | 5183 | .tuner_type = TUNER_PHILIPS_TDA8290, |
5184 | #else | ||
5185 | .tuner_type = UNSET, | ||
5186 | #endif | ||
5183 | .tuner_addr = ADDR_UNSET, | 5187 | .tuner_addr = ADDR_UNSET, |
5184 | .radio_type = UNSET, | 5188 | .radio_type = UNSET, |
5185 | .radio_addr = ADDR_UNSET, | 5189 | .radio_addr = ADDR_UNSET, |
@@ -5191,7 +5195,6 @@ struct saa7134_board saa7134_boards[] = { | |||
5191 | .vmux = 1, | 5195 | .vmux = 1, |
5192 | .amux = TV, | 5196 | .amux = TV, |
5193 | .tv = 1, | 5197 | .tv = 1, |
5194 | .gpio = 0x4000, | ||
5195 | #if 0 /* FIXME */ | 5198 | #if 0 /* FIXME */ |
5196 | }, { | 5199 | }, { |
5197 | .name = name_comp1, | 5200 | .name = name_comp1, |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 064bf2cd5f21..d2a12df28af0 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"); |