summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-21 17:36:33 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-07 18:04:07 +0000
commit2e033db5ddf299de2ae568919d78b0258a5a6423 (patch)
treee5f156ede883eb09f6548792a84c2c81d0ecd46e
parentf9365d07dd5cb3c76b454b4c7827b2f6339cace2 (diff)
extcon: arizona: Support additional configuration of microphone detection
Allow systems to tune detection rate and debounce suitably for their mechanical parameters. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/extcon/extcon-arizona.c12
-rw-r--r--include/linux/mfd/arizona/pdata.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index ab8b9c7359f..d7e1047ad68 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -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.
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index bcbe4fda87c..2f5f08e10b7 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -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;