[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / voltdm / 0147-OMAP4-PM-TWL6030-address-0V-conversions.patch
1 From c36cd6579c43481193cc5b833622f01618f7408c Mon Sep 17 00:00:00 2001
2 From: Nishanth Menon <nm@ti.com>
3 Date: Wed, 18 May 2011 00:17:32 -0500
4 Subject: [PATCH 147/149] OMAP4: PM: TWL6030: address 0V conversions
6 0V conversions should be mapped to 0 as it is meant to denote
7 off voltages.
9 Signed-off-by: Nishanth Menon <nm@ti.com>
10 ---
11 arch/arm/mach-omap2/omap_twl.c | 4 ++++
12 1 files changed, 4 insertions(+), 0 deletions(-)
14 diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
15 index 5def7c2..b30adf3 100644
16 --- a/arch/arm/mach-omap2/omap_twl.c
17 +++ b/arch/arm/mach-omap2/omap_twl.c
18 @@ -95,6 +95,8 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
19 is_offset_valid = true;
20 }
22 + if (!vsel)
23 + return 0;
24 /*
25 * There is no specific formula for voltage to vsel
26 * conversion above 1.3V. There are special hardcoded
27 @@ -127,6 +129,8 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
28 is_offset_valid = true;
29 }
31 + if (!uv)
32 + return 0x00;
33 /*
34 * There is no specific formula for voltage to vsel
35 * conversion above 1.3V. There are special hardcoded
36 --
37 1.6.6.1