aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-10-03 03:28:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-07 09:27:49 -0400
commit33eebec55c94c755f5f4785e46a72af9238999e2 (patch)
tree65fe0bd28133e7637cd1eac75787dd26d0cd0148 /drivers/media/usb/em28xx/em28xx-dvb.c
parentd92462401dde1effa04a51d0a15000e6246d2a43 (diff)
[media] dvb: LNA implementation changes
* use dvb property cache * implement get (thus API minor++) * PCTV 290e: 1=LNA ON, all the other values LNA OFF Also fix PCTV 290e LNA comment, it is disabled by default Hans and Mauro proposed use of cache implementation of get as they were planning to extend LNA usage for analog side too. Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-dvb.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index 913e5227897a..13ae821949e9 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -574,18 +574,19 @@ static void pctv_520e_init(struct em28xx *dev)
574 i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); 574 i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len);
575}; 575};
576 576
577static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe, int val) 577static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
578{ 578{
579 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
579 struct em28xx *dev = fe->dvb->priv; 580 struct em28xx *dev = fe->dvb->priv;
580#ifdef CONFIG_GPIOLIB 581#ifdef CONFIG_GPIOLIB
581 struct em28xx_dvb *dvb = dev->dvb; 582 struct em28xx_dvb *dvb = dev->dvb;
582 int ret; 583 int ret;
583 unsigned long flags; 584 unsigned long flags;
584 585
585 if (val) 586 if (c->lna == 1)
586 flags = GPIOF_OUT_INIT_LOW; 587 flags = GPIOF_OUT_INIT_HIGH; /* enable LNA */
587 else 588 else
588 flags = GPIOF_OUT_INIT_HIGH; 589 flags = GPIOF_OUT_INIT_LOW; /* disable LNA */
589 590
590 ret = gpio_request_one(dvb->lna_gpio, flags, NULL); 591 ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
591 if (ret) 592 if (ret)
@@ -595,8 +596,8 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe, int val)
595 596
596 return ret; 597 return ret;
597#else 598#else
598 dev_warn(&dev->udev->dev, "%s: LNA control is disabled\n", 599 dev_warn(&dev->udev->dev, "%s: LNA control is disabled (lna=%u)\n",
599 KBUILD_MODNAME); 600 KBUILD_MODNAME, c->lna);
600 return 0; 601 return 0;
601#endif 602#endif
602} 603}