linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] pinctrl: Align Cannon Lake GPIO number space with Windows
@ 2017-11-27 13:54 Mika Westerberg
  2017-11-27 13:54 ` [PATCH 1/3] gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation Mika Westerberg
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mika Westerberg @ 2017-11-27 13:54 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andy Shevchenko, Heikki Krogerus, Rafael J. Wysocki,
	Hans de Goede, Takashi Iwai, Mika Westerberg, linux-acpi,
	linux-kernel

Hi,

It turns out that the Cannon Lake GPIO driver in Windows uses different
GPIO numbering scheme than what Linux uses. Instead of hardware numbers it
has "banks" of 32 pins even if the hardware group actually does not have
that many pins. This is problematic for Linux because BIOS uses the same
Windows numbering scheme in ACPI GpioIo/GpioInt resources, making Linux to
pick a wrong pin.

For example the SD card detection GPIO resource in BIOS ACPI tables looks
like:

  GpioInt (...) {231} // vSD3_CD_B

Where the real hardware number would be 180 instead of 231.

Unfortunately changing the BIOS and the Windows driver is not possible for
Cannon Lake anymore so we need to handle it in Linux instead. This should
be done properly in future platforms.

The patch series updates the Intel pinctrl driver to allow passing custom
GPIO number space, taking advantage of pin ranges supported by the pinctrl
core. However, before we can add these pin ranges we need to drop the
custom Cherryview GPIO/ACPI translation first and make the driver to use
direct mapping instead (which turns out to be much simpler).

Once that is done we update the Cannon Lake pinctrl driver to align with
the Windows GPIO driver numbering scheme.

Mika Westerberg (3):
  gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation
  pinctrl: intel: Allow custom GPIO base for pad groups
  pinctrl: cannonlake: Align GPIO number space with Windows

 drivers/gpio/gpiolib-acpi.c                |  75 +-------------
 drivers/pinctrl/intel/pinctrl-cannonlake.c |  65 ++++++------
 drivers/pinctrl/intel/pinctrl-cherryview.c |  59 ++++-------
 drivers/pinctrl/intel/pinctrl-intel.c      | 156 +++++++++++++++++++++--------
 drivers/pinctrl/intel/pinctrl-intel.h      |   3 +
 5 files changed, 176 insertions(+), 182 deletions(-)

-- 
2.15.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-29 13:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-27 13:54 [PATCH 0/3] pinctrl: Align Cannon Lake GPIO number space with Windows Mika Westerberg
2017-11-27 13:54 ` [PATCH 1/3] gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation Mika Westerberg
2017-11-28 21:05   ` Rafael J. Wysocki
2017-11-29 12:43   ` Linus Walleij
2017-11-27 13:54 ` [PATCH 2/3] pinctrl: intel: Allow custom GPIO base for pad groups Mika Westerberg
2017-11-29 12:46   ` Linus Walleij
2017-11-27 13:54 ` [PATCH 3/3] pinctrl: cannonlake: Align GPIO number space with Windows Mika Westerberg
2017-11-28 21:52 ` [PATCH 0/3] pinctrl: Align Cannon Lake " Andy Shevchenko
2017-11-29 12:49 ` Linus Walleij
2017-11-29 13:09   ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).