All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add lock to af9035 driver for dual mode
@ 2013-01-23 22:34 Jose Alberto Reguero
  2013-01-23 22:36 ` Antti Palosaari
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Alberto Reguero @ 2013-01-23 22:34 UTC (permalink / raw)
  To: LMML; +Cc: Antti Palosaari

Add lock to af9035 driver for dual mode.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>


diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c 
linux.new/drivers/media/usb/dvb-usb-v2/af9035.c
--- linux/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-07 05:45:57.000000000 
+0100
+++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-23 
23:18:18.544788327 +0100
@@ -824,6 +824,104 @@ static int af9035_get_adapter_count(stru
 	return state->dual_mode + 1;
 }
 
+static int af9035_lock_set_frontend(struct dvb_frontend* fe)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].set_frontend(fe);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_get_frontend(struct dvb_frontend* fe)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].get_frontend(fe);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_read_status(struct dvb_frontend* fe, fe_status_t* 
status)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].read_status(fe, status);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_read_ber(struct dvb_frontend* fe, u32* ber)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].read_ber(fe, ber);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_read_signal_strength(struct dvb_frontend* fe, u16* 
strength)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].read_signal_strength(fe, strength);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_read_snr(struct dvb_frontend* fe, u16* snr)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].read_snr(fe, snr);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
+static int af9035_lock_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
+{
+       int result;
+       struct dvb_usb_adapter *adap = fe_to_adap(fe);
+       struct state *state = adap_to_priv(adap);
+
+       if (mutex_lock_interruptible(&state->fe_mutex))
+               return -EAGAIN;
+
+       result = state->fe_ops[adap->id].read_ucblocks(fe, ucblocks);
+       mutex_unlock(&state->fe_mutex);
+       return result;
+}
+
 static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
 {
 	struct state *state = adap_to_priv(adap);
@@ -862,6 +960,22 @@ static int af9035_frontend_attach(struct
 	adap->fe[0]->ops.i2c_gate_ctrl = NULL;
 	adap->fe[0]->callback = af9035_frontend_callback;
 
+       memcpy(&state->fe_ops[adap->id], &adap->fe[0]->ops, sizeof(struct 
dvb_frontend_ops));
+       if (adap->fe[0]->ops.set_frontend)
+               adap->fe[0]->ops.set_frontend = af9035_lock_set_frontend;
+       if (adap->fe[0]->ops.get_frontend)
+               adap->fe[0]->ops.get_frontend = af9035_lock_get_frontend;
+       if (adap->fe[0]->ops.read_status)
+               adap->fe[0]->ops.read_status = af9035_lock_read_status;
+       if (adap->fe[0]->ops.read_ber)
+               adap->fe[0]->ops.read_ber = af9035_lock_read_ber;
+       if (adap->fe[0]->ops.read_signal_strength)
+               adap->fe[0]->ops.read_signal_strength = 
af9035_lock_read_signal_strength;
+       if (adap->fe[0]->ops.read_snr)
+               adap->fe[0]->ops.read_snr = af9035_lock_read_snr;
+       if (adap->fe[0]->ops.read_ucblocks)
+               adap->fe[0]->ops.read_ucblocks = af9035_lock_read_ucblocks;
+
 	return 0;
 
 err:
@@ -1130,6 +1244,8 @@ static int af9035_init(struct dvb_usb_de
 			"packet_size=%02x\n", __func__,
 			d->udev->speed, frame_size, packet_size);
 
+	mutex_init(&state->fe_mutex);
+
 	/* init endpoints */
 	for (i = 0; i < ARRAY_SIZE(tab); i++) {
 		ret = af9035_wr_reg_mask(d, tab[i].reg, tab[i].val,
diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.h 
linux.new/drivers/media/usb/dvb-usb-v2/af9035.h
--- linux/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-07 05:45:57.000000000 
+0100
+++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-23 
23:12:59.389532516 +0100
@@ -55,6 +55,10 @@ struct state {
 	u8 seq; /* packet sequence number */
 	bool dual_mode;
 	struct af9033_config af9033_config[2];
+
+	struct dvb_frontend_ops fe_ops[2];
+
+	struct mutex fe_mutex;
 };
 
 u32 clock_lut[] = {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add lock to af9035 driver for dual mode
  2013-01-23 22:34 [PATCH] Add lock to af9035 driver for dual mode Jose Alberto Reguero
@ 2013-01-23 22:36 ` Antti Palosaari
  2013-01-24  0:15   ` Jose Alberto Reguero
  0 siblings, 1 reply; 6+ messages in thread
From: Antti Palosaari @ 2013-01-23 22:36 UTC (permalink / raw)
  To: Jose Alberto Reguero; +Cc: LMML

On 01/24/2013 12:34 AM, Jose Alberto Reguero wrote:
> Add lock to af9035 driver for dual mode.

May I ask why you do that?

regards
Antti

>
> Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
>
>
> diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c
> linux.new/drivers/media/usb/dvb-usb-v2/af9035.c
> --- linux/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-07 05:45:57.000000000
> +0100
> +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-23
> 23:18:18.544788327 +0100
> @@ -824,6 +824,104 @@ static int af9035_get_adapter_count(stru
>   	return state->dual_mode + 1;
>   }
>
> +static int af9035_lock_set_frontend(struct dvb_frontend* fe)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].set_frontend(fe);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_get_frontend(struct dvb_frontend* fe)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].get_frontend(fe);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_read_status(struct dvb_frontend* fe, fe_status_t*
> status)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].read_status(fe, status);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_read_ber(struct dvb_frontend* fe, u32* ber)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].read_ber(fe, ber);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_read_signal_strength(struct dvb_frontend* fe, u16*
> strength)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].read_signal_strength(fe, strength);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_read_snr(struct dvb_frontend* fe, u16* snr)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].read_snr(fe, snr);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
> +static int af9035_lock_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
> +{
> +       int result;
> +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> +       struct state *state = adap_to_priv(adap);
> +
> +       if (mutex_lock_interruptible(&state->fe_mutex))
> +               return -EAGAIN;
> +
> +       result = state->fe_ops[adap->id].read_ucblocks(fe, ucblocks);
> +       mutex_unlock(&state->fe_mutex);
> +       return result;
> +}
> +
>   static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
>   {
>   	struct state *state = adap_to_priv(adap);
> @@ -862,6 +960,22 @@ static int af9035_frontend_attach(struct
>   	adap->fe[0]->ops.i2c_gate_ctrl = NULL;
>   	adap->fe[0]->callback = af9035_frontend_callback;
>
> +       memcpy(&state->fe_ops[adap->id], &adap->fe[0]->ops, sizeof(struct
> dvb_frontend_ops));
> +       if (adap->fe[0]->ops.set_frontend)
> +               adap->fe[0]->ops.set_frontend = af9035_lock_set_frontend;
> +       if (adap->fe[0]->ops.get_frontend)
> +               adap->fe[0]->ops.get_frontend = af9035_lock_get_frontend;
> +       if (adap->fe[0]->ops.read_status)
> +               adap->fe[0]->ops.read_status = af9035_lock_read_status;
> +       if (adap->fe[0]->ops.read_ber)
> +               adap->fe[0]->ops.read_ber = af9035_lock_read_ber;
> +       if (adap->fe[0]->ops.read_signal_strength)
> +               adap->fe[0]->ops.read_signal_strength =
> af9035_lock_read_signal_strength;
> +       if (adap->fe[0]->ops.read_snr)
> +               adap->fe[0]->ops.read_snr = af9035_lock_read_snr;
> +       if (adap->fe[0]->ops.read_ucblocks)
> +               adap->fe[0]->ops.read_ucblocks = af9035_lock_read_ucblocks;
> +
>   	return 0;
>
>   err:
> @@ -1130,6 +1244,8 @@ static int af9035_init(struct dvb_usb_de
>   			"packet_size=%02x\n", __func__,
>   			d->udev->speed, frame_size, packet_size);
>
> +	mutex_init(&state->fe_mutex);
> +
>   	/* init endpoints */
>   	for (i = 0; i < ARRAY_SIZE(tab); i++) {
>   		ret = af9035_wr_reg_mask(d, tab[i].reg, tab[i].val,
> diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.h
> linux.new/drivers/media/usb/dvb-usb-v2/af9035.h
> --- linux/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-07 05:45:57.000000000
> +0100
> +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-23
> 23:12:59.389532516 +0100
> @@ -55,6 +55,10 @@ struct state {
>   	u8 seq; /* packet sequence number */
>   	bool dual_mode;
>   	struct af9033_config af9033_config[2];
> +
> +	struct dvb_frontend_ops fe_ops[2];
> +
> +	struct mutex fe_mutex;
>   };
>
>   u32 clock_lut[] = {
>


-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add lock to af9035 driver for dual mode
  2013-01-23 22:36 ` Antti Palosaari
@ 2013-01-24  0:15   ` Jose Alberto Reguero
  2013-01-24  8:43     ` Antti Palosaari
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Alberto Reguero @ 2013-01-24  0:15 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML

On Jueves, 24 de enero de 2013 00:36:25 Antti Palosaari escribió:
> On 01/24/2013 12:34 AM, Jose Alberto Reguero wrote:
> > Add lock to af9035 driver for dual mode.
> 
> May I ask why you do that?
> 
> regards
> Antti
>

Just to avoid interference between the two demods.

Jose Alberto

> > Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
> > 
> > 
> > diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c
> > linux.new/drivers/media/usb/dvb-usb-v2/af9035.c
> > --- linux/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-07
> > 05:45:57.000000000 +0100
> > +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c	2013-01-23
> > 23:18:18.544788327 +0100
> > @@ -824,6 +824,104 @@ static int af9035_get_adapter_count(stru
> > 
> >   	return state->dual_mode + 1;
> >   
> >   }
> > 
> > +static int af9035_lock_set_frontend(struct dvb_frontend* fe)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].set_frontend(fe);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_get_frontend(struct dvb_frontend* fe)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].get_frontend(fe);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_read_status(struct dvb_frontend* fe, fe_status_t*
> > status)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].read_status(fe, status);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_read_ber(struct dvb_frontend* fe, u32* ber)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].read_ber(fe, ber);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_read_signal_strength(struct dvb_frontend* fe, u16*
> > strength)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].read_signal_strength(fe,
> > strength); +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_read_snr(struct dvb_frontend* fe, u16* snr)
> > +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].read_snr(fe, snr);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > +static int af9035_lock_read_ucblocks(struct dvb_frontend* fe, u32*
> > ucblocks) +{
> > +       int result;
> > +       struct dvb_usb_adapter *adap = fe_to_adap(fe);
> > +       struct state *state = adap_to_priv(adap);
> > +
> > +       if (mutex_lock_interruptible(&state->fe_mutex))
> > +               return -EAGAIN;
> > +
> > +       result = state->fe_ops[adap->id].read_ucblocks(fe, ucblocks);
> > +       mutex_unlock(&state->fe_mutex);
> > +       return result;
> > +}
> > +
> > 
> >   static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
> >   {
> >   
> >   	struct state *state = adap_to_priv(adap);
> > 
> > @@ -862,6 +960,22 @@ static int af9035_frontend_attach(struct
> > 
> >   	adap->fe[0]->ops.i2c_gate_ctrl = NULL;
> >   	adap->fe[0]->callback = af9035_frontend_callback;
> > 
> > +       memcpy(&state->fe_ops[adap->id], &adap->fe[0]->ops, sizeof(struct
> > dvb_frontend_ops));
> > +       if (adap->fe[0]->ops.set_frontend)
> > +               adap->fe[0]->ops.set_frontend = af9035_lock_set_frontend;
> > +       if (adap->fe[0]->ops.get_frontend)
> > +               adap->fe[0]->ops.get_frontend = af9035_lock_get_frontend;
> > +       if (adap->fe[0]->ops.read_status)
> > +               adap->fe[0]->ops.read_status = af9035_lock_read_status;
> > +       if (adap->fe[0]->ops.read_ber)
> > +               adap->fe[0]->ops.read_ber = af9035_lock_read_ber;
> > +       if (adap->fe[0]->ops.read_signal_strength)
> > +               adap->fe[0]->ops.read_signal_strength =
> > af9035_lock_read_signal_strength;
> > +       if (adap->fe[0]->ops.read_snr)
> > +               adap->fe[0]->ops.read_snr = af9035_lock_read_snr;
> > +       if (adap->fe[0]->ops.read_ucblocks)
> > +               adap->fe[0]->ops.read_ucblocks =
> > af9035_lock_read_ucblocks;
> > +
> > 
> >   	return 0;
> >   
> >   err:
> > @@ -1130,6 +1244,8 @@ static int af9035_init(struct dvb_usb_de
> > 
> >   			"packet_size=%02x\n", __func__,
> >   			d->udev->speed, frame_size, packet_size);
> > 
> > +	mutex_init(&state->fe_mutex);
> > +
> > 
> >   	/* init endpoints */
> >   	for (i = 0; i < ARRAY_SIZE(tab); i++) {
> >   	
> >   		ret = af9035_wr_reg_mask(d, tab[i].reg, tab[i].val,
> > 
> > diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.h
> > linux.new/drivers/media/usb/dvb-usb-v2/af9035.h
> > --- linux/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-07
> > 05:45:57.000000000 +0100
> > +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.h	2013-01-23
> > 23:12:59.389532516 +0100
> > @@ -55,6 +55,10 @@ struct state {
> > 
> >   	u8 seq; /* packet sequence number */
> >   	bool dual_mode;
> >   	struct af9033_config af9033_config[2];
> > 
> > +
> > +	struct dvb_frontend_ops fe_ops[2];
> > +
> > +	struct mutex fe_mutex;
> > 
> >   };
> >   
> >   u32 clock_lut[] = {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add lock to af9035 driver for dual mode
  2013-01-24  0:15   ` Jose Alberto Reguero
@ 2013-01-24  8:43     ` Antti Palosaari
  2013-01-27  0:10       ` Jose Alberto Reguero
  0 siblings, 1 reply; 6+ messages in thread
From: Antti Palosaari @ 2013-01-24  8:43 UTC (permalink / raw)
  To: Jose Alberto Reguero; +Cc: LMML

On 01/24/2013 02:15 AM, Jose Alberto Reguero wrote:
> On Jueves, 24 de enero de 2013 00:36:25 Antti Palosaari escribió:
>> On 01/24/2013 12:34 AM, Jose Alberto Reguero wrote:
>>> Add lock to af9035 driver for dual mode.
>>
>> May I ask why you do that?
>>
>> regards
>> Antti
>>
>
> Just to avoid interference between the two demods.
>
> Jose Alberto

... and how you can see that interference? What should I do that I can 
see these problems you are trying to fix with that patch.

regards
Antti


-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add lock to af9035 driver for dual mode
  2013-01-24  8:43     ` Antti Palosaari
@ 2013-01-27  0:10       ` Jose Alberto Reguero
  2013-01-27  9:26         ` Antti Palosaari
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Alberto Reguero @ 2013-01-27  0:10 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML

On Jueves, 24 de enero de 2013 10:43:44 Antti Palosaari escribió:
> On 01/24/2013 02:15 AM, Jose Alberto Reguero wrote:
> > On Jueves, 24 de enero de 2013 00:36:25 Antti Palosaari escribió:
> >> On 01/24/2013 12:34 AM, Jose Alberto Reguero wrote:
> >>> Add lock to af9035 driver for dual mode.
> >> 
> >> May I ask why you do that?
> >> 
> >> regards
> >> Antti
> > 
> > Just to avoid interference between the two demods.
> > 
> > Jose Alberto
> 
> ... and how you can see that interference? What should I do that I can
> see these problems you are trying to fix with that patch.
> 
> regards
> Antti

It is not to fix any real problem. It is to avoid concurrent access to both 
demods to prevent bad effects.

Jose Alberto



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add lock to af9035 driver for dual mode
  2013-01-27  0:10       ` Jose Alberto Reguero
@ 2013-01-27  9:26         ` Antti Palosaari
  0 siblings, 0 replies; 6+ messages in thread
From: Antti Palosaari @ 2013-01-27  9:26 UTC (permalink / raw)
  To: Jose Alberto Reguero; +Cc: LMML

On 01/27/2013 02:10 AM, Jose Alberto Reguero wrote:
> On Jueves, 24 de enero de 2013 10:43:44 Antti Palosaari escribió:
>> On 01/24/2013 02:15 AM, Jose Alberto Reguero wrote:
>>> On Jueves, 24 de enero de 2013 00:36:25 Antti Palosaari escribió:
>>>> On 01/24/2013 12:34 AM, Jose Alberto Reguero wrote:
>>>>> Add lock to af9035 driver for dual mode.
>>>>
>>>> May I ask why you do that?
>>>>
>>>> regards
>>>> Antti
>>>
>>> Just to avoid interference between the two demods.
>>>
>>> Jose Alberto
>>
>> ... and how you can see that interference? What should I do that I can
>> see these problems you are trying to fix with that patch.
>>
>> regards
>> Antti
>
> It is not to fix any real problem. It is to avoid concurrent access to both
> demods to prevent bad effects.
>
> Jose Alberto

You copy & pasted it from the AF9015 driver. The reason why it is there 
is firmware, which has some problems if it was interrupted in some 
cases. Like you were asking BER from the demod and then tuner access was 
done using same I2C adapter. AF9015 firmware offers I2C adapter for 2 
demod and 2 RF-tuners. First demod is integrated and is memory mapped - 
but what I remember you could access it via I2C too. AF9015 fw also has 
internally some logic, it access to tuner and demod registers directly.

Those locks seen in AF9015 driver are mostly due to af9015 firmware 
limitations and should not be copied to the any other driver without a 
real need. AF9035 fw seems to behave a better.

regards
Antti

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-27  9:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 22:34 [PATCH] Add lock to af9035 driver for dual mode Jose Alberto Reguero
2013-01-23 22:36 ` Antti Palosaari
2013-01-24  0:15   ` Jose Alberto Reguero
2013-01-24  8:43     ` Antti Palosaari
2013-01-27  0:10       ` Jose Alberto Reguero
2013-01-27  9:26         ` Antti Palosaari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.