Normally, I2C is used for communicating with various peripherals, and since the Power management, RTC and Audio involves communicating with an I2C peripheral, it is likely that support is needed to make that work on the Letux 400.
The device clock for I2C is the pclock or PCLK. See Clocks for details.
The data register (DR) is arranged as follows:
The control register (CR) is arranged as follows:
The status register (SR) is arranged as follows:
|4||FIFO buffer not empty|
|1||Data receive failure|
The clock generator register (GR) is arranged as follows:
|15..0||Clock divider (encoded)|
Apparently, the appropriate formula is...
I2C frequency = Device clock frequency / (Clock divider * 16)
Clock divider = Device clock frequency / (I2C frequency * 16)
The GR field is populated with an encoded value of the divider minus one, with zero therefore encoding a divider of one.
Thus, to use an I2C frequency of 400kHz, the following calculation would be used:
Clock divider = Device clock frequency / (400000 * 16)
To attain the appropriate I2C frequency, the device clock (pclock, PCLK) needs to be configured appropriately, multiplying the input clock if necessary.
In modern kernels, the following files are pertinent: