lkml.org 
[lkml]   [2013]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 14/16] extcon: arizona: Clear existing button reports before reporting new one
    Date
    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>
    ---
    drivers/extcon/extcon-arizona.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
    index e2d881a..26f9a1a 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)
    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) {
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2013-04-02 14:42    [W:5.588 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site