linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] si2168: relax demod lock checks a little
@ 2014-04-23  2:01 Antti Palosaari
  2014-04-23  2:01 ` [PATCH 2/2] em28xx: PCTV tripleStick (292e) LNA support Antti Palosaari
  0 siblings, 1 reply; 2+ messages in thread
From: Antti Palosaari @ 2014-04-23  2:01 UTC (permalink / raw)
  To: linux-media; +Cc: Antti Palosaari

bit3 was not cleared always leaving driver reporting demod is not
fully locked. Do not check bit0 as it seems to be always 0.

Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/dvb-frontends/si2168.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index dc5b64a..8637d2e 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -132,14 +132,11 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	 * [b4] statistics ready? Set in a few secs after lock is gained.
 	 */
 
-	switch ((cmd.args[2] >> 0) & 0x0f) {
-	case 0x0a:
+	switch ((cmd.args[2] >> 1) & 0x03) {
+	case 0x01:
 		*status = FE_HAS_SIGNAL | FE_HAS_CARRIER;
 		break;
-	case 0x0e:
-		*status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI;
-		break;
-	case 0x06:
+	case 0x03:
 		*status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
 				FE_HAS_SYNC | FE_HAS_LOCK;
 		break;
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] em28xx: PCTV tripleStick (292e) LNA support
  2014-04-23  2:01 [PATCH 1/2] si2168: relax demod lock checks a little Antti Palosaari
@ 2014-04-23  2:01 ` Antti Palosaari
  0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2014-04-23  2:01 UTC (permalink / raw)
  To: linux-media; +Cc: Antti Palosaari

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>
---
 drivers/media/usb/em28xx/em28xx-dvb.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index b79e08b..a121ed9 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)
 #endif
 }
 
+static int em28xx_pctv_292e_set_lna(struct dvb_frontend *fe)
+{
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv;
+	struct em28xx *dev = i2c_bus->dev;
+	u8 lna;
+
+	if (c->lna == 1)
+		lna = 0x01;
+	else
+		lna = 0x00;
+
+	return em28xx_write_reg_bits(dev, EM2874_R80_GPIO_P0_CTRL, lna, 0x01);
+}
+
 static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe)
 {
 	/* Values extracted from a USB trace of the Terratec Windows driver */
@@ -1553,6 +1568,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
 			}
 
 			dvb->i2c_client_tuner = client;
+			dvb->fe[0]->ops.set_lna = em28xx_pctv_292e_set_lna;
 		}
 		break;
 	default:
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-23  2:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23  2:01 [PATCH 1/2] si2168: relax demod lock checks a little Antti Palosaari
2014-04-23  2:01 ` [PATCH 2/2] em28xx: PCTV tripleStick (292e) LNA support Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).