From patchwork Fri Apr 1 23:41:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 682711 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p31NekqT005834 for ; Fri, 1 Apr 2011 23:40:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753783Ab1DAXkt (ORCPT ); Fri, 1 Apr 2011 19:40:49 -0400 Received: from na3sys009aog109.obsmtp.com ([74.125.149.201]:46920 "EHLO na3sys009aog109.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753698Ab1DAXkt (ORCPT ); Fri, 1 Apr 2011 19:40:49 -0400 Received: from source ([209.85.210.178]) (using TLSv1) by na3sys009aob109.postini.com ([74.125.148.12]) with SMTP ID DSNKTZZigHVIhcYDMLqwBgnT6GT2OK4/aash@postini.com; Fri, 01 Apr 2011 16:40:49 PDT Received: by iyi12 with SMTP id 12so4021713iyi.9 for ; Fri, 01 Apr 2011 16:40:48 -0700 (PDT) Received: by 10.43.65.71 with SMTP id xl7mr5520037icb.480.1301701248180; Fri, 01 Apr 2011 16:40:48 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id 19sm1762748ibx.18.2011.04.01.16.40.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2011 16:40:47 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH/RFC 08/13] OMAP3+: VC: cleanup voltage setup time configuration Date: Fri, 1 Apr 2011 16:41:06 -0700 Message-Id: <1301701271-22096-9-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1301701271-22096-1-git-send-email-khilman@ti.com> References: <1301701271-22096-1-git-send-email-khilman@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Apr 2011 23:40:50 +0000 (UTC) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 3fdc3fb..7731794 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -214,7 +214,6 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) { struct omap_vc_channel *vc = voltdm->vc; struct omap_vdd_info *vdd = voltdm->vdd; - u32 vc_val; if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { pr_err("%s: PMIC info requried to configure vc for" @@ -233,6 +232,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_addr; vc->volt_reg_addr = vdd->pmic_info->volt_reg_addr; vc->cmd_reg_addr = vdd->pmic_info->cmd_reg_addr; + vc->setup_time = vdd->pmic_info->volt_setup_time; /* Configure the i2c slave address for this VC */ voltdm->rmw(vc->smps_sa_mask, @@ -251,11 +251,9 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) vc->common->smps_cmdra_reg); /* Configure the setup times */ - vc_val = voltdm->read(vdd->vfsm->voltsetup_reg); - vc_val &= ~vdd->vfsm->voltsetup_mask; - vc_val |= vdd->pmic_info->volt_setup_time << - vdd->vfsm->voltsetup_shift; - voltdm->write(vc_val, vdd->vfsm->voltsetup_reg); + voltdm->rmw(voltdm->vfsm->voltsetup_mask, + vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask), + voltdm->vfsm->voltsetup_reg); if (cpu_is_omap34xx()) omap3_vc_init_channel(voltdm); diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h index 72c4ee2..ade35f7 100644 --- a/arch/arm/mach-omap2/vc.h +++ b/arch/arm/mach-omap2/vc.h @@ -66,6 +66,7 @@ struct omap_vc_channel { u8 i2c_slave_addr; u8 volt_reg_addr; u8 cmd_reg_addr; + u16 setup_time; /* register access data */ const struct omap_vc_common *common; diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index a6f29fd..db08e2a 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -67,6 +67,7 @@ struct voltagedomain { struct list_head node; struct list_head pwrdm_list; struct omap_vc_channel *vc; + const struct omap_vfsm_instance_data *vfsm; /* VC/VP register access functions: SoC specific */ u32 (*read) (u8 offset); @@ -147,7 +148,6 @@ struct omap_vdd_info { struct omap_volt_pmic_info *pmic_info; struct omap_vp_instance_data *vp_data; struct omap_vp_runtime_data vp_rt_data; - const struct omap_vfsm_instance_data *vfsm; struct dentry *debug_dir; u32 curr_volt; bool vp_enabled; diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c index 1d66749..44c7927 100644 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c @@ -39,7 +39,6 @@ static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = { static struct omap_vdd_info omap3_vdd1_info = { .vp_data = &omap3_vp1_data, - .vfsm = &omap3_vdd1_vfsm_data, }; static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = { @@ -50,7 +49,6 @@ static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = { static struct omap_vdd_info omap3_vdd2_info = { .vp_data = &omap3_vp2_data, - .vfsm = &omap3_vdd2_vfsm_data, }; static struct voltagedomain omap3_voltdm_mpu = { @@ -60,6 +58,7 @@ static struct voltagedomain omap3_voltdm_mpu = { .write = omap3_prm_vcvp_write, .rmw = omap3_prm_vcvp_rmw, .vc = &omap3_vc_mpu, + .vfsm = &omap3_vdd1_vfsm_data, .vdd = &omap3_vdd1_info, }; @@ -70,6 +69,7 @@ static struct voltagedomain omap3_voltdm_core = { .write = omap3_prm_vcvp_write, .rmw = omap3_prm_vcvp_rmw, .vc = &omap3_vc_core, + .vfsm = &omap3_vdd2_vfsm_data, .vdd = &omap3_vdd2_info, }; diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c index e435795..9dc919d 100644 --- a/arch/arm/mach-omap2/voltagedomains44xx_data.c +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c @@ -38,7 +38,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = { static struct omap_vdd_info omap4_vdd_mpu_info = { .vp_data = &omap4_vp_mpu_data, - .vfsm = &omap4_vdd_mpu_vfsm_data, }; static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = { @@ -47,7 +46,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = { static struct omap_vdd_info omap4_vdd_iva_info = { .vp_data = &omap4_vp_iva_data, - .vfsm = &omap4_vdd_iva_vfsm_data, }; static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = { @@ -56,7 +54,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = { static struct omap_vdd_info omap4_vdd_core_info = { .vp_data = &omap4_vp_core_data, - .vfsm = &omap4_vdd_core_vfsm_data, }; static struct voltagedomain omap4_voltdm_mpu = { @@ -66,6 +63,7 @@ static struct voltagedomain omap4_voltdm_mpu = { .write = omap4_prm_vcvp_write, .rmw = omap4_prm_vcvp_rmw, .vc = &omap4_vc_mpu, + .vfsm = &omap4_vdd_mpu_vfsm_data, .vdd = &omap4_vdd_mpu_info, }; @@ -76,6 +74,7 @@ static struct voltagedomain omap4_voltdm_iva = { .write = omap4_prm_vcvp_write, .rmw = omap4_prm_vcvp_rmw, .vc = &omap4_vc_iva, + .vfsm = &omap4_vdd_iva_vfsm_data, .vdd = &omap4_vdd_iva_info, }; @@ -86,6 +85,7 @@ static struct voltagedomain omap4_voltdm_core = { .write = omap4_prm_vcvp_write, .rmw = omap4_prm_vcvp_rmw, .vc = &omap4_vc_core, + .vfsm = &omap4_vdd_core_vfsm_data, .vdd = &omap4_vdd_core_info, };