diff options
author | Kevin Hilman <khilman@ti.com> | 2011-06-09 14:01:55 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 15:02:56 -0400 |
commit | e4e021c5491537783f5f65a6defa92e6098a3658 (patch) | |
tree | 01f6736da2d7584f6740401b6f297d80f8565dc6 /arch/arm/mach-omap2/vc.h | |
parent | ba112a4e86ba8f0f9546bd953374cde064b507ca (diff) |
OMAP3+: VC: cleanup PMIC register address configuration
- support both voltage register address and command register address
for each VC channel
- add fields for voltage register address (volra) and command register
address (cmdra) to struct omap_vc_channel
- use VC/VP register access read/modify/write helper
- remove volra_shift field (use __ffs(mask) for shift value)
- I2C addresses 10-bit, change size to u16
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 | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h index 69ca900aff0b..43a0c5c2b07a 100644 --- a/arch/arm/mach-omap2/vc.h +++ b/arch/arm/mach-omap2/vc.h | |||
@@ -27,6 +27,7 @@ struct voltagedomain; | |||
27 | * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register | 27 | * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register |
28 | * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start | 28 | * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start |
29 | * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start | 29 | * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start |
30 | * @smps_cmdra_reg: Offset of PRM_VC_SMPS_CMD_RA reg from PRM start | ||
30 | * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start | 31 | * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start |
31 | * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register | 32 | * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register |
32 | * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register | 33 | * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register |
@@ -44,6 +45,7 @@ struct omap_vc_common { | |||
44 | u32 valid; | 45 | u32 valid; |
45 | u8 smps_sa_reg; | 46 | u8 smps_sa_reg; |
46 | u8 smps_volra_reg; | 47 | u8 smps_volra_reg; |
48 | u8 smps_cmdra_reg; | ||
47 | u8 bypass_val_reg; | 49 | u8 bypass_val_reg; |
48 | u8 data_shift; | 50 | u8 data_shift; |
49 | u8 slaveaddr_shift; | 51 | u8 slaveaddr_shift; |
@@ -57,24 +59,26 @@ struct omap_vc_common { | |||
57 | /** | 59 | /** |
58 | * struct omap_vc_channel - VC per-instance data | 60 | * struct omap_vc_channel - VC per-instance data |
59 | * @i2c_slave_addr: I2C slave address of PMIC for this VC channel | 61 | * @i2c_slave_addr: I2C slave address of PMIC for this VC channel |
62 | * @volt_reg_addr: voltage configuration register address | ||
63 | * @cmd_reg_addr: command configuration register address | ||
60 | * @common: pointer to VC common data for this platform | 64 | * @common: pointer to VC common data for this platform |
61 | * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register | 65 | * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register |
62 | * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register | 66 | * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register |
63 | * @smps_volra_shift: VOLRA* field shift in the PRM_VC_VOL_RA register | 67 | * @smps_cmdra_mask: CMDRA* bitmask in the PRM_VC_CMD_RA register |
64 | * | 68 | * @cmdval_reg: register for on/ret/off voltage level values for this channel |
65 | * XXX It is not necessary to have both a *_mask and a *_shift - | ||
66 | * remove one | ||
67 | */ | 69 | */ |
68 | struct omap_vc_channel { | 70 | struct omap_vc_channel { |
69 | /* channel state */ | 71 | /* channel state */ |
70 | u16 i2c_slave_addr; | 72 | u16 i2c_slave_addr; |
73 | u16 volt_reg_addr; | ||
74 | u16 cmd_reg_addr; | ||
71 | 75 | ||
72 | /* register access data */ | 76 | /* register access data */ |
73 | const struct omap_vc_common *common; | 77 | const struct omap_vc_common *common; |
74 | u32 smps_sa_mask; | 78 | u32 smps_sa_mask; |
75 | u32 smps_volra_mask; | 79 | u32 smps_volra_mask; |
80 | u32 smps_cmdra_mask; | ||
76 | u8 cmdval_reg; | 81 | u8 cmdval_reg; |
77 | u8 smps_volra_shift; | ||
78 | }; | 82 | }; |
79 | 83 | ||
80 | extern struct omap_vc_channel omap3_vc_mpu; | 84 | extern struct omap_vc_channel omap3_vc_mpu; |