aboutsummaryrefslogtreecommitdiff
path: root/include/power
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-08-08 12:20:26 -0600
committerTom Rini <trini@konsulko.com>2021-09-04 12:26:02 -0400
commit29d7153ec384e072755e8951a8a33f29372f925c (patch)
treeb4ff954c27a2e645593f01811dee4e2823d3bf5c /include/power
parent7abf178bb815df7d7e1f6c5db202e02ae7d9489f (diff)
downloadu-boot-29d7153ec384e072755e8951a8a33f29372f925c.zip
u-boot-29d7153ec384e072755e8951a8a33f29372f925c.tar.gz
u-boot-29d7153ec384e072755e8951a8a33f29372f925c.tar.bz2
power: Rename CONFIG_POWER to CONFIG_POWER_LEGACY
This option is used in pre-driver model code and much of it has never been converted to driver model. We want to add a new option to enable power support, so we can use a simple rule in the Makefile. Rename this one, which is really about a particular implementation of power. Also update the pmic.h header file so it either includes the legacy API or the driver model one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'include/power')
-rw-r--r--include/power/max77686_pmic.h2
-rw-r--r--include/power/pmic.h15
2 files changed, 11 insertions, 6 deletions
diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h
index 82fe350..95ba61d 100644
--- a/include/power/max77686_pmic.h
+++ b/include/power/max77686_pmic.h
@@ -154,7 +154,7 @@ enum {
OPMODE_ON,
};
-#ifdef CONFIG_POWER
+#ifdef CONFIG_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 be9de6b..a10e173 100644
--- a/include/power/pmic.h
+++ b/include/power/pmic.h
@@ -17,7 +17,8 @@
enum { PMIC_I2C, PMIC_SPI, PMIC_NONE};
-#ifdef CONFIG_POWER
+/* TODO: Change to !CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
+#ifdef CONFIG_POWER_LEGACY
enum { I2C_PMIC, I2C_NUM, };
enum { PMIC_READ, PMIC_WRITE, };
enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, };
@@ -82,8 +83,9 @@ struct pmic {
struct pmic *parent;
struct list_head list;
};
-#endif /* CONFIG_POWER */
+#endif /* CONFIG_POWER_LEGACY */
+/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
#ifdef CONFIG_DM_PMIC
/**
* U-Boot PMIC Framework
@@ -306,9 +308,12 @@ struct uc_pmic_priv {
uint trans_len;
};
-#endif /* CONFIG_DM_PMIC */
+#endif /* DM_PMIC */
-#ifdef CONFIG_POWER
+/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
+#ifdef CONFIG_POWER_LEGACY
+
+/* Legacy API, do not use */
int pmic_init(unsigned char bus);
int power_init_board(void);
int pmic_dialog_init(unsigned char bus);
@@ -319,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
+#endif /* CONFIG_POWER_LEGACY */
#define pmic_i2c_addr (p->hw.i2c.addr)
#define pmic_i2c_tx_num (p->hw.i2c.tx_num)