[PATCH 4/5] drivers: power: pmic: Add legacy support for rn5t567 PMIC

Martyn Welch martyn.welch at collabora.com
Thu Jul 21 15:20:39 CEST 2022


The support added later in this series tweaks the PMIC voltages in the
SPL, which doesn't support DM. Add legacy support to the rn5t567 PMIC
driver to allow that to happen.

Signed-off-by: Martyn Welch <martyn.welch at collabora.com>
---
 drivers/power/pmic/Makefile       |  1 +
 drivers/power/pmic/pmic_rn5t567.c | 31 +++++++++++++++++++++++++++++++
 include/power/rn5t567_pmic.h      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 drivers/power/pmic/pmic_rn5t567.c

diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index f73b326255..37c7584126 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -42,5 +42,6 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
 obj-$(CONFIG_POWER_HI6553) += pmic_hi6553.o
 obj-$(CONFIG_POWER_MC34VR500) += pmic_mc34vr500.o
+obj-$(CONFIG_POWER_RN5T567) += pmic_rn5t567.o
 obj-$(CONFIG_PMIC_TPS65941) += tps65941.o
 obj-$(CONFIG_PMIC_TPS65219) += tps65219.o
diff --git a/drivers/power/pmic/pmic_rn5t567.c b/drivers/power/pmic/pmic_rn5t567.c
new file mode 100644
index 0000000000..37156ef00c
--- /dev/null
+++ b/drivers/power/pmic/pmic_rn5t567.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/rn5t567_pmic.h>
+
+static const char rn5t567_name[] = "RN5T567";
+
+int power_rn5t567_init(unsigned char bus, unsigned char addr)
+{
+	struct pmic *p = pmic_alloc();
+
+	if (!p) {
+		printf("%s: POWER allocation error!\n", __func__);
+		return -ENOMEM;
+	}
+
+	p->name = rn5t567_name;
+	p->interface = PMIC_I2C;
+	p->number_of_regs = RN5T567_NUM_OF_REGS;
+	p->hw.i2c.addr = addr;
+	p->hw.i2c.tx_num = 1;
+	p->bus = bus;
+
+	return 0;
+}
diff --git a/include/power/rn5t567_pmic.h b/include/power/rn5t567_pmic.h
index 93bc7cba5a..241847ea77 100644
--- a/include/power/rn5t567_pmic.h
+++ b/include/power/rn5t567_pmic.h
@@ -109,4 +109,6 @@ enum {
 	RN5T567_NUM_OF_REGS	= 0xBF,
 };
 
+int power_rn5t567_init(unsigned char bus, unsigned char addr);
+
 #endif
-- 
2.35.1



More information about the U-Boot mailing list