summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-01 19:25:55 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-02 11:54:07 +0100
commit7abd4e2a8f1c3e534da44c35e2d3d6353573e51f (patch)
tree11750ecd0013545a1ad35d1e9093e289db4802bc /drivers/extcon
parentcd59e79656f4e7137909166248a935d422b1245a (diff)
downloadlinux-7abd4e2a8f1c3e534da44c35e2d3d6353573e51f.tar.bz2
extcon: arizona: Make mic detection timeout configurable
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-arizona.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index c7f8eb4299d2..7a1b4a7791ba 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -42,7 +42,7 @@
#define ARIZONA_HPDET_MAX 10000
#define HPDET_DEBOUNCE 500
-#define MICD_TIMEOUT 2000
+#define DEFAULT_MICD_TIMEOUT 2000
struct arizona_extcon_info {
struct device *dev;
@@ -60,6 +60,8 @@ struct arizona_extcon_info {
const struct arizona_micd_range *micd_ranges;
int num_micd_ranges;
+ int micd_timeout;
+
bool micd_reva;
bool micd_clamp;
@@ -889,7 +891,7 @@ static void arizona_micd_detect(struct work_struct *work)
handled:
if (info->detecting)
schedule_delayed_work(&info->micd_timeout_work,
- msecs_to_jiffies(MICD_TIMEOUT));
+ msecs_to_jiffies(info->micd_timeout));
pm_runtime_mark_last_busy(info->dev);
mutex_unlock(&info->lock);
@@ -970,7 +972,7 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
if (cancelled_mic)
schedule_delayed_work(&info->micd_timeout_work,
- msecs_to_jiffies(MICD_TIMEOUT));
+ msecs_to_jiffies(info->micd_timeout));
goto out;
}
@@ -1027,6 +1029,11 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB);
}
+ if (arizona->pdata.micd_timeout)
+ info->micd_timeout = arizona->pdata.micd_timeout;
+ else
+ info->micd_timeout = DEFAULT_MICD_TIMEOUT;
+
/* Clear trig_sts to make sure DCVDD is not forced up */
regmap_write(arizona->regmap, ARIZONA_AOD_WKUP_AND_TRIG,
ARIZONA_MICD_CLAMP_FALL_TRIG_STS |