mfd: rk808: Add support for rk806 on i2c bus
PATCH 1/1 mfd: rk808: Add support for rk806 on i2c bus
Some boards connects the rk806 PMIC on an i2c bus.
Lets add support for these boards.
---
barebox 2026.10.0-00870-g99874936478b-dirty #214 Wed Nov 18 17:35:19 MSK 2026
Board: Diasom DS-RK3588-SMARC-EVB
rockchip-dmc memory-controller.of: Detected memory size: 0x400000000
netconsole: registered as netconsole-1
fan53555-regulator rk86020: FAN53555 Option[10] Rev[1] Detected! rk808 rk8060: chip id: 0x8060
...
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/mfd/rk808.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/mfd/rk808.c +19 -2
@@ -42,6 +42,12 @@ static const struct regmap_config rk805_regmap_config = { .max_register = RK805_OFF_SOURCE_REG, }; +static const struct regmap_config rk806_regmap_config = { + .reg_bits =8 , + .val_bits =8 , + .max_register =RK806_BUCK_RSERVE_REG5 , +}; +static const struct regmap_config rk808_regmap_config = { .reg_bits =8 , .val_bits =8 ,
@@ -234,6 +240,10 @@ static void rk808_poweroff(struct poweroff_handler *handler, reg =RK805_DEV_CTRL_REG ; bit =DEV_OFF ;break ; +case RK806_ID : + reg =RK806_SYS_CFG3 ; + bit =DEV_OFF ; +break ;case RK808_ID : reg =RK808_DEVCTRL_REG , bit =DEV_OFF_RST ;
@@ -368,6 +378,9 @@ static int rk808_probe(struct device *dev) of_device_is_compatible(np, "rockchip,rk809")) { pmic_id_msb =RK817_ID_MSB ; pmic_id_lsb =RK817_ID_LSB ; + } else if (of_device_is_compatible(np, "rockchip,rk806")) { + pmic_id_msb =RK806_CHIP_NAME ; + pmic_id_lsb =RK806_CHIP_VER ; } else { pmic_id_msb =RK808_ID_MSB ; pmic_id_lsb =RK808_ID_LSB ;
@@ -377,14 +390,14 @@ static int rk808_probe(struct device *dev) msb =i2c_smbus_read_byte_data (client, pmic_id_msb);if (msb <0 ) {dev_err (dev,"failed to read the chip id at 0x%x\n" , -RK808_ID_MSB ); + pmic_id_msb);return msb; } lsb =i2c_smbus_read_byte_data (client, pmic_id_lsb);if (lsb <0 ) {dev_err (dev,"failed to read the chip id at 0x%x\n" , -RK808_ID_LSB ); + pmic_id_lsb);return lsb; }
@@ -395,6 +408,9 @@ static int rk808_probe(struct device *dev)case RK805_ID : regmap_cfg = &rk805_regmap_config;break ; +case RK806_ID : + regmap_cfg = &rk806_regmap_config; +break ;case RK808_ID : regmap_cfg = &rk808_regmap_config;break ;
@@ -490,6 +506,7 @@ static int rk808_probe_spi(struct device *dev)static const struct of_device_id rk808_of_match[] = { { .compatible ="rockchip,rk805" }, + { .compatible ="rockchip,rk806" }, { .compatible ="rockchip,rk808" }, { .compatible ="rockchip,rk809" }, { .compatible ="rockchip,rk817" },
Signature · 1 line
2.56.1
Sascha Hauer
AppliedQuoted 4 lines · Alexander Shiyan
Some boards connects the rk806 PMIC on an i2c bus. Lets add support for these boards.
Applied, thanks!
[1/1] mfd: rk808: Add support for rk806 on i2c bus
https://git.pengutronix.de/cgit/barebox/commit/?id=dca6ceb2878c (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>