summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-arizona.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-21 17:30:02 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-23 09:32:02 +0800
commite6dd8cf223d1a41b3c3168e97e2c33df0ef05e9d (patch)
tree86b5bc6a85d91b04fc23960fd4deba02ecf4d3fd /drivers/extcon/extcon-arizona.c
parent4e6168779508f62c27e43a4f7ded786bfdb0a394 (diff)
extcon: arizona: Retry failed HP measurements
We now have mechanisms in place to allow retries so let's use them rather than guessing. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/extcon/extcon-arizona.c')
-rw-r--r--drivers/extcon/extcon-arizona.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index ce95f8625e8..528303440c2 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -31,8 +31,6 @@
#include <linux/mfd/arizona/pdata.h>
#include <linux/mfd/arizona/registers.h>
-#define ARIZONA_DEFAULT_HP 32
-
#define ARIZONA_NUM_BUTTONS 6
#define ARIZONA_ACCDET_MODE_MIC 0
@@ -208,7 +206,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
if (!(val & ARIZONA_HP_DONE)) {
dev_err(arizona->dev, "HPDET did not complete: %x\n",
val);
- val = ARIZONA_DEFAULT_HP;
+ return -EAGAIN;
}
val &= ARIZONA_HP_LVL_MASK;
@@ -218,14 +216,14 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
if (!(val & ARIZONA_HP_DONE_B)) {
dev_err(arizona->dev, "HPDET did not complete: %x\n",
val);
- return ARIZONA_DEFAULT_HP;
+ return -EAGAIN;
}
ret = regmap_read(arizona->regmap, ARIZONA_HP_DACVAL, &val);
if (ret != 0) {
dev_err(arizona->dev, "Failed to read HP value: %d\n",
ret);
- return ARIZONA_DEFAULT_HP;
+ return -EAGAIN;
}
regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1,
@@ -267,7 +265,7 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
if (!(val & ARIZONA_HP_DONE_B)) {
dev_err(arizona->dev, "HPDET did not complete: %x\n",
val);
- return ARIZONA_DEFAULT_HP;
+ return -EAGAIN;
}
val &= ARIZONA_HP_LVL_B_MASK;