[PATCHv2 2/3] Reset REMAP configuration in regulator probe

From: Juha Keski-Saari
Date: Wed Nov 25 2009 - 05:06:09 EST


This patch makes the probe recover the regulator REMAP configuration into
the state it is on reset to make sure the RegFW has proper control over
the regulator states

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@xxxxxxxxx>
---
drivers/regulator/twl4030-regulator.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/twl4030-regulator.c b/drivers/regulator/twl4030-regulator.c
index 75da6af..7029fb9 100644
--- a/drivers/regulator/twl4030-regulator.c
+++ b/drivers/regulator/twl4030-regulator.c
@@ -420,6 +420,13 @@ static struct twlreg_info twl4030_regs[] = {
/* VUSBCP is managed *only* by the USB subchip */
};

+static const u8 REG_REMAP_table[] = {
+ 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08,
+ 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08,
+};
+
static int twl4030reg_probe(struct platform_device *pdev)
{
int i;
@@ -458,6 +465,8 @@ static int twl4030reg_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, rdev);

+ twl4030reg_write(info, VREG_REMAP, REG_REMAP_table[pdev->id]);
+
/* NOTE: many regulators support short-circuit IRQs (presentable
* as REGULATOR_OVER_CURRENT notifications?) configured via:
* - SC_CONFIG
--
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/