8c0a92bb7a00d3841afbf59b4ab525768efbb5d6
[openwrt/staging/wigyori.git] / target / linux / imx6 / patches-3.10 / 0029-regulator-pfuze100-allow-misprogrammed-ID.patch
1 From: Tim Harvey <tharvey@gateworks.com>
2 Subject: [PATCH] regulator: pfuze100: allow misprogrammed ID
3
4 prior to week 08 of 2013 Freescale misprogrammed between 1 and 3% of
5 PFUZE1000 parts with a ID=0x8 instead of the expected ID=0x0
6
7 Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 ---
9 drivers/regulator/pfuze100-regulator.c | 12 +++++++++---
10 1 file changed, 9 insertions(+), 3 deletions(-)
11
12 --- a/drivers/regulator/pfuze100-regulator.c
13 +++ b/drivers/regulator/pfuze100-regulator.c
14 @@ -308,9 +308,15 @@ static int pfuze_identify(struct pfuze_c
15 if (ret)
16 return ret;
17
18 - if (value & 0x0f) {
19 - dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
20 - return -ENODEV;
21 + switch (value & 0x0f) {
22 + /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */
23 + case 0x8:
24 + dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");
25 + case 0x0:
26 + break;
27 + default:
28 + dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
29 + return -ENODEV;
30 }
31
32 ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value);