return ret;
}
-static int twlreg_disable(struct regulator_dev *rdev)
+static int twl4030reg_disable(struct regulator_dev *rdev)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);
int grp;
if (grp < 0)
return grp;
- /* For 6030, set the off state for all grps enabled */
- if (twl_class_is_6030()) {
- ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
- (grp & (P1_GRP_6030 | P2_GRP_6030 | P3_GRP_6030)) <<
- TWL6030_CFG_STATE_GRP_SHIFT |
- TWL6030_CFG_STATE_OFF);
- if (ret)
- return ret;
- }
-
- if (twl_class_is_4030())
- grp &= ~(P1_GRP_4030 | P2_GRP_4030 | P3_GRP_4030);
- else
- grp &= ~(P1_GRP_6030 | P2_GRP_6030 | P3_GRP_6030);
+ grp &= ~(P1_GRP_4030 | P2_GRP_4030 | P3_GRP_4030);
ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp);
- /* Next, associate cleared grp in state register */
- if (!ret && twl_class_is_6030())
- ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
- grp << TWL6030_CFG_STATE_GRP_SHIFT |
- TWL6030_CFG_STATE_OFF);
+ return ret;
+}
+
+static int twl6030reg_disable(struct regulator_dev *rdev)
+{
+ struct twlreg_info *info = rdev_get_drvdata(rdev);
+ int grp = 0;
+ int ret;
+
+ grp = P1_GRP_6030 | P2_GRP_6030 | P3_GRP_6030;
+
+ /* For 6030, set the off state for all grps enabled */
+ ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
+ (grp) << TWL6030_CFG_STATE_GRP_SHIFT |
+ TWL6030_CFG_STATE_OFF);
return ret;
}
.get_voltage = twl4030ldo_get_voltage,
.enable = twl4030reg_enable,
- .disable = twlreg_disable,
+ .disable = twl4030reg_disable,
.is_enabled = twl4030reg_is_enabled,
.set_mode = twl4030reg_set_mode,
.get_voltage = twl6030ldo_get_voltage,
.enable = twl6030reg_enable,
- .disable = twlreg_disable,
+ .disable = twl6030reg_disable,
.is_enabled = twl6030reg_is_enabled,
.set_mode = twl6030reg_set_mode,
.get_voltage = twlfixed_get_voltage,
.enable = twl4030reg_enable,
- .disable = twlreg_disable,
+ .disable = twl4030reg_disable,
.is_enabled = twl4030reg_is_enabled,
.set_mode = twl4030reg_set_mode,
.get_voltage = twlfixed_get_voltage,
.enable = twl6030reg_enable,
- .disable = twlreg_disable,
+ .disable = twl6030reg_disable,
.is_enabled = twl6030reg_is_enabled,
.set_mode = twl6030reg_set_mode,
static struct regulator_ops twl6030_fixed_resource = {
.enable = twl6030reg_enable,
- .disable = twlreg_disable,
+ .disable = twl6030reg_disable,
.is_enabled = twl6030reg_is_enabled,
.get_status = twl6030reg_get_status,
};