From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Sasha Levin <sashal@kernel.org>,
hadess@hadess.net, linux-input@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 13/20] Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource
Date: Wed, 9 Mar 2022 11:21:51 -0500 [thread overview]
Message-ID: <20220309162158.136467-13-sashal@kernel.org> (raw)
In-Reply-To: <20220309162158.136467-1-sashal@kernel.org>
From: Hans de Goede <hdegoede@redhat.com>
[ Upstream commit d982992669733dd75520000c6057d8ee0725a363 ]
ACPI/x86 devices with a Cherry Trail SoC should have a GpioInt + a regular
GPIO ACPI resource in their ACPI tables.
Some CHT devices have a bug, where the also is bogus interrupt resource
(likely copied from a previous Bay Trail based generation of the device).
The i2c-core-acpi code will assign the bogus, non-working, interrupt
resource to client->irq. Add a workaround to fix this up.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2043960
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220228111613.363336-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/touchscreen/goodix.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 5fc789f717c8..f6c92365d327 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -782,7 +782,7 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
const struct acpi_gpio_mapping *gpio_mapping = NULL;
struct device *dev = &ts->client->dev;
LIST_HEAD(resources);
- int ret;
+ int irq, ret;
ts->gpio_count = 0;
ts->gpio_int_idx = -1;
@@ -795,6 +795,20 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
acpi_dev_free_resource_list(&resources);
+ /*
+ * CHT devices should have a GpioInt + a regular GPIO ACPI resource.
+ * Some CHT devices have a bug (where the also is bogus Interrupt
+ * resource copied from a previous BYT based generation). i2c-core-acpi
+ * will use the non-working Interrupt resource, fix this up.
+ */
+ if (soc_intel_is_cht() && ts->gpio_count == 2 && ts->gpio_int_idx != -1) {
+ irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
+ if (irq > 0 && irq != ts->client->irq) {
+ dev_warn(dev, "Overriding IRQ %d -> %d\n", ts->client->irq, irq);
+ ts->client->irq = irq;
+ }
+ }
+
if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) {
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
gpio_mapping = acpi_goodix_int_first_gpios;
--
2.34.1
next prev parent reply other threads:[~2022-03-09 16:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 03/20] arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 04/20] arm64: dts: rockchip: reorder rk3399 hdmi clocks Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 05/20] arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg" Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 06/20] ARM: dts: rockchip: reorder rk322x hmdi clocks Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 07/20] ARM: dts: rockchip: fix a typo on rk3288 crypto-controller Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 08/20] mac80211: refuse aggregations sessions before authorized Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 09/20] MIPS: smp: fill in sibling and core maps earlier Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 10/20] ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 11/20] can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 12/20] atm: firestream: check the return value of ioremap() in fs_init() Sasha Levin
2022-03-09 16:21 ` Sasha Levin [this message]
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 14/20] iwlwifi: don't advertise TWT support Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 15/20] drm/vrr: Set VRR capable prop only if it is attached to connector Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 16/20] nl80211: Update bss channel on channel switch for P2P_CLIENT Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 17/20] tcp: make tcp_read_sock() more robust Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 18/20] sfc: extend the locking on mcdi->seqno Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message Sasha Levin
2022-03-17 11:23 ` Pavel Machek
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 20/20] kselftest/vm: fix tests build with old libc Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220309162158.136467-13-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=hdegoede@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox