Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
ffb9948e 722a042d

+16
+16
drivers/media/usb/em28xx/em28xx-dvb.c
··· 746 746 #endif 747 747 } 748 748 749 + static 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 + 749 764 static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) 750 765 { 751 766 /* Values extracted from a USB trace of the Terratec Windows driver */ ··· 1568 1553 } 1569 1554 1570 1555 dvb->i2c_client_tuner = client; 1556 + dvb->fe[0]->ops.set_lna = em28xx_pctv_292e_set_lna; 1571 1557 } 1572 1558 break; 1573 1559 default: