aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-04-22 21:56:54 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-04-23 08:56:20 -0400
commitffb9948e65e785a8660b7f1e49022cc6505e709e (patch)
tree73d0ed3ad6d216ba6b65f74ee7202cbdab78cea3
parent722a042de7c9a893a87d2d853c68473eb4000c05 (diff)
[media] em28xx: PCTV tripleStick (292e) LNA support
External LNA between antenna connector and RF tuner is controlled by EM28178 GPIO 0. GPIO value 1 is LNA active and value 0 is LNA disabled. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index b79e08bb3aad..a121ed9561fd 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -746,6 +746,21 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
746#endif 746#endif
747} 747}
748 748
749static int em28xx_pctv_292e_set_lna(struct dvb_frontend *fe)
750{
751 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
752 struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv;
753 struct em28xx *dev = i2c_bus->dev;
754 u8 lna;
755
756 if (c->lna == 1)
757 lna = 0x01;
758 else
759 lna = 0x00;
760
761 return em28xx_write_reg_bits(dev, EM2874_R80_GPIO_P0_CTRL, lna, 0x01);
762}
763
749static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) 764static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe)
750{ 765{
751 /* Values extracted from a USB trace of the Terratec Windows driver */ 766 /* Values extracted from a USB trace of the Terratec Windows driver */
@@ -1553,6 +1568,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
1553 } 1568 }
1554 1569
1555 dvb->i2c_client_tuner = client; 1570 dvb->i2c_client_tuner = client;
1571 dvb->fe[0]->ops.set_lna = em28xx_pctv_292e_set_lna;
1556 } 1572 }
1557 break; 1573 break;
1558 default: 1574 default: