aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-17 00:55:41 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 13:20:46 -0500
commit1dbbdceeb63e9039ce0545e5e21cf9a8c4d4ffc4 (patch)
treed1761700da1bc2bef601a926f527136869a91b0f /drivers/media/usb
parenta08c3781194142cce39bbb739373efc8dacaa1fa (diff)
[media] rtl28xxu: fix DVB FE callback
DVB FE callback functionality went broken after I moved tuners to demod muxed I2C adapter. That happens because driver state was carried by I2C adapter and when mux is used there is one adapter more in a chain. USB adapter <-> I2C adapter <-> muxed I2C adapter Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 0d37d0c06d79..1f29307b9d72 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -740,8 +740,23 @@ static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg)
740static int rtl2832u_frontend_callback(void *adapter_priv, int component, 740static int rtl2832u_frontend_callback(void *adapter_priv, int component,
741 int cmd, int arg) 741 int cmd, int arg)
742{ 742{
743 struct i2c_adapter *adap = adapter_priv; 743 struct i2c_adapter *adapter = adapter_priv;
744 struct dvb_usb_device *d = i2c_get_adapdata(adap); 744 struct device *parent = adapter->dev.parent;
745 struct i2c_adapter *parent_adapter;
746 struct dvb_usb_device *d;
747
748 /*
749 * All tuners are connected to demod muxed I2C adapter. We have to
750 * resolve its parent adapter in order to get handle for this driver
751 * private data. That is a bit hackish solution, GPIO or direct driver
752 * callback would be better...
753 */
754 if (parent != NULL && parent->type == &i2c_adapter_type)
755 parent_adapter = to_i2c_adapter(parent);
756 else
757 return -EINVAL;
758
759 d = i2c_get_adapdata(parent_adapter);
745 760
746 dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", 761 dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n",
747 __func__, component, cmd, arg); 762 __func__, component, cmd, arg);