mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 08:00:09 +00:00
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>
This commit is contained in:
parent
4e61687795
commit
e6dd8cf223
@ -31,8 +31,6 @@
|
|||||||
#include <linux/mfd/arizona/pdata.h>
|
#include <linux/mfd/arizona/pdata.h>
|
||||||
#include <linux/mfd/arizona/registers.h>
|
#include <linux/mfd/arizona/registers.h>
|
||||||
|
|
||||||
#define ARIZONA_DEFAULT_HP 32
|
|
||||||
|
|
||||||
#define ARIZONA_NUM_BUTTONS 6
|
#define ARIZONA_NUM_BUTTONS 6
|
||||||
|
|
||||||
#define ARIZONA_ACCDET_MODE_MIC 0
|
#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)) {
|
if (!(val & ARIZONA_HP_DONE)) {
|
||||||
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
||||||
val);
|
val);
|
||||||
val = ARIZONA_DEFAULT_HP;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
val &= ARIZONA_HP_LVL_MASK;
|
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)) {
|
if (!(val & ARIZONA_HP_DONE_B)) {
|
||||||
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
||||||
val);
|
val);
|
||||||
return ARIZONA_DEFAULT_HP;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = regmap_read(arizona->regmap, ARIZONA_HP_DACVAL, &val);
|
ret = regmap_read(arizona->regmap, ARIZONA_HP_DACVAL, &val);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(arizona->dev, "Failed to read HP value: %d\n",
|
dev_err(arizona->dev, "Failed to read HP value: %d\n",
|
||||||
ret);
|
ret);
|
||||||
return ARIZONA_DEFAULT_HP;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1,
|
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)) {
|
if (!(val & ARIZONA_HP_DONE_B)) {
|
||||||
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
dev_err(arizona->dev, "HPDET did not complete: %x\n",
|
||||||
val);
|
val);
|
||||||
return ARIZONA_DEFAULT_HP;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
val &= ARIZONA_HP_LVL_B_MASK;
|
val &= ARIZONA_HP_LVL_B_MASK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user