diff options
author | Kevin Hilman <khilman@ti.com> | 2011-03-31 03:36:30 +0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 23:08:58 +0400 |
commit | f5395480f5088a86cc8594d29b5c2f07f6995c3d (patch) | |
tree | 85b13fd9a57214de3d59f6dbf4a3702f7873cc6e /arch/arm/mach-omap2/vc.h | |
parent | ce8ebe0dfb1f8713337cebf82499d3dced288328 (diff) | |
download | linux-f5395480f5088a86cc8594d29b5c2f07f6995c3d.tar.xz |
OMAP3+: VC: make I2C config programmable with PMIC-specific settings
Remove hard-coded I2C configuration in favor of settings that can be
configured from PMIC-specific values. Currently only high-speed mode
and the master-code value are supported, since they were the only
fields currently used, but extending this is now trivial.
Thanks to Nishanth Menon <nm@ti.com> for reporting/fixing a sparse
problem and making omap_vc_i2c_init() static, as well as finding and
fixing a problem with the shift/mask of mcode.
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vc.h')
-rw-r--r-- | arch/arm/mach-omap2/vc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h index fd385285a3bf..c86301330b75 100644 --- a/arch/arm/mach-omap2/vc.h +++ b/arch/arm/mach-omap2/vc.h @@ -37,6 +37,9 @@ struct voltagedomain; * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register * @cfg_channel_reg: VC channel configuration register + * @i2c_cfg_reg: I2C configuration register offset + * @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register + * @i2c_mcode_mask: MCODE field mask for I2C config register * * XXX One of cmd_on_mask and cmd_on_shift are not needed * XXX VALID should probably be a shift, not a mask @@ -56,6 +59,9 @@ struct omap_vc_common { u8 cmd_ret_shift; u8 cmd_off_shift; u8 cfg_channel_reg; + u8 i2c_cfg_reg; + u8 i2c_cfg_hsen_mask; + u8 i2c_mcode_mask; }; /* omap_vc_channel.flags values */ @@ -68,6 +74,7 @@ struct omap_vc_common { * @cmd_reg_addr: command configuration register address * @setup_time: setup time (in sys_clk cycles) of regulator for this channel * @cfg_channel: current value of VC channel configuration register + * @i2c_high_speed: whether or not to use I2C high-speed mode * * @common: pointer to VC common data for this platform * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register @@ -84,6 +91,7 @@ struct omap_vc_channel { u16 cmd_reg_addr; u16 setup_time; u8 cfg_channel; + bool i2c_high_speed; /* register access data */ const struct omap_vc_common *common; |