Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363193
b: refs/heads/master
c: 7abd4e2
h: refs/heads/master
i:
  363191: 5ebaa4b
v: v3
  • Loading branch information
Mark Brown committed Apr 2, 2013
1 parent 237c44f commit 7b548f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd59e79656f4e7137909166248a935d422b1245a
refs/heads/master: 7abd4e2a8f1c3e534da44c35e2d3d6353573e51f
13 changes: 10 additions & 3 deletions trunk/drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mfd/arizona/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ struct arizona_pdata {
/** Mic detect debounce level */
int micd_dbtime;

/** Mic detect timeout (ms) */
int micd_timeout;

/** Force MICBIAS on for mic detect */
bool micd_force_micbias;

Expand Down

0 comments on commit 7b548f8

Please sign in to comment.