]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dm: power: Allow regulators to be omitted from SPL
authorSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 02:43:55 +0000 (19:43 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:42:35 +0000 (20:42 -0700)
For some boards the pmic interface is useful but the regulator interface
(which comes with it) is too large. Allow them to be separated such that
SPL can decide which it needs.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/power/pmic/Kconfig
drivers/power/pmic/pmic-uclass.c
drivers/power/regulator/Kconfig
drivers/power/regulator/Makefile

index 8be3c071ca2416c56c4d6ed6726e4e18cea60f69..7f69ae1ca86a9ce6abcdc626a50fc4872f92f1cb 100644 (file)
@@ -10,6 +10,27 @@ config DM_PMIC
        - 'drivers/power/pmic/pmic-uclass.c'
        - 'include/power/pmic.h'
 
+config PMIC_CHILDREN
+       bool "Allow child devices for PMICs"
+       depends on DM_PMIC
+       default y
+       ---help---
+       This allows PMICs to support child devices (such as regulators) in
+       SPL. This adds quite a bit of code so if you are not using this
+       feature you can turn it off. Most likely you should turn it on for
+       U-Boot proper.
+
+config SPL_PMIC_CHILDREN
+       bool "Allow child devices for PMICs in SPL"
+       depends on DM_PMIC
+       default y
+       ---help---
+       This allows PMICs to support child devices (such as regulators) in
+       SPL. This adds quite a bit of code so if you are not using this
+       feature you can turn it off. In this case you may need a 'back door'
+       to call your regulator code (e.g. see rk808.c for direct functions
+       for use in SPL).
+
 config PMIC_ACT8846
        bool "Enable support for the active-semi 8846 PMIC"
        depends on DM_PMIC && DM_I2C
index 49709f30842ece7f029494ab189120ec818ddebd..8b19998136e3ec3145829740ad41c413a05e1be5 100644 (file)
@@ -18,6 +18,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if CONFIG_IS_ENABLED(PMIC_CHILDREN)
 int pmic_bind_children(struct udevice *pmic, int offset,
                       const struct pmic_child_info *child_info)
 {
@@ -84,6 +85,7 @@ int pmic_bind_children(struct udevice *pmic, int offset,
        debug("Bound: %d childs for PMIC: '%s'\n", bind_count, pmic->name);
        return bind_count;
 }
+#endif
 
 int pmic_get(const char *name, struct udevice **devp)
 {
index 8f638a9d0e0dbb8a0758b95e1b74139080070804..465ff3fda616055daf964ca15bf2797b058c4695 100644 (file)
@@ -16,6 +16,15 @@ config DM_REGULATOR
        for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_node()
        otherwise. Detailed information can be found in the header file.
 
+config SPL_DM_REGULATOR
+       bool "Enable regulators for SPL"
+       depends on DM_REGULATOR
+       ---help---
+       Regulators are seldom needed in SPL. Even if they are accessed, some
+       code space can be saved by accessing the PMIC registers directly.
+       Enable this option if you need regulators in SPL and can cope with
+       the extra code size.
+
 config REGULATOR_ACT8846
        bool "Enable driver for ACT8846 regulator"
        depends on DM_REGULATOR && PMIC_ACT8846
index 0d18c2b1dbfd2ba3037a4a1b971c8c891a6d5c60..1590d8557e7e808061851dac6bb12ac6257fb3a9 100644 (file)
@@ -5,11 +5,11 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_DM_REGULATOR) += regulator-uclass.o
+obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
 obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
 obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_DM_REGULATOR_PFUZE100) += pfuze100.o
-obj-$(CONFIG_DM_REGULATOR_FIXED) += fixed.o
+obj-$(CONFIG_$(SPL_)DM_REGULATOR_FIXED) += fixed.o
 obj-$(CONFIG_REGULATOR_RK808) += rk808.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_DM_REGULATOR_SANDBOX) += sandbox.o