aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorOleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>2012-02-29 14:16:56 +0200
committerZiyann <jaraidaniel@gmail.com>2014-10-01 13:00:32 +0200
commitaa58770ee045377ab3aac0cc60ca1ff98c762eec (patch)
treeaa91d1acf06bb7652f490e0b1938e344fef80bc9 /drivers/mfd
parentb03c139ab4cbff8bdafa52283a6b17628405e190 (diff)
downloadkernel_samsung_tuna-aa58770ee045377ab3aac0cc60ca1ff98c762eec.zip
kernel_samsung_tuna-aa58770ee045377ab3aac0cc60ca1ff98c762eec.tar.gz
kernel_samsung_tuna-aa58770ee045377ab3aac0cc60ca1ff98c762eec.tar.bz2
MFD: TWL6030_GPADC: Add a new command to the ioctl
This patch adds a possibility to read corrected and converted ADC ch (command TWL6030_GPADC_IOCX_ADC_READ) to the ioctl. Change-Id: Ia896bf9224a876083815aa5a0d172e08b77141cb Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6030-gpadc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mfd/twl6030-gpadc.c b/drivers/mfd/twl6030-gpadc.c
index 7a0c7e1..621270b 100644
--- a/drivers/mfd/twl6030-gpadc.c
+++ b/drivers/mfd/twl6030-gpadc.c
@@ -959,6 +959,7 @@ static long twl6030_gpadc_ioctl(struct file *filp, unsigned int cmd,
}
switch (cmd) {
+ case TWL6030_GPADC_IOCX_ADC_READ:
case TWL6030_GPADC_IOCX_ADC_RAW_READ: {
struct twl6030_gpadc_request req;
if (the_gpadc->features & TWL6032_SUBCLASS) {
@@ -980,7 +981,11 @@ static long twl6030_gpadc_ioctl(struct file *filp, unsigned int cmd,
val = twl6030_gpadc_conversion(&req);
if (likely(val > 0)) {
par.status = 0;
- par.result = (u16)req.buf[par.channel].raw_code;
+ if (cmd == TWL6030_GPADC_IOCX_ADC_READ)
+ par.result = (u16)req.rbuf[par.channel];
+ else
+ par.result = (u16)req.buf[par.channel].raw_code;
+
} else if (val == 0) {
par.status = -ENODATA;
} else {