u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Lukasz Majewski <l.majewski@samsung.com>
Subject: [PATCH 17/23] power: Tidy up #undef of CONFIG_DM_PMIC
Date: Sun,  8 Aug 2021 12:20:25 -0600	[thread overview]
Message-ID: <20210808182031.3747270-18-sjg@chromium.org> (raw)
In-Reply-To: <20210808182031.3747270-1-sjg@chromium.org>

Add a proper Kconfig option for SPL so we can remove the hack in some of
the board config files.

This involves adding CONFIG_SPL_DM_PMIC to some of the configs as well
as updateing the Makefile rule for PMIC_RK8XX to exclude SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 configs/imx8mm-cl-iot-gate_defconfig |  1 +
 configs/imx8mm_beacon_defconfig      |  1 +
 configs/imx8mm_evk_defconfig         |  1 +
 configs/imx8mm_venice_defconfig      |  1 +
 configs/imx8mn_evk_defconfig         |  1 +
 configs/verdin-imx8mm_defconfig      |  1 +
 drivers/power/pmic/Kconfig           | 13 +++++++++++++
 drivers/power/pmic/Makefile          |  4 ++--
 include/configs/imx8mp_evk.h         |  1 -
 include/configs/imx8mq_evk.h         |  5 -----
 include/configs/imx8mq_phanbell.h    |  5 -----
 include/configs/pico-imx8mq.h        |  5 -----
 12 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/configs/imx8mm-cl-iot-gate_defconfig b/configs/imx8mm-cl-iot-gate_defconfig
index 58eb2d49c9d..41efb0f2454 100644
--- a/configs/imx8mm-cl-iot-gate_defconfig
+++ b/configs/imx8mm-cl-iot-gate_defconfig
@@ -102,6 +102,7 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_IMX8M_POWER_DOMAIN=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
index a3f1515f4eb..0d99d04edcb 100644
--- a/configs/imx8mm_beacon_defconfig
+++ b/configs/imx8mm_beacon_defconfig
@@ -97,6 +97,7 @@ CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index e0c0c66f2db..bfd2c7aa6c1 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -74,6 +74,7 @@ CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_SPL_DM_PMIC_PCA9450=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig
index 1a98a8eb6f5..3e09a4a6639 100644
--- a/configs/imx8mm_venice_defconfig
+++ b/configs/imx8mm_venice_defconfig
@@ -99,6 +99,7 @@ CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_PMIC_MP5416=y
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index 4da37bd0227..ccbd8753b32 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -75,6 +75,7 @@ CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_SPL_DM_PMIC_PCA9450=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 341d802d611..2d7e9bebeb7 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -91,6 +91,7 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_IMX8M_POWER_DOMAIN=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_SPL_DM_PMIC_PCA9450=y
 CONFIG_DM_PMIC_PFUZE100=y
 CONFIG_DM_REGULATOR=y
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index fd6648b313e..cb2a6adf84e 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -10,6 +10,19 @@ config DM_PMIC
 	- 'drivers/power/pmic/pmic-uclass.c'
 	- 'include/power/pmic.h'
 
+config SPL_DM_PMIC
+	bool "Enable Driver Model for PMIC drivers (UCLASS_PMIC) in SPL"
+	depends on SPL_DM
+	default y if DM_PMIC
+	---help---
+	This config enables the driver-model PMIC support in SPL.
+	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 5d1a97e5f6f..5250eac12f2 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -3,7 +3,7 @@
 # Copyright (C) 2012 Samsung Electronics
 # Lukasz Majewski <l.majewski@samsung.com>
 
-obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)DM_PMIC) += pmic-uclass.o
 obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o
 obj-$(CONFIG_$(SPL_)DM_PMIC_DA9063) += da9063.o
 obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
@@ -20,7 +20,7 @@ obj-$(CONFIG_PMIC_ACT8846) += act8846.o
 obj-$(CONFIG_PMIC_AS3722) += as3722.o as3722_gpio.o
 obj-$(CONFIG_PMIC_MAX8997) += max8997.o
 obj-$(CONFIG_PMIC_PM8916) += pm8916.o
-obj-$(CONFIG_PMIC_RK8XX) += rk8xx.o
+obj-$(CONFIG_$(SPL_TPL_)PMIC_RK8XX) += rk8xx.o
 obj-$(CONFIG_PMIC_RN5T567) += rn5t567.o
 obj-$(CONFIG_PMIC_TPS65090) += tps65090.o
 obj-$(CONFIG_PMIC_S5M8767) += s5m8767.o
diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
index a6569d5566e..29c74a5c63c 100644
--- a/include/configs/imx8mp_evk.h
+++ b/include/configs/imx8mp_evk.h
@@ -30,7 +30,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
 #undef CONFIG_DM_MMC
-#undef CONFIG_DM_PMIC
 #undef CONFIG_DM_PMIC_PFUZE100
 
 #define CONFIG_POWER
diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 1008b393217..a0d061fef79 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -41,7 +41,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
 #undef CONFIG_DM_MMC
-#undef CONFIG_DM_PMIC
 #undef CONFIG_DM_PMIC_PFUZE100
 
 #define CONFIG_SYS_I2C_LEGACY
@@ -144,8 +143,4 @@
 
 #define CONFIG_OF_SYSTEM_SETUP
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_DM_PMIC
-#endif
-
 #endif
diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h
index cf62d21e930..64b4d3162e7 100644
--- a/include/configs/imx8mq_phanbell.h
+++ b/include/configs/imx8mq_phanbell.h
@@ -38,7 +38,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
 #undef CONFIG_DM_MMC
-#undef CONFIG_DM_PMIC
 #undef CONFIG_DM_PMIC_PFUZE100
 
 #define CONFIG_SYS_I2C_LEGACY
@@ -189,8 +188,4 @@
 
 #define CONFIG_OF_SYSTEM_SETUP
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_DM_PMIC
-#endif
-
 #endif
diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h
index 66fbea8f90e..f1af4db527d 100644
--- a/include/configs/pico-imx8mq.h
+++ b/include/configs/pico-imx8mq.h
@@ -38,7 +38,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
 #undef CONFIG_DM_MMC
-#undef CONFIG_DM_PMIC
 
 #define CONFIG_SYS_I2C_LEGACY
 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
@@ -168,10 +167,6 @@
 
 #define CONFIG_OF_SYSTEM_SETUP
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_DM_PMIC
-#endif
-
 #define CONFIG_SYS_BOOTM_LEN		SZ_128M
 
 #endif
-- 
2.32.0.605.g8dce9f2422-goog


  parent reply	other threads:[~2021-08-08 18:23 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08 18:20 [PATCH 00/23] Makefile: Continue simplifying Makefile rules (Part B) Simon Glass
2021-08-08 18:20 ` [PATCH 01/23] mmc: Rename MMC_SUPPORT to MMC Simon Glass
2021-08-12 22:22   ` Jaehoon Chung
2021-09-04 19:58   ` Tom Rini
2021-08-08 18:20 ` [PATCH 02/23] pch: Rename PCH_SUPPORT to PCH Simon Glass
2021-08-08 18:20 ` [PATCH 03/23] rtc: Rename RTC_SUPPORT to RTC Simon Glass
2021-08-08 18:20 ` [PATCH 04/23] serial: Rename SERIAL_SUPPORT to SERIAL Simon Glass
2021-08-08 18:20 ` [PATCH 05/23] serial: Add a SERIAL config Simon Glass
2021-08-13  1:11   ` Sean Anderson
2021-08-08 18:20 ` [PATCH 06/23] spi: Rename SPI_SUPPORT to SPI Simon Glass
2021-08-08 18:20 ` [PATCH 07/23] Rename CACHE_SUPPORT to CACHE Simon Glass
2021-08-08 18:20 ` [PATCH 08/23] ppc: Rename MPC8XXX_INIT_DDR_SUPPORT to MPC8XXX_INIT_DDR Simon Glass
2021-08-08 18:20 ` [PATCH 09/23] sata: Rename SATA_SUPPORT to SATA Simon Glass
2021-08-08 18:20 ` [PATCH 10/23] Makefile: Unify the rules for BOOTCOUNT_LIMIT Simon Glass
2021-08-08 18:20 ` [PATCH 11/23] dma: Add a Kconfig for legacy DMA Simon Glass
2021-08-08 18:20 ` [PATCH 12/23] ti: Convert CONFIG_TI_EDMA3 to Kconfig Simon Glass
2021-08-11 12:22   ` Lokesh Vutla
2021-08-08 18:20 ` [PATCH 13/23] Convert CONFIG_DMA_LPC32XX " Simon Glass
2021-08-08 18:20 ` [PATCH 14/23] Makefile: Move drivers/dma/ into drivers/Makefile Simon Glass
2021-08-08 18:20 ` [PATCH 15/23] tegra: gpio: Drop use of CONFIG_xxx variables Simon Glass
2021-08-08 18:20 ` [PATCH 16/23] gpio: Add a GPIO config Simon Glass
2021-08-08 18:20 ` Simon Glass [this message]
2021-08-12 22:19   ` [PATCH 17/23] power: Tidy up #undef of CONFIG_DM_PMIC Jaehoon Chung
2021-08-08 18:20 ` [PATCH 18/23] power: Rename CONFIG_POWER to CONFIG_POWER_LEGACY Simon Glass
2021-08-12 22:20   ` Jaehoon Chung
2021-08-08 18:20 ` [PATCH 19/23] i2c: Convert CONFIG_POWER_I2C et al to Kconfig Simon Glass
2021-08-12 22:20   ` Jaehoon Chung
2021-09-04 15:08   ` Tom Rini
2021-09-30  4:08     ` Simon Glass
2021-09-30 11:31       ` Tom Rini
2021-08-08 18:20 ` [PATCH 20/23] power: Add a POWER config Simon Glass
2021-08-08 18:20 ` [PATCH 21/23] power: Refactor Makefile rules Simon Glass
2021-08-12 22:21   ` Jaehoon Chung
2021-08-08 18:20 ` [PATCH 22/23] net: Rename SPL_NET_SUPPORT to SPL_NET Simon Glass
2021-08-08 18:20 ` [PATCH 23/23] net: Move network rules to drivers/net Simon Glass

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=20210808182031.3747270-18-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=l.majewski@samsung.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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;
as well as URLs for NNTP newsgroup(s).