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

[media] af9035: correct demod i2c addresses

Chip uses so called 8-bit i2c addresses, but on bus there is of
course correct 7-bit addresses with rw bit as lsb - verified
with oscilloscope.

Lets still use correct addresses in driver.

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

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
a71e479c 8efb34b2

+9 -8
+9 -8
drivers/media/usb/dvb-usb-v2/af9035.c
··· 772 772 /* tell the slave I2C address */ 773 773 tmp = state->eeprom[EEPROM_2ND_DEMOD_ADDR]; 774 774 775 - /* use default I2C address if eeprom has no address set */ 775 + /* Use default I2C address if eeprom has no address set */ 776 776 if (!tmp) 777 - tmp = 0x3a; 777 + tmp = 0x1d << 1; /* 8-bit format used by chip */ 778 778 779 779 if ((state->chip_type == 0x9135) || 780 780 (state->chip_type == 0x9306)) { ··· 837 837 u8 tmp; 838 838 u16 tmp16; 839 839 840 - /* demod I2C "address" */ 841 - state->af9033_i2c_addr[0] = 0x38; 842 - state->af9033_i2c_addr[1] = 0x3a; 840 + /* Demod I2C address */ 841 + state->af9033_i2c_addr[0] = 0x1c; 842 + state->af9033_i2c_addr[1] = 0x1d; 843 843 state->af9033_config[0].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; 844 844 state->af9033_config[1].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; 845 845 state->af9033_config[0].ts_mode = AF9033_TS_MODE_USB; ··· 878 878 state->ir_type = state->eeprom[EEPROM_IR_TYPE]; 879 879 880 880 if (state->dual_mode) { 881 - /* read 2nd demodulator I2C address */ 881 + /* Read 2nd demodulator I2C address. 8-bit format on eeprom */ 882 882 tmp = state->eeprom[EEPROM_2ND_DEMOD_ADDR]; 883 883 if (tmp) 884 - state->af9033_i2c_addr[1] = tmp; 884 + state->af9033_i2c_addr[1] = tmp >> 1; 885 885 886 - dev_dbg(&intf->dev, "2nd demod I2C addr=%02x\n", tmp); 886 + dev_dbg(&intf->dev, "2nd demod I2C addr=%02x\n", 887 + state->af9033_i2c_addr[1]); 887 888 } 888 889 889 890 for (i = 0; i < state->dual_mode + 1; i++) {