summaryrefslogtreecommitdiff
path: root/include/power/max77686_pmic.h
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2015-04-20 20:07:47 +0200
committerSimon Glass <sjg@chromium.org>2015-05-14 18:49:38 -0600
commit1757df4693fcde9fb4d4de02a22cc74d6f5caec1 (patch)
treeadd1e3d428ee3ff1897b0c20f85f983be22755cb /include/power/max77686_pmic.h
parent52a3de5e123b3c36706b3904464a409b70e2d481 (diff)
dm: regulator: add max77686 regulator driver
This commit adds support to MAX77686 regulator driver, based on a driver model regulator's API. It implements almost all regulator operations, beside those for setting and geting the Current value. For proper bind and operation it requires the MAX77686 PMIC driver. New file: drivers/power/regulator/max77686.c New config: CONFIG_DM_REGULATOR_MAX77686 Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/power/max77686_pmic.h')
-rw-r--r--include/power/max77686_pmic.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h
index 95597db5032..23003524962 100644
--- a/include/power/max77686_pmic.h
+++ b/include/power/max77686_pmic.h
@@ -149,23 +149,29 @@ enum {
enum {
OPMODE_OFF = 0,
- OPMODE_STANDBY,
OPMODE_LPM,
+ OPMODE_STANDBY,
+ OPMODE_STANDBY_LPM,
OPMODE_ON,
};
+#ifdef CONFIG_POWER
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);
int max77686_set_buck_mode(struct pmic *p, int buck, char opmode);
+#endif
#define MAX77686_LDO_VOLT_MAX_HEX 0x3f
#define MAX77686_LDO_VOLT_MASK 0x3f
#define MAX77686_LDO_MODE_MASK 0xc0
#define MAX77686_LDO_MODE_OFF (0x00 << 0x06)
+#define MAX77686_LDO_MODE_LPM (0x01 << 0x06)
#define MAX77686_LDO_MODE_STANDBY (0x01 << 0x06)
-#define MAX77686_LDO_MODE_LPM (0x02 << 0x06)
+#define MAX77686_LDO_MODE_STANDBY_LPM (0x02 << 0x06)
#define MAX77686_LDO_MODE_ON (0x03 << 0x06)
+#define MAX77686_BUCK234_VOLT_MAX_HEX 0xff
+#define MAX77686_BUCK234_VOLT_MASK 0xff
#define MAX77686_BUCK_VOLT_MAX_HEX 0x3f
#define MAX77686_BUCK_VOLT_MASK 0x3f
#define MAX77686_BUCK_MODE_MASK 0x03
@@ -176,6 +182,15 @@ int max77686_set_buck_mode(struct pmic *p, int buck, char opmode);
#define MAX77686_BUCK_MODE_LPM 0x02
#define MAX77686_BUCK_MODE_ON 0x03
+/* For regulator hex<->volt conversion */
+#define MAX77686_LDO_UV_MIN 800000 /* Minimum LDO uV value */
+#define MAX77686_LDO_UV_LSTEP 25000 /* uV lower value step */
+#define MAX77686_LDO_UV_HSTEP 50000 /* uV higher value step */
+#define MAX77686_BUCK_UV_LMIN 600000 /* Lower minimun BUCK value */
+#define MAX77686_BUCK_UV_HMIN 750000 /* Higher minimun BUCK value */
+#define MAX77686_BUCK_UV_LSTEP 12500 /* uV lower value step */
+#define MAX77686_BUCK_UV_HSTEP 50000 /* uV higher value step */
+
/* Buck1 1 volt value */
#define MAX77686_BUCK1OUT_1V 0x5
/* Buck1 1.05 volt value */