]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
pinctrl: intel: Avoid potential glitches if pin is in GPIO mode
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 14 Oct 2019 09:51:04 +0000 (12:51 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:19 +0000 (13:16 +0100)
commit1d2c826af37369f82914cb91900056f051b1706f
tree5c994d47d49461baa9cd2d7fb87f840f3a8d5bc8
parentf5a435996555113f79c14cd824583f271ffc9c65
pinctrl: intel: Avoid potential glitches if pin is in GPIO mode

BugLink: https://bugs.launchpad.net/bugs/1853519
[ Upstream commit 29c2c6aa32405dfee4a29911a51ba133edcedb0f ]

When consumer requests a pin, in order to be on the safest side,
we switch it first to GPIO mode followed by immediate transition
to the input state. Due to posted writes it's luckily to be a single
I/O transaction.

However, if firmware or boot loader already configures the pin
to the GPIO mode, user expects no glitches for the requested pin.
We may check if the pin is pre-configured and leave it as is
till the actual consumer toggles its state to avoid glitches.

Fixes: 7981c0015af2 ("pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support")
Depends-on: f5a26acf0162 ("pinctrl: intel: Initialize GPIO properly when used through irqchip")
Cc: stable@vger.kernel.org
Cc: fei.yang@intel.com
Reported-by: Oliver Barta <oliver.barta@aptiv.com>
Reported-by: Malin Jonsson <malin.jonsson@ericsson.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/pinctrl/intel/pinctrl-intel.c