]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mfd: Add s5m regulator operation mode
authorSangbeom Kim <sbkim73@samsung.com>
Fri, 9 Mar 2012 08:53:53 +0000 (17:53 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 1 Apr 2012 10:59:22 +0000 (11:59 +0100)
This patch add variables for opmode of s5m series.
S5M series have 4 operation modes.
Off mode is always regulator off mode.
On mode is always regulator on mode.
Lowpower mode is that regualtor operate in low-power.
Suspend mode is that regulator operation depends on AP suspend mode.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/linux/mfd/s5m87xx/s5m-core.h
include/linux/mfd/s5m87xx/s5m-pmic.h

index a7480b57f92defb99bdb0b9f9d6b80315073c2ec..21603b42f22fb150f73a5be185e6c1d615de6329 100644 (file)
@@ -335,6 +335,7 @@ extern int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask);
 
 struct s5m_platform_data {
        struct s5m_regulator_data       *regulators;
+       struct s5m_opmode_data          *opmode;
        int                             device_type;
        int                             num_regulators;
 
index a72a5d27e62e6b3b170d10223e3e44477876e4c3..7c719f20f58ab7a98340917faf80f42c65bce6de 100644 (file)
@@ -58,6 +58,8 @@ enum s5m8767_regulators {
        S5M8767_REG_MAX,
 };
 
+#define S5M8767_ENCTRL_SHIFT  6
+
 /* S5M8763 regulator ids */
 enum s5m8763_regulators {
        S5M8763_LDO1,
@@ -97,4 +99,31 @@ struct s5m_regulator_data {
        struct regulator_init_data      *initdata;
 };
 
+/*
+ * s5m_opmode_data - regulator operation mode data
+ * @id: regulator id
+ * @mode: regulator operation mode
+ */
+struct s5m_opmode_data {
+       int id;
+       int mode;
+};
+
+/*
+ * s5m regulator operation mode
+ * S5M_OPMODE_OFF      Regulator always OFF
+ * S5M_OPMODE_ON       Regulator always ON
+ * S5M_OPMODE_LOWPOWER  Regulator is on in low-power mode
+ * S5M_OPMODE_SUSPEND   Regulator is changed by PWREN pin
+ *                     If PWREN is high, regulator is on
+ *                     If PWREN is low, regulator is off
+ */
+
+enum s5m_opmode {
+       S5M_OPMODE_OFF,
+       S5M_OPMODE_ON,
+       S5M_OPMODE_LOWPOWER,
+       S5M_OPMODE_SUSPEND,
+};
+
 #endif /*  __LINUX_MFD_S5M_PMIC_H */