From: Kevin Hilman <khilman@ti.com>
To: Nishanth Menon <nm@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
Patrick Titiano <p-titiano@ti.com>
Subject: Re: [PM-WIP/voltdm_c][PATCH 07/11] OMAP4: PM: TWL6030: fix voltage conversion formula
Date: Wed, 18 May 2011 11:38:38 +0200 [thread overview]
Message-ID: <877h9owdpd.fsf@ti.com> (raw)
In-Reply-To: <1305695854-9638-8-git-send-email-nm@ti.com> (Nishanth Menon's message of "Wed, 18 May 2011 00:17:30 -0500")
Nishanth Menon <nm@ti.com> writes:
> From: Patrick Titiano <p-titiano@ti.com>
>
> omap_twl_vsel_to_uv() and omap_twl_uv_to_vsel() functions used to convert
> voltages to TWL6030 SMPS commands (a.k.a "vsel") implement incorrect conversion
> formula.
> It uses legacy OMAP3 formula, but OMAP4 Power IC has different offset and
> voltage step:
> - Voltage Step is now 12.66mV (instead of 12.5mV)
> - Offset is either 607.7mV or 709mV depending on TWL6030 chip revision
> (instead of 600mV)
> This leads to setting voltages potentially higher than expected, and so
> potentially some (limited) power overconsumption.
>
> For reference, see formula and tables in section 8.5.2.3
> "Output Voltage Selection (Standard Mode / Extended Mode with or without offset)"
> in TWL6030 functional specifications document.
>
> [nm@ti.com: ported to voltdm_c]
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Patrick Titiano <p-titiano@ti.com>
Thanks, adding to voltdm queue.
Kevin
> ---
> arch/arm/mach-omap2/omap_twl.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
> index 82a91be..78fd985 100644
> --- a/arch/arm/mach-omap2/omap_twl.c
> +++ b/arch/arm/mach-omap2/omap_twl.c
> @@ -106,9 +106,9 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
> return 1350000;
>
> if (smps_offset & 0x8)
> - return ((((vsel - 1) * 125) + 7000)) * 100;
> + return ((((vsel - 1) * 1266) + 70900)) * 10;
> else
> - return ((((vsel - 1) * 125) + 6000)) * 100;
> + return ((((vsel - 1) * 1266) + 60770)) * 10;
> }
>
> static u8 twl6030_uv_to_vsel(unsigned long uv)
> @@ -138,9 +138,9 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
> return 0x3A;
>
> if (smps_offset & 0x8)
> - return DIV_ROUND_UP(uv - 700000, 12500) + 1;
> + return DIV_ROUND_UP(uv - 709000, 12660) + 1;
> else
> - return DIV_ROUND_UP(uv - 600000, 12500) + 1;
> + return DIV_ROUND_UP(uv - 607700, 12660) + 1;
> }
>
> static struct omap_voltdm_pmic omap3_mpu_pmic = {
> @@ -187,7 +187,7 @@ static struct omap_voltdm_pmic omap3_core_pmic = {
>
> static struct omap_voltdm_pmic omap4_mpu_pmic = {
> .slew_rate = 4000,
> - .step_size = 12500,
> + .step_size = 12660,
> .on_volt = 1350000,
> .onlp_volt = 1350000,
> .ret_volt = 837500,
> @@ -212,7 +212,7 @@ static struct omap_voltdm_pmic omap4_mpu_pmic = {
>
> static struct omap_voltdm_pmic omap4_iva_pmic = {
> .slew_rate = 4000,
> - .step_size = 12500,
> + .step_size = 12660,
> .on_volt = 1100000,
> .onlp_volt = 1100000,
> .ret_volt = 837500,
> @@ -237,7 +237,7 @@ static struct omap_voltdm_pmic omap4_iva_pmic = {
>
> static struct omap_voltdm_pmic omap4_core_pmic = {
> .slew_rate = 4000,
> - .step_size = 12500,
> + .step_size = 12660,
> .on_volt = 1100000,
> .onlp_volt = 1100000,
> .ret_volt = 837500,
next prev parent reply other threads:[~2011-05-18 9:38 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 5:17 [PM-WIP/voltdm_c][PATCH 00/11] OMAP4: Fixes for voltage scale Nishanth Menon
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 01/11] OMAP3+: PM: SR: fix debugfs Nishanth Menon
2011-05-18 8:55 ` Kevin Hilman
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 02/11] OMAP3+: PM: voltage: add required debugfs interfaces Nishanth Menon
2011-05-18 7:59 ` Tony Lindgren
2011-05-18 8:06 ` Menon, Nishanth
2011-05-18 8:34 ` Tony Lindgren
2011-05-18 8:41 ` Menon, Nishanth
2011-05-18 8:44 ` Kevin Hilman
2011-05-18 8:50 ` Menon, Nishanth
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 03/11] OMAP3+: PM: VP: fix vstepmax Nishanth Menon
2011-05-18 8:58 ` Kevin Hilman
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 04/11] OMAP4: PM: VC: support configuration of i2c clks Nishanth Menon
2011-05-18 8:53 ` Kevin Hilman
2011-05-18 8:57 ` Menon, Nishanth
2011-05-25 18:17 ` Kevin Hilman
2011-05-25 18:32 ` Menon, Nishanth
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 05/11] OMAP4: PM: VC: fix highspeed i2c for SR Nishanth Menon
2011-05-18 8:59 ` Kevin Hilman
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 06/11] OMAP4: PM: VC: fix channel bit offset for MPU Nishanth Menon
2011-05-18 9:34 ` Kevin Hilman
2011-05-18 9:47 ` Menon, Nishanth
2011-05-18 11:06 ` Kevin Hilman
2011-05-18 11:22 ` Menon, Nishanth
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 07/11] OMAP4: PM: TWL6030: fix voltage conversion formula Nishanth Menon
2011-05-18 9:38 ` Kevin Hilman [this message]
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 08/11] OMAP4: PM: TWL6030: fix uv to voltage for >0x39 Nishanth Menon
2011-05-18 9:41 ` Kevin Hilman
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 09/11] OMAP4: PM: TWL6030: address 0V conversions Nishanth Menon
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 10/11] OMAP4: PM: TWL6030: fix ON/RET/OFF voltages Nishanth Menon
2011-05-18 10:44 ` Kevin Hilman
2011-05-18 5:17 ` [PM-WIP/voltdm_c][PATCH 11/11] OMAP4: PM: TWL6030: add cmd register Nishanth Menon
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=877h9owdpd.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=p-titiano@ti.com \
/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: link
Be 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.