diff options
author | Simon Glass <sjg@chromium.org> | 2021-08-08 12:20:27 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-04 12:26:02 -0400 |
commit | 9d8665b7091d7d67df7dd31eafe1b54e25f6c3e4 (patch) | |
tree | a433ee15481504deac558c511630d087ec1201b4 /include/power | |
parent | 29d7153ec384e072755e8951a8a33f29372f925c (diff) | |
download | u-boot-9d8665b7091d7d67df7dd31eafe1b54e25f6c3e4.tar.gz |
i2c: Convert CONFIG_POWER_I2C et al to Kconfig
This converts the following to Kconfig:
CONFIG_POWER_I2C
CONFIG_POWER_LEGACY
They are handled at the same time due to a dependency between them.
Update the Makefile rule to use legacy power only in U-Boot proper.
Unfortunately a separate rule is needed in SPL to be able to build
legacy power. Add SPL related symbols for both, to allow for SPL-only
usage.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
[trini: More SPL related cleanups, reword commit message]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/power')
-rw-r--r-- | include/power/max77686_pmic.h | 2 | ||||
-rw-r--r-- | include/power/pmic.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h index 95ba61d953..cf476c85ab 100644 --- a/include/power/max77686_pmic.h +++ b/include/power/max77686_pmic.h @@ -154,7 +154,7 @@ enum { OPMODE_ON, }; -#ifdef CONFIG_POWER_LEGACY +#if CONFIG_IS_ENABLED(POWER_LEGACY) int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV); int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode); int max77686_set_buck_voltage(struct pmic *p, int buck, ulong uV); diff --git a/include/power/pmic.h b/include/power/pmic.h index a10e173500..97f855ce39 100644 --- a/include/power/pmic.h +++ b/include/power/pmic.h @@ -18,7 +18,7 @@ enum { PMIC_I2C, PMIC_SPI, PMIC_NONE}; /* TODO: Change to !CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ -#ifdef CONFIG_POWER_LEGACY +#if CONFIG_IS_ENABLED(POWER_LEGACY) enum { I2C_PMIC, I2C_NUM, }; enum { PMIC_READ, PMIC_WRITE, }; enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, }; @@ -83,7 +83,7 @@ struct pmic { struct pmic *parent; struct list_head list; }; -#endif /* CONFIG_POWER_LEGACY */ +#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */ /* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ #ifdef CONFIG_DM_PMIC @@ -311,7 +311,7 @@ struct uc_pmic_priv { #endif /* DM_PMIC */ /* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ -#ifdef CONFIG_POWER_LEGACY +#if CONFIG_IS_ENABLED(POWER_LEGACY) /* Legacy API, do not use */ int pmic_init(unsigned char bus); @@ -324,7 +324,7 @@ int pmic_probe(struct pmic *p); int pmic_reg_read(struct pmic *p, u32 reg, u32 *val); int pmic_reg_write(struct pmic *p, u32 reg, u32 val); int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on); -#endif /* CONFIG_POWER_LEGACY */ +#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */ #define pmic_i2c_addr (p->hw.i2c.addr) #define pmic_i2c_tx_num (p->hw.i2c.tx_num) |