From: Olli Salonen Date: Sun, 21 Sep 2014 10:53:18 +0000 (-0300) Subject: [media] af9035: Add possibility to define which I2C adapter to use X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5dcf5bf6d9dd81cdf66aab94f62bee354a7d1238;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [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 Reviewed-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- 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, } static int af9035_add_i2c_dev(struct dvb_usb_device *d, char *type, u8 addr, - void *platform_data) + void *platform_data, struct i2c_adapter *adapter) { int ret, num; struct state *state = d_to_priv(d); struct i2c_client *client; - struct i2c_adapter *adapter = &d->i2c_adap; struct i2c_board_info board_info = { .addr = addr, .platform_data = platform_data, @@ -1091,7 +1090,7 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap) state->af9033_config[adap->id].fe = &adap->fe[0]; state->af9033_config[adap->id].ops = &state->ops; ret = af9035_add_i2c_dev(d, "af9033", state->af9033_i2c_addr[adap->id], - &state->af9033_config[adap->id]); + &state->af9033_config[adap->id], &d->i2c_adap); if (ret) goto err; @@ -1382,7 +1381,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap) ret = af9035_add_i2c_dev(d, "it913x", state->af9033_i2c_addr[adap->id] >> 1, - &it913x_config); + &it913x_config, &d->i2c_adap); if (ret) goto err; @@ -1407,7 +1406,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap) ret = af9035_add_i2c_dev(d, "it913x", state->af9033_i2c_addr[adap->id] >> 1, - &it913x_config); + &it913x_config, &d->i2c_adap); if (ret) goto err;