On 8/22/21 8:05 AM, Samuel Holland wrote:
> Some platforms still cannot use the driver model in SPL due to SRAM
> space limitations. However, they need to use DM_PMIC in U-Boot proper.
> Add a new symbol so that DM_PMIC can be disabled in SPL, while keeping
> it available elsewhere. Also update the SPL-specific symbols to depend
> on this new option.
> 
> Signed-off-by: Samuel Holland <[email protected]>

Reviewed-by: Jaehoon Chung <[email protected]>

Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/power/pmic/Kconfig  | 17 ++++++++++++++++-
>  drivers/power/pmic/Makefile |  2 +-
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
> index 56c0ef70312..0c4da9c5536 100644
> --- a/drivers/power/pmic/Kconfig
> +++ b/drivers/power/pmic/Kconfig
> @@ -12,6 +12,13 @@ config DM_PMIC
>  
>  if DM_PMIC
>  
> +config SPL_DM_PMIC
> +     bool "Enable Driver Model for PMIC drivers (UCLASS_PMIC) in SPL"
> +     depends on SPL_DM
> +     default y
> +     help
> +       This config enables the driver-model PMIC support in SPL.
> +
>  config PMIC_CHILDREN
>       bool "Allow child devices for PMICs"
>       default y
> @@ -23,6 +30,7 @@ config PMIC_CHILDREN
>  
>  config SPL_PMIC_CHILDREN
>       bool "Allow child devices for PMICs in SPL"
> +     depends on SPL_DM_PMIC
>       default y
>       ---help---
>       This allows PMICs to support child devices (such as regulators) in
> @@ -57,7 +65,7 @@ config DM_PMIC_DA9063
>  
>  config SPL_DM_PMIC_DA9063
>       bool "Enable Driver Model for the Dialog DA9063 PMIC in SPL"
> -     depends on SPL
> +     depends on SPL_DM_PMIC
>       help
>         This config enables implementation of driver-model pmic uclass 
> features
>         for PMIC DA9063. The driver implements read/write operations.
> @@ -78,6 +86,7 @@ config DM_PMIC_BD71837
>  
>  config SPL_DM_PMIC_BD71837
>       bool "Enable Driver Model for PMIC BD71837 in SPL stage"
> +     depends on SPL_DM_PMIC
>       help
>         This config enables implementation of driver-model pmic uclass
>         features for PMIC BD71837. The driver implements read/write
> @@ -105,6 +114,7 @@ config DM_PMIC_MP5416
>  
>  config SPL_DM_PMIC_MP5416
>       bool "Enable Driver Model for PMIC MP5416 in SPL stage"
> +     depends on SPL_DM_PMIC
>       help
>         This config enables implementation of driver-model pmic uclass
>         features for PMIC MP5416. The driver implements read/write
> @@ -118,6 +128,7 @@ config DM_PMIC_PCA9450
>  
>  config SPL_DM_PMIC_PCA9450
>       bool "Enable Driver Model for PMIC PCA9450"
> +     depends on SPL_DM_PMIC
>       help
>         This config enables implementation of driver-model pmic uclass 
> features
>         for PMIC PCA9450 in SPL. The driver implements read/write operations.
> @@ -130,6 +141,7 @@ config DM_PMIC_PFUZE100
>  
>  config SPL_DM_PMIC_PFUZE100
>       bool "Enable Driver Model for PMIC PFUZE100 in SPL"
> +     depends on SPL_DM_PMIC
>       ---help---
>       This config enables implementation of driver-model pmic uclass features
>       for PMIC PFUZE100 in SPL. The driver implements read/write operations.
> @@ -292,18 +304,21 @@ config PMIC_STPMIC1
>  
>  config SPL_PMIC_PALMAS
>       bool "Enable driver for Texas Instruments PALMAS PMIC"
> +     depends on SPL_DM_PMIC
>       help
>       The PALMAS is a PMIC containing several LDOs, SMPS.
>       This driver binds the pmic children in SPL.
>  
>  config SPL_PMIC_LP873X
>       bool "Enable driver for Texas Instruments LP873X PMIC"
> +     depends on SPL_DM_PMIC
>       help
>       The LP873X is a PMIC containing couple of LDOs and couple of SMPS.
>       This driver binds the pmic children in SPL.
>  
>  config SPL_PMIC_LP87565
>       bool "Enable driver for Texas Instruments LP87565 PMIC"
> +     depends on SPL_DM_PMIC
>       help
>       The LP87565 is a PMIC containing a bunch of SMPS.
>       This driver binds the pmic children in SPL.
> diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
> index 5d1a97e5f6f..6e40c0971fb 100644
> --- a/drivers/power/pmic/Makefile
> +++ b/drivers/power/pmic/Makefile
> @@ -3,7 +3,7 @@
>  # Copyright (C) 2012 Samsung Electronics
>  # Lukasz Majewski <[email protected]>
>  
> -obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
> +obj-$(CONFIG_$(SPL_)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
> 

Reply via email to