现象:I2C的低电平下不去,改大上拉电阻值
MT6739
\vendor\mediatek\proprietary\bootable\bootloader\preloader\platform\mt6739\src\drivers\i2c.c
int i2c_hw_init(void)
{
/*Switch to GPIO pad*/
+ I2C_SET_REG32(0x10002A20, 0xFF, 0x0);
/*Disable pull up*/
+ I2C_SET_REG32(0x10002A50, (0xFF << 3), (0x0 << 3));
/*Switch to 75k*/
/* 0x0:75k 0x1:5k */
/* 0x2:15k 0x3:1k */
/* SDA0[3:2], SCL0 [1:0] */
/* SDA1[7:6], SCL1 [5:4] */
/* SDA2[11:10], SCL2 [9:8] */
/* SDA3[15:14], SCL3 [13:12] */
- I2C_SET_REG32(0x10002A70, 0xFFFF, 0x5555);
+ I2C_SET_REG32(0x10002A70, 0xFFFF, 0x0);
return 0;
}
\kernel-4.4\arch\arm\boot\dts\mt6739.dtsi
i2c-x的属性aed = <0>; /*aed = <0x1f>; Kphone add i2c patch */
MT6761 改I2C4
\vendor\mediatek\proprietary\bootable\bootloader\preloader\platform\mt6761\src\drivers\i2c.c
/* Switch internal resistor */
/* 0x0:75k 0x1:5k */
/* 0x2:15k 0x3:1k */
/*I2C0,1*/
I2C_SET_REG32(0x10002a00 + 0x70, 0xFF, 0xFF);
/*I2C2,4*/
- I2C_SET_REG32(0x10002800 + 0xA0, 0xFF, 0xFF);
+ I2C_SET_REG32(0x10002800 + 0xA0, 0xFF, 0);
/*I2C6*/
I2C_SET_REG32(0x10002c00 + 0x70, 0xF, 0xF);
/*I2C3,5*/
I2C_SET_REG32(0x10002600 + 0xb0, 0xFF, 0xFF);