This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] stv090x: added function to control GPIOs from the outside
Author:  Patrick Boettcher <[email protected]>
Date:    Sun Oct 10 13:45:54 2010 -0300

This patch STV090X adds and exports a function to control the GPIOs of
the stv090x-devices.

Cc: Manu Abraham <[email protected]>
Signed-off-by: Martin Wilks <[email protected]>
Signed-off-by: Patrick Boettcher <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/frontends/stv090x.c |   14 ++++++++++++++
 drivers/media/dvb/frontends/stv090x.h |   12 ++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=a3953bd9e8ce9879bc25becb9720d1e618d9290b

diff --git a/drivers/media/dvb/frontends/stv090x.c 
b/drivers/media/dvb/frontends/stv090x.c
index 4e0fc2c..63cb4f8 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 = {
diff --git a/drivers/media/dvb/frontends/stv090x.h 
b/drivers/media/dvb/frontends/stv090x.h
index dd1b93a..11754f2 100644
--- a/drivers/media/dvb/frontends/stv090x.h
+++ b/drivers/media/dvb/frontends/stv090x.h
@@ -104,6 +104,11 @@ struct stv090x_config {
 extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
                                           struct i2c_adapter *i2c,
                                           enum stv090x_demodulator demod);
+
+/* dir = 0 -> output, dir = 1 -> input/open-drain */
+extern int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio,
+               u8 dir, u8 value, u8 xor_value);
+
 #else
 
 static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config 
*config,
@@ -113,6 +118,13 @@ static inline struct dvb_frontend *stv090x_attach(const 
struct stv090x_config *c
        printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
        return NULL;
 }
+
+static inline int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio,
+               u8 opd, u8 value, u8 xor_value)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
+       return -ENODEV;
+}
 #endif /* CONFIG_DVB_STV090x */
 
 #endif /* __STV090x_H */

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to