aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
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}