@@ -171,7 +171,7 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm,
vc_valid = vc->common->valid;
vc_bypass_val_reg = vc->common->bypass_val_reg;
- vc_bypass_value = (target_vsel << vc->common->data_shift) |
+ vc_bypass_value = (target_vsel << __ffs(vc->common->data_mask)) |
(vc->volt_reg_addr << vc->common->regaddr_shift) |
(vc->i2c_slave_addr << vc->common->slaveaddr_shift);
@@ -43,8 +43,8 @@ struct voltagedomain;
struct omap_vc_common {
u32 cmd_on_mask;
u32 valid;
+ u32 data_mask;
u8 bypass_val_reg;
- u8 data_shift;
u8 slaveaddr_shift;
u8 regaddr_shift;
u8 cmd_on_shift;
@@ -31,7 +31,7 @@
*/
static struct omap_vc_common omap3_vc_common = {
.bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET,
- .data_shift = OMAP3430_DATA_SHIFT,
+ .data_mask = OMAP3430_DATA_MASK,
.slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT,
.regaddr_shift = OMAP3430_REGADDR_SHIFT,
.valid = OMAP3430_VALID_MASK,
@@ -32,7 +32,7 @@
*/
static const struct omap_vc_common omap4_vc_common = {
.bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET,
- .data_shift = OMAP4430_DATA_SHIFT,
+ .data_mask = OMAP4430_DATA_MASK,
.slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT,
.regaddr_shift = OMAP4430_REGADDR_SHIFT,
.valid = OMAP4430_VALID_MASK,