Skip to content

Commit

Permalink
extcon: arizona: Clear existing button reports before reporting new one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Apr 2, 2013
1 parent 939c567 commit 41a5785
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ static irqreturn_t arizona_micdet(int irq, void *data)
lvl = val & ARIZONA_MICD_LVL_MASK;
lvl >>= ARIZONA_MICD_LVL_SHIFT;

for (i = 0; i < info->num_micd_ranges; i++)
input_report_key(info->input,
info->micd_ranges[i].key, 0);

WARN_ON(!lvl);
WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges);
if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) {
Expand Down

0 comments on commit 41a5785

Please sign in to comment.