[media] dvb-frontends/cxd2841er: make call to i2c_gate_ctrl optional
authorDaniel Scheller <d.scheller@gmx.net>
Sun, 9 Apr 2017 19:38:16 +0000 (16:38 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 20 Jun 2017 12:45:20 +0000 (09:45 -0300)
commitc7518d13f70e62e2af3a30858a977365811783df
tree219f5defb93f5fbeed611c293b8eb3f0585892cc
parent050863aac09453d74be9f8b3c6b91fb1af92c5c3
[media] dvb-frontends/cxd2841er: make call to i2c_gate_ctrl optional

Some cards/bridges wrap i2c_gate_ctrl handling with a mutex_lock(). This is
e.g. done in ddbridge to protect against concurrent tuner access with
regards to the dual tuner HW, where concurrent tuner reconfiguration can
result in tuning fails or bad reception quality. When the tuner driver
additionally tries to open the I2C gate (which e.g. the tda18212 driver
does) when the demod already did this, this will lead to a deadlock. This
makes the calls to i2c_gatectrl from the demod driver optional when the
flag is set, leaving this to the tuner driver. For readability reasons and
to not have the check duplicated multiple times, the setup is factored
into cxd2841er_tuner_set().

This commit also updates the netup card driver (which seems to be the only
consumer of the cxd2841er as of now).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Acked-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/cxd2841er.c
drivers/media/dvb-frontends/cxd2841er.h
drivers/media/pci/netup_unidvb/netup_unidvb_core.c