From ba112a4e86ba8f0f9546bd953374cde064b507ca Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 29 Mar 2011 14:02:36 -0700 Subject: OMAP3+: VC: cleanup i2c slave address configuration - Add an i2c_slave_address field to the omap_vc_channel - use VC/VP read/modify/write helper instead of open-coding - remove smps_sa_shift, use __ffs(mask) for shift value - I2C addresses 10-bit, change size to u16 Special thanks to Shweta Gulati for suggesting the use of __ffs(x) instead of ffs(x) - 1. Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/vc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-omap2/vc.h') diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h index d0050f0ee6d..69ca900aff0 100644 --- a/arch/arm/mach-omap2/vc.h +++ b/arch/arm/mach-omap2/vc.h @@ -56,21 +56,24 @@ struct omap_vc_common { /** * struct omap_vc_channel - VC per-instance data + * @i2c_slave_addr: I2C slave address of PMIC for this VC channel * @common: pointer to VC common data for this platform - * @smps_sa_mask: SA* bitmask in the PRM_VC_SMPS_SA register + * @smps_sa_mask: i2c slave address bitmask in the PRM_VC_SMPS_SA register * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register - * @smps_sa_shift: SA* field shift in the PRM_VC_SMPS_SA register * @smps_volra_shift: VOLRA* field shift in the PRM_VC_VOL_RA register * * XXX It is not necessary to have both a *_mask and a *_shift - * remove one */ struct omap_vc_channel { + /* channel state */ + u16 i2c_slave_addr; + + /* register access data */ const struct omap_vc_common *common; u32 smps_sa_mask; u32 smps_volra_mask; u8 cmdval_reg; - u8 smps_sa_shift; u8 smps_volra_shift; }; -- cgit v1.2.3-70-g09d2