[media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional
authorDaniel Scheller <d.scheller@gmx.net>
Wed, 29 Mar 2017 16:43:01 +0000 (13:43 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 20 Jun 2017 12:18:16 +0000 (09:18 -0300)
commitf61c2991e6ee6753be35193aa46ed6fd4a77dc25
tree4733f7d7e5bfa51d8215f023caa1fbafd69e397e
parent8108f7f432e420e8de6428b3a4edec606bb627a3
[media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional

Some hardware and bridges (namely ddbridge) require that tuner access is
limited to one concurrent access and wrap i2c gate control with a
mutex_lock when attaching frontends. According to vendor information, this
is required as concurrent tuner reconfiguration can interfere each other
and at worst cause tuning fails or bad reception quality.

If the demod driver does gate_ctrl before setting up tuner parameters, and
the tuner does another I2C enable, it will deadlock forever when gate_ctrl
is wrapped into the mutex_lock. This adds a flag and a conditional before
triggering gate_ctrl in the demodulator driver.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/stv0367.c