diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2010-02-17 22:47:55 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-18 00:46:21 -0300 |
commit | 7f2c983cf5978186ee2c379fd63d04316158fc9b (patch) | |
tree | e8db82b72129777469ea7ba3a313f4ce237447e3 /drivers/media/dvb/frontends/au8522_priv.h | |
parent | 535653b1c22c29d4e8f554928efc87fe138f917d (diff) |
V4L/DVB: au8522: fix race condition in switching from digital to analog mode
With applications like MythTV, switching inputs results in closing the digital
side and then immediately opening the analog side. This exposes a race
condition where the dvb_frontend kernel thread powers down the chip and closes
the i2c gate even though we're in the middle of bringing up the analog part
of the chip (since the shutdown of the dvb_frontend kernel thread occurs
asychronously).
Introduce a construct to keep track of what mode we're in, and drop requests
to power down or management the gate if we've already switched to analog mode.
Thanks to Zaphod Beeblebrox for reporting this issue.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/au8522_priv.h')
-rw-r--r-- | drivers/media/dvb/frontends/au8522_priv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/au8522_priv.h b/drivers/media/dvb/frontends/au8522_priv.h index c74c4e72fe9..609cf04bc31 100644 --- a/drivers/media/dvb/frontends/au8522_priv.h +++ b/drivers/media/dvb/frontends/au8522_priv.h @@ -34,10 +34,15 @@ #include "au8522.h" #include "tuner-i2c.h" +#define AU8522_ANALOG_MODE 0 +#define AU8522_DIGITAL_MODE 1 + struct au8522_state { struct i2c_client *c; struct i2c_adapter *i2c; + u8 operational_mode; + /* Used for sharing of the state between analog and digital mode */ struct tuner_i2c_props i2c_props; struct list_head hybrid_tuner_instance_list; |