regulator: max77802: Fill regulator modes translation callback
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Tue, 11 Nov 2014 12:04:44 +0000 (13:04 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 26 Nov 2014 19:42:47 +0000 (19:42 +0000)
The max77802 PMIC regulators output can be configured in one of two
modes: Output ON (normal) and Output ON in Low Power Mode. Some of
the regulators support their operating mode to be changed on startup
or by consumers when the system is running while others only support
their operating mode to be changed while the system has entered in a
suspend state.

Use the max77802_map_mode() function to translate the device specific
modes to the standard operating modes as used by the regulator core.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max77802.c

index d076df1d21668e75e3025aefcafa03f6cf97a117..0ec27cf9278523cca89eb39d3855dc605d92ff6f 100644 (file)
@@ -375,6 +375,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .vsel_mask      = MAX77802_VSEL_MASK,                           \
        .enable_reg     = MAX77802_REG_LDO1CTRL1 + num - 1,             \
        .enable_mask    = MAX77802_OPMODE_MASK << MAX77802_OPMODE_SHIFT_LDO, \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 /* LDOs 1, 2, 8, 15, 17, 27, 30, 35 */
@@ -393,6 +394,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .vsel_mask      = MAX77802_VSEL_MASK,                           \
        .enable_reg     = MAX77802_REG_LDO1CTRL1 + num - 1,             \
        .enable_mask    = MAX77802_OPMODE_MASK << MAX77802_OPMODE_SHIFT_LDO, \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 /* BUCKs 1, 6 */
@@ -411,6 +413,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .vsel_mask      = MAX77802_DVS_VSEL_MASK,                       \
        .enable_reg     = MAX77802_REG_BUCK ## num ## CTRL,             \
        .enable_mask    = MAX77802_OPMODE_MASK,                         \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 /* BUCKS 2-4 */
@@ -430,6 +433,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .enable_reg     = MAX77802_REG_BUCK ## num ## CTRL1,            \
        .enable_mask    = MAX77802_OPMODE_MASK <<                       \
                                MAX77802_OPMODE_BUCK234_SHIFT,          \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 /* BUCK 5 */
@@ -448,6 +452,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .vsel_mask      = MAX77802_VSEL_MASK,                           \
        .enable_reg     = MAX77802_REG_BUCK5CTRL,                       \
        .enable_mask    = MAX77802_OPMODE_MASK,                         \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 /* BUCKs 7-10 */
@@ -466,6 +471,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
        .vsel_mask      = MAX77802_VSEL_MASK,                           \
        .enable_reg     = MAX77802_REG_BUCK7CTRL + (num - 7) * 3,       \
        .enable_mask    = MAX77802_OPMODE_MASK,                         \
+       .of_map_mode    = max77802_map_mode,                            \
 }
 
 static const struct regulator_desc regulators[] = {
This page took 0.039764 seconds and 5 git commands to generate.