Skip to content

Commit

Permalink
extcon: arizona: Support additional configuration of microphone detec…
Browse files Browse the repository at this point in the history
…tion

Allow systems to tune detection rate and debounce suitably for their
mechanical parameters.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 7, 2013
1 parent f9365d0 commit 2e033db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,18 @@ static int arizona_extcon_probe(struct platform_device *pdev)
arizona->pdata.micd_bias_start_time
<< ARIZONA_MICD_BIAS_STARTTIME_SHIFT);

if (arizona->pdata.micd_rate)
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_RATE_MASK,
arizona->pdata.micd_rate
<< ARIZONA_MICD_RATE_SHIFT);

if (arizona->pdata.micd_dbtime)
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_DBTIME_MASK,
arizona->pdata.micd_dbtime
<< ARIZONA_MICD_DBTIME_SHIFT);

/*
* If we have a clamp use it, activating in conjunction with
* GPIO5 if that is connected for jack detect operation.
Expand Down
6 changes: 6 additions & 0 deletions include/linux/mfd/arizona/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ struct arizona_pdata {
/** Mic detect ramp rate */
int micd_bias_start_time;

/** Mic detect sample rate */
int micd_rate;

/** Mic detect debounce level */
int micd_dbtime;

/** Headset polarity configurations */
struct arizona_micd_config *micd_configs;
int num_micd_configs;
Expand Down

0 comments on commit 2e033db

Please sign in to comment.