aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vc.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-05-17 15:20:08 -0500
committerNishanth Menon <nm@ti.com>2011-06-13 16:44:26 -0500
commita5903ce951f692c2418c048ee177f7248d5878d6 (patch)
tree5d8275f19c60fd38e038f56fcc4ebf036ed63aab /arch/arm/mach-omap2/vc.c
parent1dab90eb1990f418c27a91e73d644dc6ed67c2c0 (diff)
downloadkernel_samsung_tuna-a5903ce951f692c2418c048ee177f7248d5878d6.zip
kernel_samsung_tuna-a5903ce951f692c2418c048ee177f7248d5878d6.tar.gz
kernel_samsung_tuna-a5903ce951f692c2418c048ee177f7248d5878d6.tar.bz2
OMAP4: PM: VC: support configuration of i2c clks
Patch "OMAP2+: voltage: split voltage controller (VC) code into dedicated layer" splits out the hardcoded value in the code to vc's channel init. This patch further isolates the configuration to remove out PMIC specific configuration as high and low times are pmic specific. Values are updated as well based on latest TI analysis done in android k35 kernel. As discussed in http://marc.info/?l=linux-omap&m=130569587107997&w=2 we should, if possible isolate the changes away into board, PMIC and OMAP specific parameters, to do this, we need a better understanding of the equations involved, which we dont at this point of time and have to depend on emperical values. This patch however is necessary instead of the hardcoded assumptions in place. Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vc.c')
-rw-r--r--arch/arm/mach-omap2/vc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 2313619..2cf520d 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -291,14 +291,22 @@ static void __init omap3_vc_init_channel(struct voltagedomain *voltdm)
static void __init omap4_vc_init_channel(struct voltagedomain *voltdm)
{
static bool is_initialized;
- u32 vc_val;
+ struct omap_voltdm_pmic *pmic = voltdm->pmic;
+ u32 vc_val = 0;
if (is_initialized)
return;
- /* XXX These are magic numbers and do not belong! */
- vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT);
- voltdm->write(vc_val, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET);
+ if (pmic->i2c_high_speed) {
+ vc_val |= pmic->i2c_hscll_low << OMAP4430_HSCLL_SHIFT;
+ vc_val |= pmic->i2c_hscll_high << OMAP4430_HSCLH_SHIFT;
+ }
+
+ vc_val |= pmic->i2c_scll_low << OMAP4430_SCLL_SHIFT;
+ vc_val |= pmic->i2c_scll_high << OMAP4430_SCLH_SHIFT;
+
+ if (vc_val)
+ voltdm->write(vc_val, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET);
is_initialized = true;
}