aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-07-19 21:10:36 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-27 14:33:58 -0300
commit1e8f31f31726148c27de1ff4692c76c9bcff9860 (patch)
treeb593d16c49ae28aec06f8e3d42ca8b70d08a7ea6 /drivers/media/usb
parent75aeafc9d0e21222b876990946ef534b384462f1 (diff)
[media] cxd2820r: use Kernel GPIO for GPIO access
Currently there is LNA behind cxd2820r demodulator GPIO. Use Kernel GPIO interface to access those GPIOs. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/anysee.c2
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c21
2 files changed, 15 insertions, 8 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/anysee.c b/drivers/media/usb/dvb-usb-v2/anysee.c
index b430bcace0b..6705d81f0cb 100644
--- a/drivers/media/usb/dvb-usb-v2/anysee.c
+++ b/drivers/media/usb/dvb-usb-v2/anysee.c
@@ -874,7 +874,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* attach demod */
adap->fe[0] = dvb_attach(cxd2820r_attach,
- &anysee_cxd2820r_config, &d->i2c_adap);
+ &anysee_cxd2820r_config, &d->i2c_adap, NULL);
state->has_ci = true;
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a16531fa937..34c5ea99603 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -28,6 +28,7 @@
#include <media/videobuf-vmalloc.h>
#include <media/tuner.h>
#include "tuner-simple.h"
+#include <linux/gpio.h>
#include "lgdt330x.h"
#include "lgdt3305.h"
@@ -610,11 +611,6 @@ static struct tda10023_config em28xx_tda10023_config = {
static struct cxd2820r_config em28xx_cxd2820r_config = {
.i2c_address = (0xd8 >> 1),
.ts_mode = CXD2820R_TS_SERIAL,
-
- /* enable LNA for DVB-T, DVB-T2 and DVB-C */
- .gpio_dvbt[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
- .gpio_dvbt2[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
- .gpio_dvbc[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
};
static struct tda18271_config em28xx_cxd2820r_tda18271_config = {
@@ -813,7 +809,7 @@ static void em28xx_unregister_dvb(struct em28xx_dvb *dvb)
static int em28xx_dvb_init(struct em28xx *dev)
{
- int result = 0, mfe_shared = 0;
+ int result = 0, mfe_shared = 0, gpio_chip_base;
struct em28xx_dvb *dvb;
if (!dev->board.has_dvb) {
@@ -961,7 +957,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
case EM28174_BOARD_PCTV_290E:
dvb->fe[0] = dvb_attach(cxd2820r_attach,
&em28xx_cxd2820r_config,
- &dev->i2c_adap);
+ &dev->i2c_adap,
+ &gpio_chip_base);
if (dvb->fe[0]) {
/* FE 0 attach tuner */
if (!dvb_attach(tda18271_attach,
@@ -975,6 +972,16 @@ static int em28xx_dvb_init(struct em28xx *dev)
goto out_free;
}
}
+
+ /* enable LNA for DVB-T, DVB-T2 and DVB-C */
+ result = gpio_request_one(gpio_chip_base, GPIOF_INIT_LOW,
+ "LNA");
+ if (result)
+ em28xx_errdev("gpio request failed %d\n", result);
+ else
+ gpio_free(gpio_chip_base);
+
+ result = 0; /* continue even set LNA fails */
break;
case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
{