Power supply control
The power supply is controlled using an LPC915 accessed via I2C/SMBUS. The schematic shows a P89LPC915 microcontroller specifically. See: https://style.nxp.com/docs/en/user-guide/UM10107.pdf
Of more direct relevance to drivers interacting with this microcontroller is the I2C-accessible interface it is programmed to expose, described as follows.
In the legacy (letux-400) kernel, the I2C address of the microcontroller is given as (0x50 >> 1) or 0x28.
The mipsbook-mcu.c driver seems to reference the following I2C-accessible addresses, registers or "commands" (as Linux calls them):
|0xd8||control (bit 0 written for power off)|
|0xd9||status (bit 0 provides status)|
It is possible that the register numbers are coincidentally similar to the internal microcontroller registers (described in a section below), but they should not be confused.
LIPO battery with usable range 7.0V - 8.4V.
Battery level scaled by resistor divider to 3V from 8.4V with LPC915 powered by 3.3V (presumably used as reference), measuring the level in 255 increments (255 corresponds to 3.3V).
level in V = (3.3V / 255) * (8.4V / 3.0V) * value level in µV = (3300000µv / 255) * (8400000µV / 3000000µV) * value level in µV = 36235 * value
Without a battery installed, the voltage level merely reflects the supply voltage.
Shutdown (Power Down/Off)
Writing a byte with bit 0 set (for example, a value of 1) to I2C address 0xd8 will cause power to be disconnected after a short delay.
Registers related to I2C defined in the NXP documentation are given as follows:
|0xd9||status (bits 7..3 provide status code)|
These are special function registers in the microcontroller itself, not I2C-accessible addresses or registers.
The following files in the vendor kernel are informative:
In modern kernels, the following files are pertinent: