Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] af9033: remove I2C addr from config

I2C driver address is passed as a i2c_new_device() parameter when
device is created. Thus no need to keep it in config struct.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
a781edd1 ee36381e

+19 -20
+4 -5
drivers/media/dvb-frontends/af9033.h
··· 24 24 25 25 #include <linux/kconfig.h> 26 26 27 + /* 28 + * I2C address (TODO: are these in 8-bit format?) 29 + * 0x38, 0x3a, 0x3c, 0x3e 30 + */ 27 31 struct af9033_config { 28 - /* 29 - * I2C address 30 - */ 31 - u8 i2c_addr; 32 - 33 32 /* 34 33 * clock Hz 35 34 * 12000000, 22000000, 24000000, 34000000, 32000000, 28000000, 26000000,
+14 -15
drivers/media/usb/dvb-usb-v2/af9035.c
··· 330 330 if (msg[0].len > 40 || msg[1].len > 40) { 331 331 /* TODO: correct limits > 40 */ 332 332 ret = -EOPNOTSUPP; 333 - } else if ((msg[0].addr == state->af9033_config[0].i2c_addr) || 334 - (msg[0].addr == state->af9033_config[1].i2c_addr) || 333 + } else if ((msg[0].addr == state->af9033_i2c_addr[0]) || 334 + (msg[0].addr == state->af9033_i2c_addr[1]) || 335 335 (state->chip_type == 0x9135)) { 336 336 /* demod access via firmware interface */ 337 337 u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 | 338 338 msg[0].buf[2]; 339 339 340 - if (msg[0].addr == state->af9033_config[1].i2c_addr || 341 - msg[0].addr == (state->af9033_config[1].i2c_addr >> 1)) 340 + if (msg[0].addr == state->af9033_i2c_addr[1] || 341 + msg[0].addr == (state->af9033_i2c_addr[1] >> 1)) 342 342 reg |= 0x100000; 343 343 344 344 ret = af9035_rd_regs(d, reg, &msg[1].buf[0], ··· 362 362 if (msg[0].len > 40) { 363 363 /* TODO: correct limits > 40 */ 364 364 ret = -EOPNOTSUPP; 365 - } else if ((msg[0].addr == state->af9033_config[0].i2c_addr) || 366 - (msg[0].addr == state->af9033_config[1].i2c_addr) || 365 + } else if ((msg[0].addr == state->af9033_i2c_addr[0]) || 366 + (msg[0].addr == state->af9033_i2c_addr[1]) || 367 367 (state->chip_type == 0x9135)) { 368 368 /* demod access via firmware interface */ 369 369 u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 | 370 370 msg[0].buf[2]; 371 371 372 - if (msg[0].addr == state->af9033_config[1].i2c_addr || 373 - msg[0].addr == (state->af9033_config[1].i2c_addr >> 1)) 372 + if (msg[0].addr == state->af9033_i2c_addr[1] || 373 + msg[0].addr == (state->af9033_i2c_addr[1] >> 1)) 374 374 reg |= 0x100000; 375 375 376 376 ret = af9035_wr_regs(d, reg, &msg[0].buf[3], ··· 736 736 u16 tmp16, addr; 737 737 738 738 /* demod I2C "address" */ 739 - state->af9033_config[0].i2c_addr = 0x38; 740 - state->af9033_config[1].i2c_addr = 0x3a; 739 + state->af9033_i2c_addr[0] = 0x38; 740 + state->af9033_i2c_addr[1] = 0x3a; 741 741 state->af9033_config[0].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; 742 742 state->af9033_config[1].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; 743 743 state->af9033_config[0].ts_mode = AF9033_TS_MODE_USB; ··· 789 789 goto err; 790 790 791 791 if (tmp) 792 - state->af9033_config[1].i2c_addr = tmp; 792 + state->af9033_i2c_addr[1] = tmp; 793 793 794 794 dev_dbg(&d->udev->dev, "%s: 2nd demod I2C addr=%02x\n", 795 795 __func__, tmp); ··· 1092 1092 1093 1093 state->af9033_config[adap->id].fe = &adap->fe[0]; 1094 1094 state->af9033_config[adap->id].ops = &state->ops; 1095 - ret = af9035_add_i2c_dev(d, "af9033", 1096 - state->af9033_config[adap->id].i2c_addr, 1095 + ret = af9035_add_i2c_dev(d, "af9033", state->af9033_i2c_addr[adap->id], 1097 1096 &state->af9033_config[adap->id]); 1098 1097 if (ret) 1099 1098 goto err; ··· 1347 1348 } 1348 1349 1349 1350 ret = af9035_add_i2c_dev(d, "it913x", 1350 - state->af9033_config[adap->id].i2c_addr >> 1, 1351 + state->af9033_i2c_addr[adap->id] >> 1, 1351 1352 &it913x_config); 1352 1353 if (ret) 1353 1354 goto err; ··· 1372 1373 } 1373 1374 1374 1375 ret = af9035_add_i2c_dev(d, "it913x", 1375 - state->af9033_config[adap->id].i2c_addr >> 1, 1376 + state->af9033_i2c_addr[adap->id] >> 1, 1376 1377 &it913x_config); 1377 1378 if (ret) 1378 1379 goto err;
+1
drivers/media/usb/dvb-usb-v2/af9035.h
··· 61 61 u16 chip_type; 62 62 u8 dual_mode:1; 63 63 u16 eeprom_addr; 64 + u8 af9033_i2c_addr[2]; 64 65 struct af9033_config af9033_config[2]; 65 66 struct af9033_ops ops; 66 67 #define AF9035_I2C_CLIENT_MAX 4