aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/extcon/extcon-arizona.c13
-rw-r--r--include/linux/mfd/arizona/pdata.h3
2 files changed, 13 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 @@
42#define ARIZONA_HPDET_MAX 10000 42#define ARIZONA_HPDET_MAX 10000
43 43
44#define HPDET_DEBOUNCE 500 44#define HPDET_DEBOUNCE 500
45#define MICD_TIMEOUT 2000 45#define DEFAULT_MICD_TIMEOUT 2000
46 46
47struct arizona_extcon_info { 47struct arizona_extcon_info {
48 struct device *dev; 48 struct device *dev;
@@ -60,6 +60,8 @@ struct arizona_extcon_info {
60 const struct arizona_micd_range *micd_ranges; 60 const struct arizona_micd_range *micd_ranges;
61 int num_micd_ranges; 61 int num_micd_ranges;
62 62
63 int micd_timeout;
64
63 bool micd_reva; 65 bool micd_reva;
64 bool micd_clamp; 66 bool micd_clamp;
65 67
@@ -889,7 +891,7 @@ static void arizona_micd_detect(struct work_struct *work)
889handled: 891handled:
890 if (info->detecting) 892 if (info->detecting)
891 schedule_delayed_work(&info->micd_timeout_work, 893 schedule_delayed_work(&info->micd_timeout_work,
892 msecs_to_jiffies(MICD_TIMEOUT)); 894 msecs_to_jiffies(info->micd_timeout));
893 895
894 pm_runtime_mark_last_busy(info->dev); 896 pm_runtime_mark_last_busy(info->dev);
895 mutex_unlock(&info->lock); 897 mutex_unlock(&info->lock);
@@ -970,7 +972,7 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
970 972
971 if (cancelled_mic) 973 if (cancelled_mic)
972 schedule_delayed_work(&info->micd_timeout_work, 974 schedule_delayed_work(&info->micd_timeout_work,
973 msecs_to_jiffies(MICD_TIMEOUT)); 975 msecs_to_jiffies(info->micd_timeout));
974 976
975 goto out; 977 goto out;
976 } 978 }
@@ -1027,6 +1029,11 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
1027 ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB); 1029 ARIZONA_MICD_CLAMP_DB | ARIZONA_JD1_DB);
1028 } 1030 }
1029 1031
1032 if (arizona->pdata.micd_timeout)
1033 info->micd_timeout = arizona->pdata.micd_timeout;
1034 else
1035 info->micd_timeout = DEFAULT_MICD_TIMEOUT;
1036
1030 /* Clear trig_sts to make sure DCVDD is not forced up */ 1037 /* Clear trig_sts to make sure DCVDD is not forced up */
1031 regmap_write(arizona->regmap, ARIZONA_AOD_WKUP_AND_TRIG, 1038 regmap_write(arizona->regmap, ARIZONA_AOD_WKUP_AND_TRIG,
1032 ARIZONA_MICD_CLAMP_FALL_TRIG_STS | 1039 ARIZONA_MICD_CLAMP_FALL_TRIG_STS |
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 3ef300baa2e6..a0f940987a3e 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -149,6 +149,9 @@ struct arizona_pdata {
149 /** Mic detect debounce level */ 149 /** Mic detect debounce level */
150 int micd_dbtime; 150 int micd_dbtime;
151 151
152 /** Mic detect timeout (ms) */
153 int micd_timeout;
154
152 /** Force MICBIAS on for mic detect */ 155 /** Force MICBIAS on for mic detect */
153 bool micd_force_micbias; 156 bool micd_force_micbias;
154 157