aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2014-09-21 06:53:18 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-23 20:47:28 -0400
commit5dcf5bf6d9dd81cdf66aab94f62bee354a7d1238 (patch)
tree27151d2609c8b3e233441d8c7475ccbca895e9d1 /drivers/media
parent294422662215188ace50ae14318ac025a56843d8 (diff)
[media] af9035: Add possibility to define which I2C adapter to use
Some I2C tuner drivers require that the I2C device of the tuner is added to the I2C adapter of the demodulator (Si2168+Si2157 for example). Add possibility to tell af9035_add_i2c_dev which I2C adapter should be used. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 440ecb459b9c..c50d27d4a57f 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -194,12 +194,11 @@ static int af9035_wr_reg_mask(struct dvb_usb_device *d, u32 reg, u8 val,
194} 194}
195 195
196static int af9035_add_i2c_dev(struct dvb_usb_device *d, char *type, u8 addr, 196static int af9035_add_i2c_dev(struct dvb_usb_device *d, char *type, u8 addr,
197 void *platform_data) 197 void *platform_data, struct i2c_adapter *adapter)
198{ 198{
199 int ret, num; 199 int ret, num;
200 struct state *state = d_to_priv(d); 200 struct state *state = d_to_priv(d);
201 struct i2c_client *client; 201 struct i2c_client *client;
202 struct i2c_adapter *adapter = &d->i2c_adap;
203 struct i2c_board_info board_info = { 202 struct i2c_board_info board_info = {
204 .addr = addr, 203 .addr = addr,
205 .platform_data = platform_data, 204 .platform_data = platform_data,
@@ -1091,7 +1090,7 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
1091 state->af9033_config[adap->id].fe = &adap->fe[0]; 1090 state->af9033_config[adap->id].fe = &adap->fe[0];
1092 state->af9033_config[adap->id].ops = &state->ops; 1091 state->af9033_config[adap->id].ops = &state->ops;
1093 ret = af9035_add_i2c_dev(d, "af9033", state->af9033_i2c_addr[adap->id], 1092 ret = af9035_add_i2c_dev(d, "af9033", state->af9033_i2c_addr[adap->id],
1094 &state->af9033_config[adap->id]); 1093 &state->af9033_config[adap->id], &d->i2c_adap);
1095 if (ret) 1094 if (ret)
1096 goto err; 1095 goto err;
1097 1096
@@ -1382,7 +1381,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
1382 1381
1383 ret = af9035_add_i2c_dev(d, "it913x", 1382 ret = af9035_add_i2c_dev(d, "it913x",
1384 state->af9033_i2c_addr[adap->id] >> 1, 1383 state->af9033_i2c_addr[adap->id] >> 1,
1385 &it913x_config); 1384 &it913x_config, &d->i2c_adap);
1386 if (ret) 1385 if (ret)
1387 goto err; 1386 goto err;
1388 1387
@@ -1407,7 +1406,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
1407 1406
1408 ret = af9035_add_i2c_dev(d, "it913x", 1407 ret = af9035_add_i2c_dev(d, "it913x",
1409 state->af9033_i2c_addr[adap->id] >> 1, 1408 state->af9033_i2c_addr[adap->id] >> 1,
1410 &it913x_config); 1409 &it913x_config, &d->i2c_adap);
1411 if (ret) 1410 if (ret)
1412 goto err; 1411 goto err;
1413 1412