OSDN Git Service

Input: goodix - refactor IRQ pin GPIO accesses
authorHans de Goede <hdegoede@redhat.com>
Tue, 24 Mar 2020 18:12:10 +0000 (11:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 24 Mar 2020 22:07:11 +0000 (15:07 -0700)
commit49db3997d82fe51655d75944fa68a08143782a5d
tree1e3256d1ded7686f556a4b03d2ab860c6e1d3448
parent061706716384f1633d3d5090b22a99f33f1fcf2f
Input: goodix - refactor IRQ pin GPIO accesses

Suspending Goodix touchscreens requires changing the interrupt pin to
output before sending them a power-down command. Followed by wiggling
the interrupt pin to wake the device up, after which it is put back
in input mode.

So far we have only effectively supported this on devices which use
devicetree. On X86 ACPI platforms both looking up the pins; and using a
pin as both IRQ and GPIO is a bit more complicated. E.g. on some devices
we cannot directly access the IRQ pin as GPIO and we need to call ACPI
methods to control it instead.

This commit adds a new irq_pin_access_method field to the goodix_chip_data
struct and adds goodix_irq_direction_output and goodix_irq_direction_input
helpers which together abstract the GPIO accesses to the IRQ pin.

This is a preparation patch for adding support for properly suspending the
touchscreen on X86 ACPI platforms.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786317
BugLink: https://github.com/nexus511/gpd-ubuntu-packages/issues/10
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199207
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20200307121505.3707-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/goodix.c