linux-stable/drivers/pinctrl/intel
Hans de Goede 07199dbf8c pinctrl: cherryview: Do not allow the same interrupt line to be used by 2 pins
It is impossible to use the same interrupt line for 2 pins, this will
result in the interrupts only being delivered to the IRQ handler for
the pin for which chv_gpio_irq_type() was called last.

The pinctrl-cherryview.c code relies on the BIOS to correctly setup the
interrupt line, but there is a BIOS bug on at least the Medion Akoya E1239T
and the GPD win models where both INT33FF:02 pin 8, used by the powerbutton
and INT33FF:02 pin 21 used as IRQ input for the accelerometer are mapped to
interrupt line 0.

This causes 2 problems:
1. The accelerometer IRQ does not work, since the power button is probed
later taking over the intr_lines[0] slot.

2. Since the accelerometer IRQ is not marked as wakeup, interrupt line 0
gets masked on suspend, causing the power button to not work to wake
the system from suspend.

Likewise on the Lenovo Yogabook, which has a touchscreen as keyboard
and the keyboard half of the tablet also has a Wacom digitizer, the BIOS
by default assigns the same interrupt line to the GPIOs used
for their interrupts.

Fix these problems by adding a check for this and assigning a new
interrupt line to the 2nd pin for which chv_gpio_irq_type() gets called.

With this fix in place the following 2 messages show up in dmesg on
the Medion Akoya E1239T and the GPD win:

 cherryview-pinctrl INT33FF:02: interrupt line 0 is used by both pin 21 and pin 8
 cherryview-pinctrl INT33FF:02: changing the interrupt line for pin 8 to 15

And the following gets logged on the Lenovo Yogabook:

 cherryview-pinctrl INT33FF:01: interrupt-line 0 is used by both pin 49 and pin 56
 cherryview-pinctrl INT33FF:01: changing the interrupt line for pin 56 to 7

Note commit 9747070c11 ("Input: axp20x-pek - always register interrupt
handlers") was added as a work around for the power button not being able
to wakeup the system. This relies on using the PMIC's connection to the
power button but that only works on systems with the AXP288 PMIC.
Once this fix has been merged that workaround can be removed.

Cc: Yauhen Kharuzhy <jekhor@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-11-26 22:37:41 +02:00
..
Kconfig pinctrl: intel: Kconfig: Add configuration menu to Intel pin control 2021-10-26 01:30:11 +02:00
Makefile pinctrl: intel: Add Intel Alder Lake-S pin controller support 2020-11-04 12:33:19 +02:00
pinctrl-alderlake.c pinctrl: intel: Add Intel Alder Lake-S pin controller support 2020-11-04 12:33:19 +02:00
pinctrl-baytrail.c pinctrl: baytrail: Set IRQCHIP_SET_TYPE_MASKED flag on the irqchip 2021-11-23 15:38:49 +02:00
pinctrl-broxton.c pinctrl: broxton: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-cannonlake.c pinctrl: cannonlake: Modify COMMUNITY macros to be consistent 2020-09-30 11:43:56 +02:00
pinctrl-cedarfork.c pinctrl: cedarfork: Update pin names according to v1.13c 2019-04-03 14:49:47 +03:00
pinctrl-cherryview.c pinctrl: cherryview: Do not allow the same interrupt line to be used by 2 pins 2021-11-26 22:37:41 +02:00
pinctrl-denverton.c pinctrl: denverton: Update pin names according to v1.08 2019-08-08 12:57:01 +03:00
pinctrl-elkhartlake.c pinctrl: intel: Add Intel Elkhart Lake pin controller support 2020-11-04 12:33:19 +02:00
pinctrl-emmitsburg.c pinctrl: intel: Add Intel Emmitsburg pin controller support 2020-07-21 11:44:21 +03:00
pinctrl-geminilake.c pinctrl: geminilake: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-icelake.c pinctrl: icelake: Use generic flag for special GPIO base treatment 2020-04-14 16:17:13 +03:00
pinctrl-intel.c This is the bulk of the pin control changes for the v5.13 kernel cycle 2021-04-30 13:04:30 -07:00
pinctrl-intel.h pinctrl: intel: Convert capability list to features 2021-01-08 16:04:30 +02:00
pinctrl-jasperlake.c pinctrl: jasperlake: Fix HOSTSW_OWN offset 2020-11-16 12:07:57 +02:00
pinctrl-lakefield.c pinctrl: intel: Add Intel Lakefield pin controller support 2020-11-02 22:32:13 +02:00
pinctrl-lewisburg.c pinctrl: lewisburg: Update number of pins in community 2021-04-13 14:09:48 +03:00
pinctrl-lynxpoint.c pinctrl: Bulk conversion to generic_handle_domain_irq() 2021-08-12 11:39:39 +01:00
pinctrl-merrifield.c pinctrl: merrifield: Set default bias in case no particular value given 2020-11-16 12:07:57 +02:00
pinctrl-sunrisepoint.c pinctrl: sunrisepoint: Modify COMMUNITY macros to be consistent 2020-09-30 11:43:56 +02:00
pinctrl-tigerlake.c pinctrl: tigerlake: Fix GPIO mapping for newer version of software 2021-08-04 18:47:50 +03:00