aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-01 14:18:18 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-02 06:54:05 -0400
commit41a57850b5e5c450da351465efcc41383def7f8a (patch)
tree99e49c35c4d9e65b09011eb6c6d23e78f1a30b97 /drivers/extcon
parent939c5671d11d86ae783f416b703c705647ac563b (diff)
extcon: arizona: Clear existing button reports before reporting new one
If the user moves directly from one button to another then we won't get a no buttons pressed event and will therefore end up reporting that two buttons are simultaneously pressed which isn't supported by the hardware. Make sure we clear any existing button reports before reporting any new ones. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-arizona.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index e2d881a58ca6..26f9a1ae15c4 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -852,6 +852,10 @@ static irqreturn_t arizona_micdet(int irq, void *data)
852 lvl = val & ARIZONA_MICD_LVL_MASK; 852 lvl = val & ARIZONA_MICD_LVL_MASK;
853 lvl >>= ARIZONA_MICD_LVL_SHIFT; 853 lvl >>= ARIZONA_MICD_LVL_SHIFT;
854 854
855 for (i = 0; i < info->num_micd_ranges; i++)
856 input_report_key(info->input,
857 info->micd_ranges[i].key, 0);
858
855 WARN_ON(!lvl); 859 WARN_ON(!lvl);
856 WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges); 860 WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges);
857 if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) { 861 if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) {