linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] OMAP4: PM: TWL6030: address 0V conversions
Date: Mon, 29 Aug 2011 11:15:19 -0700	[thread overview]
Message-ID: <1314641721-5172-4-git-send-email-khilman@ti.com> (raw)
In-Reply-To: <1314641721-5172-1-git-send-email-khilman@ti.com>

From: Nishanth Menon <nm@ti.com>

0V conversions should be mapped to 0 as it is meant to denote
off voltages.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/omap_twl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 5def7c2..b30adf3 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -95,6 +95,8 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
 		is_offset_valid = true;
 	}
 
+	if (!vsel)
+		return 0;
 	/*
 	 * There is no specific formula for voltage to vsel
 	 * conversion above 1.3V. There are special hardcoded
@@ -127,6 +129,8 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
 		is_offset_valid = true;
 	}
 
+	if (!uv)
+		return 0x00;
 	/*
 	 * There is no specific formula for voltage to vsel
 	 * conversion above 1.3V. There are special hardcoded
-- 
1.7.6

  parent reply	other threads:[~2011-08-29 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 18:15 [PATCH 0/5] OMAP: voltage cleanup part E: TWL6030 PMIC fixes Kevin Hilman
2011-08-29 18:15 ` [PATCH 1/5] OMAP4: PM: TWL6030: fix voltage conversion formula Kevin Hilman
2011-08-29 18:15 ` [PATCH 2/5] OMAP4: PM: TWL6030: fix uv to voltage for >0x39 Kevin Hilman
2011-08-29 18:15 ` Kevin Hilman [this message]
2011-08-29 18:15 ` [PATCH 4/5] OMAP4: PM: TWL6030: fix ON/RET/OFF voltages Kevin Hilman
2011-08-29 18:15 ` [PATCH 5/5] OMAP4: PM: TWL6030: add cmd register Kevin Hilman

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=1314641721-5172-4-git-send-email-khilman@ti.com \
    --to=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).