aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-01-13 12:24:44 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-01-19 08:45:26 -0500
commit6183040680c56ec4bd3d7c9398cbc05e84d60c1f (patch)
tree7b9074286ac7d788eb58d445d92cb93f6b542160 /drivers/media/video
parentc736a5f28e81299b05ad14e892bdfb414daa9f5f (diff)
[media] saa7134: Fix analog mode for Kworld SBTVD
There were some issues at tda8290 that were preventing this device to work. Now that those fixes were fixed, we can enable 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.c40
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c40
2 files changed, 4 insertions, 76 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index e7aa588c6c5a..b2426000e1d8 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -5179,18 +5179,8 @@ 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 /*
5184 * FIXME: Analog mode doesn't work, if digital is enabled. The proper
5185 * fix is to use tda8290 driver, but Kworld seems to use an
5186 * unsupported version of tda8295.
5187 */
5188 .tuner_type = TUNER_NXP_TDA18271, /* TUNER_PHILIPS_TDA8290 */
5189 .tuner_addr = 0x60,
5190#else
5191 .tuner_type = UNSET,
5192 .tuner_addr = ADDR_UNSET, 5183 .tuner_addr = ADDR_UNSET,
5193#endif
5194 .radio_type = UNSET, 5184 .radio_type = UNSET,
5195 .radio_addr = ADDR_UNSET, 5185 .radio_addr = ADDR_UNSET,
5196 .gpiomask = 0x8e054000, 5186 .gpiomask = 0x8e054000,
@@ -5201,6 +5191,7 @@ struct saa7134_board saa7134_boards[] = {
5201 .vmux = 1, 5191 .vmux = 1,
5202 .amux = TV, 5192 .amux = TV,
5203 .tv = 1, 5193 .tv = 1,
5194 .gpio = 0x4000,
5204#if 0 /* FIXME */ 5195#if 0 /* FIXME */
5205 }, { 5196 }, {
5206 .name = name_comp1, 5197 .name = name_comp1,
@@ -7659,36 +7650,11 @@ int saa7134_board_init2(struct saa7134_dev *dev)
7659 break; 7650 break;
7660 } 7651 }
7661 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: 7652 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
7662 {
7663 struct i2c_msg msg = { .addr = 0x4b, .flags = 0 };
7664 int i;
7665 static u8 buffer[][2] = {
7666 {0x30, 0x31},
7667 {0xff, 0x00},
7668 {0x41, 0x03},
7669 {0x41, 0x1a},
7670 {0xff, 0x02},
7671 {0x34, 0x00},
7672 {0x45, 0x97},
7673 {0x45, 0xc1},
7674 };
7675 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); 7653 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000);
7676 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000); 7654 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000);
7677 7655
7678 /* 7656 saa7134_set_gpio(dev, 27, 0);
7679 * FIXME: identify what device is at addr 0x4b and what means
7680 * this initialization
7681 */
7682 for (i = 0; i < ARRAY_SIZE(buffer); i++) {
7683 msg.buf = &buffer[i][0];
7684 msg.len = ARRAY_SIZE(buffer[0]);
7685 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
7686 printk(KERN_WARNING
7687 "%s: Unable to enable tuner(%i).\n",
7688 dev->name, i);
7689 }
7690 break; 7657 break;
7691 }
7692 } /* switch() */ 7658 } /* switch() */
7693 7659
7694 /* initialize tuner */ 7660 /* initialize tuner */
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 3315a48a848b..064bf2cd5f21 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -236,7 +236,7 @@ static struct tda18271_std_map mb86a20s_tda18271_std_map = {
236 236
237static struct tda18271_config kworld_tda18271_config = { 237static 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_ANALOG,
240}; 240};
241 241
242static const struct mb86a20s_config kworld_mb86a20s_config = { 242static const struct mb86a20s_config kworld_mb86a20s_config = {
@@ -623,37 +623,6 @@ static struct tda827x_config tda827x_cfg_2_sw42 = {
623 623
624/* ------------------------------------------------------------------ */ 624/* ------------------------------------------------------------------ */
625 625
626static int __kworld_sbtvd_i2c_gate_ctrl(struct saa7134_dev *dev, int enable)
627{
628 unsigned char initmsg[] = {0x45, 0x97};
629 unsigned char msg_enable[] = {0x45, 0xc1};
630 unsigned char msg_disable[] = {0x45, 0x81};
631 struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2};
632
633 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
634 wprintk("could not access the I2C gate\n");
635 return -EIO;
636 }
637 if (enable)
638 msg.buf = msg_enable;
639 else
640 msg.buf = msg_disable;
641 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
642 wprintk("could not access the I2C gate\n");
643 return -EIO;
644 }
645 msleep(20);
646 return 0;
647}
648static int kworld_sbtvd_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
649{
650 struct saa7134_dev *dev = fe->dvb->priv;
651
652 return __kworld_sbtvd_i2c_gate_ctrl(dev, enable);
653}
654
655/* ------------------------------------------------------------------ */
656
657static struct tda1004x_config tda827x_lifeview_config = { 626static struct tda1004x_config tda827x_lifeview_config = {
658 .demod_address = 0x08, 627 .demod_address = 0x08,
659 .invert = 1, 628 .invert = 1,
@@ -1660,7 +1629,6 @@ static int dvb_init(struct saa7134_dev *dev)
1660 } 1629 }
1661 break; 1630 break;
1662 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: 1631 case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
1663 __kworld_sbtvd_i2c_gate_ctrl(dev, 0);
1664 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000); 1632 saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000);
1665 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000); 1633 saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000);
1666 msleep(20); 1634 msleep(20);
@@ -1670,16 +1638,10 @@ static int dvb_init(struct saa7134_dev *dev)
1670 fe0->dvb.frontend = dvb_attach(mb86a20s_attach, 1638 fe0->dvb.frontend = dvb_attach(mb86a20s_attach,
1671 &kworld_mb86a20s_config, 1639 &kworld_mb86a20s_config,
1672 &dev->i2c_adap); 1640 &dev->i2c_adap);
1673 __kworld_sbtvd_i2c_gate_ctrl(dev, 1);
1674 if (fe0->dvb.frontend != NULL) { 1641 if (fe0->dvb.frontend != NULL) {
1675 dvb_attach(tda18271_attach, fe0->dvb.frontend, 1642 dvb_attach(tda18271_attach, fe0->dvb.frontend,
1676 0x60, &dev->i2c_adap, 1643 0x60, &dev->i2c_adap,
1677 &kworld_tda18271_config); 1644 &kworld_tda18271_config);
1678 /*
1679 * Only after success, it can initialize the gate, otherwise
1680 * an OOPS will hit, due to kfree(fe0->dvb.frontend)
1681 */
1682 fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_i2c_gate_ctrl;
1683 } 1645 }
1684 break; 1646 break;
1685 default: 1647 default: