diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/twl6030-gpadc.c | 7 |
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 { |