From: Kevin Hilman <khilman@ti.com> To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/12] OMAP3+: VP: move timing calculation/config into VP init Date: Mon, 29 Aug 2011 10:58:05 -0700 [thread overview] Message-ID: <1314640692-3386-6-git-send-email-khilman@ti.com> (raw) In-Reply-To: <1314640692-3386-1-git-send-email-khilman@ti.com> Move VP timing calcluation (based on sys clock) and register programming into VP init. Signed-off-by: Kevin Hilman <khilman@ti.com> --- arch/arm/mach-omap2/voltage.c | 22 ---------------------- arch/arm/mach-omap2/vp.c | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 533ea38..4a15668 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -46,31 +46,9 @@ static LIST_HEAD(voltdm_list); static int __init _config_common_vdd_data(struct voltagedomain *voltdm) { struct omap_vdd_info *vdd = voltdm->vdd; - u32 sys_clk_rate, timeout_val, waittime; - - /* Divide to avoid overflow */ - sys_clk_rate = voltdm->sys_clk.rate / 1000; - WARN_ON(!sys_clk_rate); /* Generic voltage parameters */ vdd->volt_scale = omap_vp_forceupdate_scale; - voltdm->vp->enabled = false; - - vdd->vp_rt_data.vpconfig_erroroffset = - (voltdm->pmic->vp_erroroffset << - __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)); - - timeout_val = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000; - vdd->vp_rt_data.vlimitto_timeout = timeout_val; - vdd->vp_rt_data.vlimitto_vddmin = voltdm->pmic->vp_vddmin; - vdd->vp_rt_data.vlimitto_vddmax = voltdm->pmic->vp_vddmax; - - waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * - sys_clk_rate) / 1000; - vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; - vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; - vdd->vp_rt_data.vstepmin_stepmin = voltdm->pmic->vp_vstepmin; - vdd->vp_rt_data.vstepmax_stepmax = voltdm->pmic->vp_vstepmax; return 0; } diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index 297d094..ea61a47 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -50,7 +50,7 @@ void __init omap_vp_init(struct voltagedomain *voltdm) { struct omap_vp_instance *vp = voltdm->vp; struct omap_vdd_info *vdd = voltdm->vdd; - u32 vp_val; + u32 vp_val, sys_clk_rate, timeout_val, waittime; if (!voltdm->read || !voltdm->write) { pr_err("%s: No read/write API for accessing vdd_%s regs\n", @@ -58,6 +58,27 @@ void __init omap_vp_init(struct voltagedomain *voltdm) return; } + vp->enabled = false; + + /* Divide to avoid overflow */ + sys_clk_rate = voltdm->sys_clk.rate / 1000; + + vdd->vp_rt_data.vpconfig_erroroffset = + (voltdm->pmic->vp_erroroffset << + __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)); + + timeout_val = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000; + vdd->vp_rt_data.vlimitto_timeout = timeout_val; + vdd->vp_rt_data.vlimitto_vddmin = voltdm->pmic->vp_vddmin; + vdd->vp_rt_data.vlimitto_vddmax = voltdm->pmic->vp_vddmax; + + waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * + sys_clk_rate) / 1000; + vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; + vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; + vdd->vp_rt_data.vstepmin_stepmin = voltdm->pmic->vp_vstepmin; + vdd->vp_rt_data.vstepmax_stepmax = voltdm->pmic->vp_vstepmax; + vp_val = vdd->vp_rt_data.vpconfig_erroroffset | (vdd->vp_rt_data.vpconfig_errorgain << __ffs(vp->common->vpconfig_errorgain_mask)) | -- 1.7.6
WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/12] OMAP3+: VP: move timing calculation/config into VP init Date: Mon, 29 Aug 2011 10:58:05 -0700 [thread overview] Message-ID: <1314640692-3386-6-git-send-email-khilman@ti.com> (raw) In-Reply-To: <1314640692-3386-1-git-send-email-khilman@ti.com> Move VP timing calcluation (based on sys clock) and register programming into VP init. Signed-off-by: Kevin Hilman <khilman@ti.com> --- arch/arm/mach-omap2/voltage.c | 22 ---------------------- arch/arm/mach-omap2/vp.c | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 533ea38..4a15668 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -46,31 +46,9 @@ static LIST_HEAD(voltdm_list); static int __init _config_common_vdd_data(struct voltagedomain *voltdm) { struct omap_vdd_info *vdd = voltdm->vdd; - u32 sys_clk_rate, timeout_val, waittime; - - /* Divide to avoid overflow */ - sys_clk_rate = voltdm->sys_clk.rate / 1000; - WARN_ON(!sys_clk_rate); /* Generic voltage parameters */ vdd->volt_scale = omap_vp_forceupdate_scale; - voltdm->vp->enabled = false; - - vdd->vp_rt_data.vpconfig_erroroffset = - (voltdm->pmic->vp_erroroffset << - __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)); - - timeout_val = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000; - vdd->vp_rt_data.vlimitto_timeout = timeout_val; - vdd->vp_rt_data.vlimitto_vddmin = voltdm->pmic->vp_vddmin; - vdd->vp_rt_data.vlimitto_vddmax = voltdm->pmic->vp_vddmax; - - waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * - sys_clk_rate) / 1000; - vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; - vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; - vdd->vp_rt_data.vstepmin_stepmin = voltdm->pmic->vp_vstepmin; - vdd->vp_rt_data.vstepmax_stepmax = voltdm->pmic->vp_vstepmax; return 0; } diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index 297d094..ea61a47 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -50,7 +50,7 @@ void __init omap_vp_init(struct voltagedomain *voltdm) { struct omap_vp_instance *vp = voltdm->vp; struct omap_vdd_info *vdd = voltdm->vdd; - u32 vp_val; + u32 vp_val, sys_clk_rate, timeout_val, waittime; if (!voltdm->read || !voltdm->write) { pr_err("%s: No read/write API for accessing vdd_%s regs\n", @@ -58,6 +58,27 @@ void __init omap_vp_init(struct voltagedomain *voltdm) return; } + vp->enabled = false; + + /* Divide to avoid overflow */ + sys_clk_rate = voltdm->sys_clk.rate / 1000; + + vdd->vp_rt_data.vpconfig_erroroffset = + (voltdm->pmic->vp_erroroffset << + __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)); + + timeout_val = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000; + vdd->vp_rt_data.vlimitto_timeout = timeout_val; + vdd->vp_rt_data.vlimitto_vddmin = voltdm->pmic->vp_vddmin; + vdd->vp_rt_data.vlimitto_vddmax = voltdm->pmic->vp_vddmax; + + waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * + sys_clk_rate) / 1000; + vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime; + vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime; + vdd->vp_rt_data.vstepmin_stepmin = voltdm->pmic->vp_vstepmin; + vdd->vp_rt_data.vstepmax_stepmax = voltdm->pmic->vp_vstepmax; + vp_val = vdd->vp_rt_data.vpconfig_erroroffset | (vdd->vp_rt_data.vpconfig_errorgain << __ffs(vp->common->vpconfig_errorgain_mask)) | -- 1.7.6
next prev parent reply other threads:[~2011-08-29 17:57 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-29 17:58 [PATCH 00/12] OMAP: voltage cleanup part C: VP cleanup Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 01/12] OMAP3+: VP: cleanup: move VP instance into voltdm, misc. renames Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 02/12] OMAP3+: voltage: remove unneeded debugfs interface Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 03/12] OMAP3+: VP: struct omap_vp_common: replace shift with __ffs(mask) Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 04/12] OMAP3+: VP: move SoC-specific sys clock rate retreival late init Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman [this message] 2011-08-29 17:58 ` [PATCH 05/12] OMAP3+: VP: move timing calculation/config into VP init Kevin Hilman 2011-08-29 17:58 ` [PATCH 06/12] OMAP3+: VP: create VP helper function for updating error gain Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 07/12] OMAP3+: VP: remove omap_vp_runtime_data Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 08/12] OMAP3+: VP: move voltage scale function pointer into struct voltagedomain Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 09/12] OMAP: VP: Explicitly mask VPVOLTAGE field Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-09-07 12:31 ` Jean Pihet 2011-09-07 12:31 ` Jean Pihet 2011-08-29 17:58 ` [PATCH 10/12] OMAP3+: VP: update_errorgain(): return error if VP Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 11/12] OMAP3+: VP: remove unused omap_vp_get_curr_volt() Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-08-29 17:58 ` [PATCH 12/12] OMAP3+: VP: combine setting init voltage into common function Kevin Hilman 2011-08-29 17:58 ` Kevin Hilman 2011-09-07 19:11 ` [PATCH 00/12] OMAP: voltage cleanup part C: VP cleanup Jean Pihet 2011-09-07 19:11 ` Jean Pihet
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1314640692-3386-6-git-send-email-khilman@ti.com \ --to=khilman@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.