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: Optional external lock routine
Author:  Oliver Endriss <[email protected]>
Date:    Mon Jan 10 06:36:10 2011 -0300

Card driver may supply its own lock routine now.

Signed-off-by: Oliver Endriss <[email protected]>
Signed-off-by: Manu Abraham <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/frontends/stv090x.c |   21 ++++++++++++++++-----
 drivers/media/dvb/frontends/stv090x.h |    1 +
 2 files changed, 17 insertions(+), 5 deletions(-)

---

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

diff --git a/drivers/media/dvb/frontends/stv090x.c 
b/drivers/media/dvb/frontends/stv090x.c
index e26bfd7..eccad06 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -767,8 +767,12 @@ static int stv090x_i2c_gate_ctrl(struct stv090x_state 
*state, int enable)
         * In case of any error, the lock is unlocked and exit within the
         * relevant operations themselves.
         */
-       if (enable)
-               mutex_lock(&state->internal->tuner_lock);
+       if (enable) {
+               if (state->config->tuner_i2c_lock)
+                       state->config->tuner_i2c_lock(&state->frontend, 1);
+               else
+                       mutex_lock(&state->internal->tuner_lock);
+       }
 
        reg = STV090x_READ_DEMOD(state, I2CRPT);
        if (enable) {
@@ -784,13 +788,20 @@ static int stv090x_i2c_gate_ctrl(struct stv090x_state 
*state, int enable)
                        goto err;
        }
 
-       if (!enable)
-               mutex_unlock(&state->internal->tuner_lock);
+       if (!enable) {
+               if (state->config->tuner_i2c_lock)
+                       state->config->tuner_i2c_lock(&state->frontend, 0);
+               else
+                       mutex_unlock(&state->internal->tuner_lock);
+       }
 
        return 0;
 err:
        dprintk(FE_ERROR, 1, "I/O error");
-       mutex_unlock(&state->internal->tuner_lock);
+       if (state->config->tuner_i2c_lock)
+               state->config->tuner_i2c_lock(&state->frontend, 0);
+       else
+               mutex_unlock(&state->internal->tuner_lock);
        return -1;
 }
 
diff --git a/drivers/media/dvb/frontends/stv090x.h 
b/drivers/media/dvb/frontends/stv090x.h
index a3fefa7..29cdc2b 100644
--- a/drivers/media/dvb/frontends/stv090x.h
+++ b/drivers/media/dvb/frontends/stv090x.h
@@ -100,6 +100,7 @@ struct stv090x_config {
        int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
        int (*tuner_set_refclk)  (struct dvb_frontend *fe, u32 refclk);
        int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
+       void (*tuner_i2c_lock) (struct dvb_frontend *fe, int lock);
 };
 
 #if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && 
defined(MODULE))

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

Reply via email to