aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vc.h
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-30 19:36:30 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:08:58 -0400
commitf5395480f5088a86cc8594d29b5c2f07f6995c3d (patch)
tree85b13fd9a57214de3d59f6dbf4a3702f7873cc6e /arch/arm/mach-omap2/vc.h
parentce8ebe0dfb1f8713337cebf82499d3dced288328 (diff)
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.h8
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;
37 * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register 37 * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register
38 * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register 38 * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register
39 * @cfg_channel_reg: VC channel configuration register 39 * @cfg_channel_reg: VC channel configuration register
40 * @i2c_cfg_reg: I2C configuration register offset
41 * @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register
42 * @i2c_mcode_mask: MCODE field mask for I2C config register
40 * 43 *
41 * XXX One of cmd_on_mask and cmd_on_shift are not needed 44 * XXX One of cmd_on_mask and cmd_on_shift are not needed
42 * XXX VALID should probably be a shift, not a mask 45 * XXX VALID should probably be a shift, not a mask
@@ -56,6 +59,9 @@ struct omap_vc_common {
56 u8 cmd_ret_shift; 59 u8 cmd_ret_shift;
57 u8 cmd_off_shift; 60 u8 cmd_off_shift;
58 u8 cfg_channel_reg; 61 u8 cfg_channel_reg;
62 u8 i2c_cfg_reg;
63 u8 i2c_cfg_hsen_mask;
64 u8 i2c_mcode_mask;
59}; 65};
60 66
61/* omap_vc_channel.flags values */ 67/* omap_vc_channel.flags values */
@@ -68,6 +74,7 @@ struct omap_vc_common {
68 * @cmd_reg_addr: command configuration register address 74 * @cmd_reg_addr: command configuration register address
69 * @setup_time: setup time (in sys_clk cycles) of regulator for this channel 75 * @setup_time: setup time (in sys_clk cycles) of regulator for this channel
70 * @cfg_channel: current value of VC channel configuration register 76 * @cfg_channel: current value of VC channel configuration register
77 * @i2c_high_speed: whether or not to use I2C high-speed mode
71 * 78 *
72 * @common: pointer to VC common data for this platform 79 * @common: pointer to VC common data for this platform
73 * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register 80 * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register
@@ -84,6 +91,7 @@ struct omap_vc_channel {
84 u16 cmd_reg_addr; 91 u16 cmd_reg_addr;
85 u16 setup_time; 92 u16 setup_time;
86 u8 cfg_channel; 93 u8 cfg_channel;
94 bool i2c_high_speed;
87 95
88 /* register access data */ 96 /* register access data */
89 const struct omap_vc_common *common; 97 const struct omap_vc_common *common;