]> git.ipfire.org Git - thirdparty/u-boot.git/commit
power: rk8xx: add support for RK806
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Thu, 14 Mar 2024 09:36:18 +0000 (10:36 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 10:19:44 +0000 (18:19 +0800)
commitf172575d92cdb53b0f7b99bc76d9d6d09dbbbb8b
treeb6c9a7870f92869f6beeb3e766dbb342019b08a5
parentf047e4ab97629848963c6266bd8d3437491c651d
power: rk8xx: add support for RK806

This adds support for RK806, only the SPI variant has been tested.

The communication "protocol" over SPI is the following:
 - write three bytes:
   - 1 byte: [0:3] length of the payload, [6] Enable CRC, [7] Write
   - 1 byte: LSB register address
   - 1 byte: MSB register address
 - write/read length of payload

The CRC is always disabled for now.

The RK806 technically supports I2C as well, and this should be able to
support it without any change, but it wasn't tested.

The DT node name prefix for the buck converters has changed in the
Device Tree and is now dcdc-reg. The logic for buck converters is
however manageable within the current logic inside the rk8xx regulator
driver. The same cannot be said for the NLDO and PLDO.

Because pmic_bind_children() parses the DT nodes and extracts the LDO
index from the DT node name, NLDO and PLDO will have overlapping
indices. Therefore, we need a separate logic from the already-existing
ldo callbacks. Let's reuse as much as possible though.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
drivers/power/pmic/rk8xx.c
drivers/power/regulator/rk8xx.c
include/power/rk8xx_pmic.h