summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2012-02-29 08:47:22 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:01:40 +0200
commitaea554e132718130c3e8fff5e37081733271d218 (patch)
tree03f1d3924c31429399428cf08c7f4b8f3dc0a872
parente270135cee441becbbb898360014605f21a12699 (diff)
drivers: ab8500-gpadc: Reduce conversion timeout
Reduce the conversion timeout from 2s to 0.5s ST-Ericsson Linux next: - ST-Ericsson ID: 420077 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Icb18eef9b6c887f7817c2c1f7dd1b3876620a5b6 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/50864 Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
-rw-r--r--drivers/mfd/ab8500-gpadc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 20ab561b42e..d4135706529 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -86,6 +86,8 @@
/* Time in ms before disabling regulator */
#define GPADC_AUDOSUSPEND_DELAY 1
+#define CONVERSION_TIME 500 /* ms */
+
enum cal_channels {
ADC_INPUT_VMAIN = 0,
ADC_INPUT_BTEMP,
@@ -368,7 +370,8 @@ int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel)
goto out;
}
/* wait for completion of conversion */
- if (!wait_for_completion_timeout(&gpadc->ab8500_gpadc_complete, 2*HZ)) {
+ if (!wait_for_completion_timeout(&gpadc->ab8500_gpadc_complete,
+ msecs_to_jiffies(CONVERSION_TIME))) {
dev_err(gpadc->dev,
"timeout: didn't receive GPADC conversion interrupt\n");
ret = -EINVAL;
@@ -594,8 +597,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
static int ab8500_gpadc_runtime_idle(struct device *dev)
{
- struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
-
pm_runtime_suspend(dev);
return 0;
}