[U-Boot] [PATCH 45/52] power: pmic: add SPL_DM_PMIC

peng.fan at nxp.com peng.fan at nxp.com
Tue Jul 2 02:31:59 UTC 2019


From: Peng Fan <peng.fan at nxp.com>

Introduce SPL_DM_PMIC for SPL

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/power/pmic/Kconfig  | 12 ++++++++++++
 drivers/power/pmic/Makefile |  2 +-
 include/power/pmic.h        |  2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index 450935fdc1..efcad22587 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -10,6 +10,18 @@ config DM_PMIC
 	- 'drivers/power/pmic/pmic-uclass.c'
 	- 'include/power/pmic.h'
 
+config SPL_DM_PMIC
+	bool "Enable Driver Model for PMIC drivers in SPL (UCLASS_PMIC)"
+	depends on SPL_DM
+	---help---
+	This config enables the driver-model PMIC support.
+	UCLASS_PMIC - designed to provide an I/O interface for PMIC devices.
+	For the multi-function PMIC devices, this can be used as parent I/O
+	device for each IC's interface. Then, each children uses its parent
+	for read/write. For detailed description, please refer to the files:
+	- 'drivers/power/pmic/pmic-uclass.c'
+	- 'include/power/pmic.h'
+
 config PMIC_CHILDREN
 	bool "Allow child devices for PMICs"
 	depends on DM_PMIC
diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index 888dbb2857..e60eed8ec8 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -3,7 +3,7 @@
 # Copyright (C) 2012 Samsung Electronics
 # Lukasz Majewski <l.majewski at samsung.com>
 
-obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
+obj-$(CONFIG_$(SPL_)DM_PMIC) += pmic-uclass.o
 obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o
 obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
 obj-$(CONFIG_DM_PMIC_MAX8998) += max8998.o
diff --git a/include/power/pmic.h b/include/power/pmic.h
index be9de6b4de..a228e9484f 100644
--- a/include/power/pmic.h
+++ b/include/power/pmic.h
@@ -84,7 +84,7 @@ struct pmic {
 };
 #endif /* CONFIG_POWER */
 
-#ifdef CONFIG_DM_PMIC
+#if CONFIG_IS_ENABLED(DM_PMIC)
 /**
  * U-Boot PMIC Framework
  * =====================
-- 
2.16.4



More information about the U-Boot mailing list