mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] mfd: rk808: Add support for rk806 on i2c bus
Date: Wed, 18 Nov 2026 17:50:51 +0300	[thread overview]
Message-ID: <20261118145051.306697-1-eagle.alexander923@gmail.com> (raw)

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 <eagle.alexander923@gmail.com>
---
 drivers/mfd/rk808.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index aa01485143..f96c8c1d1c 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -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" },
-- 
2.56.1




                 reply	other threads:[~2026-11-18 14:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118145051.306697-1-eagle.alexander923@gmail.com \
    --to=eagle.alexander923@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox