summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stv090x.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pboettcher@kernellabs.com>2010-10-10 18:45:54 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 00:31:32 +0100
commitb4797048f70e142a65ee2139085edb44b166d238 (patch)
tree1a5bd74dfdde3936251f962bbafd848a57d86d95 /drivers/media/dvb/frontends/stv090x.c
parentLinux 2.6.38 (diff)
downloadlinux-b4797048f70e142a65ee2139085edb44b166d238.tar.xz
linux-b4797048f70e142a65ee2139085edb44b166d238.zip
[media] stv090x: added function to control GPIOs from the outside
This patch STV090X adds and exports a function to control the GPIOs of the stv090x-devices. Cc: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Martin Wilks <m.wilks@technisat.com> Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stv090x.c')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index 4e0fc2c8a41c..63cb4f8fa6c8 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -4516,6 +4516,20 @@ err:
return -1;
}
+int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir, u8 value,
+ u8 xor_value)
+{
+ struct stv090x_state *state = fe->demodulator_priv;
+ u8 reg = 0;
+
+ STV090x_SETFIELD(reg, GPIOx_OPD_FIELD, dir);
+ STV090x_SETFIELD(reg, GPIOx_CONFIG_FIELD, value);
+ STV090x_SETFIELD(reg, GPIOx_XOR_FIELD, xor_value);
+
+ return stv090x_write_reg(state, STV090x_GPIOxCFG(gpio), reg);
+}
+EXPORT_SYMBOL(stv090x_set_gpio);
+
static struct dvb_frontend_ops stv090x_ops = {
.info = {