diff options
author | Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> | 2012-04-20 16:43:06 +0300 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 13:00:29 +0200 |
commit | 6f6c74fcad7b42e1bd57a6f4e48889d331ef97f0 (patch) | |
tree | 8eb35549fa8dd4346f1f19133f9bfeb681875a37 /drivers/mfd | |
parent | f60ab83d050a09df22e709199e7c65c52262bad0 (diff) | |
download | kernel_samsung_tuna-6f6c74fcad7b42e1bd57a6f4e48889d331ef97f0.tar.gz kernel_samsung_tuna-6f6c74fcad7b42e1bd57a6f4e48889d331ef97f0.tar.bz2 kernel_samsung_tuna-6f6c74fcad7b42e1bd57a6f4e48889d331ef97f0.zip |
MFD: TWL6032_GPADC: Correct calibration parametrs.
This patch corrects GPADC calibration for the TWL6032 due to the
TWL6032 data manual.
Change-Id: I15fb4148bf94a5123467e8b7a316e7edcdb55ebc
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/twl6030-gpadc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mfd/twl6030-gpadc.c b/drivers/mfd/twl6030-gpadc.c index 05a35118f3a..f0aeb4dc22f 100644 --- a/drivers/mfd/twl6030-gpadc.c +++ b/drivers/mfd/twl6030-gpadc.c @@ -1101,11 +1101,11 @@ static int twl6032_calibration(struct twl6030_gpadc_data *gpadc) /* D1 */ d1 = (trim_regs[11] & 0x0F) << 3; d1 |= (trim_regs[9] & 0x0E) >> 1; - if (trim_regs[1] & 0x01) + if (trim_regs[9] & 0x01) d1 = -d1; /* D2 */ - d2 = (trim_regs[15] & 0x0F) << 2; + d2 = (trim_regs[15] & 0x0F) << 3; d2 |= (trim_regs[13] & 0x0E) >> 1; if (trim_regs[13] & 0x01) d2 = -d2; @@ -1118,8 +1118,8 @@ static int twl6032_calibration(struct twl6030_gpadc_data *gpadc) if (trim_regs[1] & 0x01) temp = -temp; - d1 = (trim_regs[1] & 0x7E) >> 1; - if (trim_regs[12] & 0x01) + d1 = (trim_regs[5] & 0x7E) >> 1; + if (trim_regs[5] & 0x01) d1 = -d1; d1 += temp; @@ -1130,8 +1130,8 @@ static int twl6032_calibration(struct twl6030_gpadc_data *gpadc) if (trim_regs[2] & 0x01) temp = -temp; - d2 = (trim_regs[6] & 0x7F) >> 1; - if (trim_regs[14] & 0x01) + d2 = (trim_regs[6] & 0xFE) >> 1; + if (trim_regs[6] & 0x01) d2 = -d2; d2 += temp; |