• Andy Shevchenko's avatar
    pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line · e12963c4
    Andy Shevchenko authored
    The commit af7e3eeb ("pinctrl: intel: Disable input and output buffer
    when switching to GPIO") hadn't taken into account an update of the IRQ
    flags scenario.
    
    When updating the IRQ flags on the preconfigured line the ->irq_set_type()
    is called again. In such case the sequential Rx buffer configuration
    changes may trigger a falling or rising edge interrupt that may lead,
    on some platforms, to an undesired event.
    
    This may happen because each of intel_gpio_set_gpio_mode() and
    __intel_gpio_set_direction() updates the pad configuration with a different
    value of the GPIORXDIS bit. Notable, that the intel_gpio_set_gpio_mode() is
    called only for the pads that are configured as an input. Due to this fact,
    integrate the logic of __intel_gpio_set_direction() call into the
    intel_gpio_set_gpio_mode() so that the Rx buffer won't be disabled and
    immediately re-enabled.
    
    Fixes: af7e3eeb ("pinctrl: intel: Disable input and output buffer when switching to GPIO")
    Reported-by: default avatarKane Chen <kane.chen@intel.com>
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    Tested-by: default avatarGrace Kao <grace.kao@intel.com>
    e12963c4
pinctrl-intel.c 45.3 KB