aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c40
1 files changed, 1 insertions, 39 deletions
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: