summaryrefslogtreecommitdiff
path: root/drivers/media/usb/cx231xx/cx231xx-core.c
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2016-04-20 06:42:17 (GMT)
committerWolfram Sang <wsa@the-dreams.de>2016-04-22 13:00:17 (GMT)
commit05e0dfd0311bd6dd3cdb6cb32acd1e701c451e9b (patch)
tree88040c608d0f1981886d691cf092157011165a4c /drivers/media/usb/cx231xx/cx231xx-core.c
parent58d7b541dd96535b03cc9dd13fe9efff2a5402e0 (diff)
downloadlinux-05e0dfd0311bd6dd3cdb6cb32acd1e701c451e9b.tar.xz
[media] cx231xx: convert to use an explicit i2c mux core
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select op to be in terms of the i2c mux core instead of the child adapter. Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-core.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index f497888..f7aac2a 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -1304,6 +1304,9 @@ int cx231xx_dev_init(struct cx231xx *dev)
cx231xx_i2c_register(&dev->i2c_bus[1]);
cx231xx_i2c_register(&dev->i2c_bus[2]);
+ errCode = cx231xx_i2c_mux_create(dev);
+ if (errCode < 0)
+ return errCode;
cx231xx_i2c_mux_register(dev, 0);
cx231xx_i2c_mux_register(dev, 1);
@@ -1426,8 +1429,7 @@ EXPORT_SYMBOL_GPL(cx231xx_dev_init);
void cx231xx_dev_uninit(struct cx231xx *dev)
{
/* Un Initialize I2C bus */
- cx231xx_i2c_mux_unregister(dev, 1);
- cx231xx_i2c_mux_unregister(dev, 0);
+ cx231xx_i2c_mux_unregister(dev);
cx231xx_i2c_unregister(&dev->i2c_bus[2]);
cx231xx_i2c_unregister(&dev->i2c_bus[1]);
cx231xx_i2c_unregister(&dev->i2c_bus[0]);