]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 19 Jan 2022 18:19:15 +0000 (20:19 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 24 Jan 2022 14:30:13 +0000 (16:30 +0200)
commitffe21600a9803078cafe028e516a6c8daeb20122
tree6ffb8b042e312179884681672f538b53079280f9
parent6cbd3ee6c6a6abaaef5c27a25a86e32b4584d547
pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line

The commit 38838b81d13f ("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: 38838b81d13f ("pinctrl: intel: Disable input and output buffer when switching to GPIO")
Reported-by: Kane Chen <kane.chen@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Grace Kao <grace.kao@intel.com>
drivers/pinctrl/intel/pinctrl-intel.c