diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-14 10:03:03 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 08:45:28 -0500 |
commit | ecb71d262b0323981e07ce415da9b7adc917990a (patch) | |
tree | 5534d21db1bf922fdef9a2dde8e9790f63c53408 /drivers/media/video/saa7134/saa7134-dvb.c | |
parent | 6a58bc0f506c1825cb8f8b81a5123e26bf70902c (diff) |
[media] saa7134: Kworld SBTVD: make both analog and digital to work
There are some weird bugs at tda8290/tda18271 initialization, as it
insits do do analog initialization during DVB frontend attach:
DVB: registering new adapter (saa7133[0])
DVB: registering adapter 0 frontend 0 (Fujitsu mb86A20s)...
mb86a20s: mb86a20s_initfe
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer returned: -5
tda18271_init: [2-0060|M] error -5 on line 830
tda18271_tune: [2-0060|M] error -5 on line 908
tda18271_write_regs
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer returned: -5
tda18271c2_rf_tracking_filters_correction: [2-0060|M] error -5 on line 265
tda18271_write_regs
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x25, len = 1, i2c_transfer returned: -5
tda18271_channel_configuration: [2-0060|M] error -5 on line 119
tda18271_set_analog_params: [2-0060|M] error -5 on line 1045
tda18271_set_analog_params: [2-0060|M] error -5 on line 1045
tda829x 2-004b: tda8295 not locked, no signal?
tda829x 2-004b: tda8295_i2c_bridge: disable i2c gate
tda829x 2-004b: tda8295 not locked, no signal?
tda829x 2-004b: tda8295_i2c_bridge: disable i2c gate
mb86a20s_i2c_writereg: writereg error (rc == -5, reg == 0x29, data == 0x33)
mb86a20s: Init failed. Will try again later
The problem is that mb86a20s is only visible if the analog part is disabled.
However, due to a trick at mb86a20s, it will later initialize properly:
mb86a20s: mb86a20s_initfe: Initialization succeded.
This is hacky and ugly. However, I coldn't find any easy way to fix it.
A proper fix would be to have a resource locking schema, used by both
V4L and DVB parts that would block access to analog registers while
digital registers are in use, but this will probably put tda829x into
a dead lock.
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 | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index d2a12df28af0..f65cad287b83 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -237,6 +237,8 @@ static struct tda18271_std_map mb86a20s_tda18271_std_map = { | |||
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_DIGITAL, | 239 | .gate = TDA18271_GATE_DIGITAL, |
240 | .config = 3, /* Use tuner callback for AGC */ | ||
241 | |||
240 | }; | 242 | }; |
241 | 243 | ||
242 | static const struct mb86a20s_config kworld_mb86a20s_config = { | 244 | static const struct mb86a20s_config kworld_mb86a20s_config = { |
@@ -1654,24 +1656,16 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1654 | } | 1656 | } |
1655 | break; | 1657 | break; |
1656 | case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: | 1658 | case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: |
1657 | saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000); | 1659 | /* Switch to digital mode */ |
1658 | saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000); | 1660 | saa7134_tuner_callback(dev, 0, |
1659 | msleep(20); | 1661 | TDA18271_CALLBACK_CMD_AGC_ENABLE, 1); |
1660 | saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000); | ||
1661 | saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000); | ||
1662 | msleep(20); | ||
1663 | fe0->dvb.frontend = dvb_attach(mb86a20s_attach, | 1662 | fe0->dvb.frontend = dvb_attach(mb86a20s_attach, |
1664 | &kworld_mb86a20s_config, | 1663 | &kworld_mb86a20s_config, |
1665 | &dev->i2c_adap); | 1664 | &dev->i2c_adap); |
1666 | if (fe0->dvb.frontend != NULL) { | 1665 | if (fe0->dvb.frontend != NULL) { |
1667 | #if 0 | ||
1668 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | 1666 | dvb_attach(tda829x_attach, fe0->dvb.frontend, |
1669 | &dev->i2c_adap, 0x4b, | 1667 | &dev->i2c_adap, 0x4b, |
1670 | &tda829x_no_probe); | 1668 | &tda829x_no_probe); |
1671 | #else | ||
1672 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | ||
1673 | &dev->i2c_adap, 0x4b, NULL); | ||
1674 | #endif | ||
1675 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1669 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1676 | 0x60, &dev->i2c_adap, | 1670 | 0x60, &dev->i2c_adap, |
1677 | &kworld_tda18271_config); | 1671 | &kworld_tda18271_config); |