aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Barker <paul.barker.ct@bp.renesas.com>2024-02-27 20:40:31 +0000
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2024-02-28 18:42:27 +0100
commitaf22872152583f5ae35ce4fb3083e6d189e3f7c0 (patch)
tree877be3ce640a443cb2709bbe8eaf932792e74ebf
parent266e36f7ec6a5520fd459bb736a0c7c6174280a5 (diff)
downloadu-boot-af22872152583f5ae35ce4fb3083e6d189e3f7c0.zip
u-boot-af22872152583f5ae35ce4fb3083e6d189e3f7c0.tar.gz
u-boot-af22872152583f5ae35ce4fb3083e6d189e3f7c0.tar.bz2
pmic: Add Renesas RAA215300 PMIC driver
The RZ/G2L SMARC module is powered via a Renesas RAA215300 PMIC which provides several voltage converters, a real time clock (RTC) and reset control. A basic driver is implemented for this device so that we can read, write and dump the PMIC registers. The raa215300_bind() function is added as a stub, binding of the sysreset driver will be added in a later patch. Additional features of this PMIC (such as reset control) may be supported by future patches. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r--drivers/power/pmic/Kconfig9
-rw-r--r--drivers/power/pmic/Makefile1
-rw-r--r--drivers/power/pmic/raa215300.c41
3 files changed, 51 insertions, 0 deletions
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index 454a6e0..9b61b18 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -404,6 +404,15 @@ config PMIC_TPS65219
help
The TPS65219 is a PMIC containing a bunch of SMPS & LDOs.
This driver binds the pmic children.
+
+config PMIC_RAA215300
+ bool "Renesas RAA215300 PMIC driver"
+ depends on DM_PMIC
+ help
+ The Renesas RAA215300 PMIC driver includes RTC support, system reset
+ support and several voltage regulators. For now, this driver simply
+ allows register access and will bind the sysreset driver
+ (CONFIG_SYSRESET_RAA215300) if it is enabled.
endif
config PMIC_TPS65217
diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index 55ee614..a2d59de 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_PMIC_STPMIC1) += stpmic1.o
obj-$(CONFIG_PMIC_TPS65217) += pmic_tps65217.o
obj-$(CONFIG_PMIC_TPS65219) += tps65219.o
obj-$(CONFIG_PMIC_TPS65941) += tps65941.o
+obj-$(CONFIG_PMIC_RAA215300) += raa215300.o
obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
ifeq ($(CONFIG_$(SPL_)POWER_LEGACY),y)
diff --git a/drivers/power/pmic/raa215300.c b/drivers/power/pmic/raa215300.c
new file mode 100644
index 0000000..b93a0d3
--- /dev/null
+++ b/drivers/power/pmic/raa215300.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2023 Renesas Electronics Corporation
+ */
+
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <i2c.h>
+#include <power/pmic.h>
+
+#define RAA215300_REG_COUNT 0x80
+
+static int raa215300_reg_count(struct udevice *dev)
+{
+ return RAA215300_REG_COUNT;
+}
+
+static struct dm_pmic_ops raa215300_ops = {
+ .reg_count = raa215300_reg_count,
+ .read = dm_i2c_read,
+ .write = dm_i2c_write,
+};
+
+static const struct udevice_id raa215300_ids[] = {
+ { .compatible = "renesas,raa215300" },
+ { /* sentinel */ }
+};
+
+static int raa215300_bind(struct udevice *dev)
+{
+ return 0;
+}
+
+U_BOOT_DRIVER(raa215300_pmic) = {
+ .name = "raa215300_pmic",
+ .id = UCLASS_PMIC,
+ .of_match = raa215300_ids,
+ .bind = raa215300_bind,
+ .ops = &raa215300_ops,
+};