aboutsummaryrefslogtreecommitdiff
path: root/include/power/pmic.h
diff options
context:
space:
mode:
authorSimon Glass2021-08-08 12:20:26 -0600
committerTom Rini2021-09-04 12:26:02 -0400
commit29d7153ec384e072755e8951a8a33f29372f925c (patch)
treeb4ff954c27a2e645593f01811dee4e2823d3bf5c /include/power/pmic.h
parent7abf178bb815df7d7e1f6c5db202e02ae7d9489f (diff)
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/pmic.h')
-rw-r--r--include/power/pmic.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/power/pmic.h b/include/power/pmic.h
index be9de6b4de7..a10e1735007 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)