When selecting a register, the register byte address is written here. When reading or writing data to the I2C device, it's read/written from here.
When selecting a device, the device byte address is written here. Bit0 is unknown, when accessing certain devices(0x4A and others), the device is first selected and then the register, following that the device is reselected with device byte address bit0 set.
Wait for the busy bit to clear. Write the device address to REG_I2CDATA, then write 0xc2(busy/enable, bit 6, and start bit 1 set) to REG_I2CCNT. Execute swiWaitByLoop for a device-specific duration, then write the register address to REG_I2CDATA, and write 0xc0 to REG_I2CCNT.(busy/enable and bit 6 set) Wait with swiWaitByLoop device duration, then write the data to REG_I2CDATA when writing. When reading, write the device address to REG_I2CDATA and write 0xc2 to REG_I2CCNT. When the delay value is zero, write 0xc1 | i<<5 to REG_I2CCNT, otherwise write 0xc0 | i<<5 to REG_I2CCNT, wait for busy to clear, delay, then write 0xc5 to REG_I2CCNT. For writing i is the loop i for iteration, for reading replace that with 1. When reading, read the data from REG_I2CCNT. Return a error if REG_I2CCNT bit 4 SCL hold is set, otherwise return normal.
I2C device table:
Device address
|
Device swiWaitByLoop delay
|
Device description
|
0x00
|
0x00
|
Camera0?
|
0x80
|
0x00
|
Camera1?
|
0x00
|
0x00
|
?
|
0x00
|
0x00
|
?
|
0x7A
|
0x180
|
Power management
|
0x78
|
0x00
|
?
|
0xA0
|
0x00
|
?
|
0x4A
|
0x180
|
Power related?
|
Power management
When registers 0x70 and 0x11 are set to 1 in that order, a power cycle is done.
REGISTER
|
WIDTH
|
DESCRIPTION
|
0x11
|
1
|
System reset register 2.
|
0x12
|
1
|
Might be MMC bus power related, unknown.
|
0x31
|
1
|
Cameras' power? Value 0 turns off power to cameras? Values 1/2 activates a camera's power?
|
0x70
|
1
|
System reset register 1.
|
Device 0x4A
REGISTER
|
WIDTH
|
DESCRIPTION
|
0x0
|
1
|
Power related?
|
0x10
|
1
|
Power related?
|
0x11
|
1
|
Writing value 2 here might power off twl hw?
|
0x20
|
1
|
Shutdown related?
|