Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1645384pxp; Thu, 17 Mar 2022 13:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy60QuaGHpkT6e/e9KhyhXxqFgm6lwAPdq0eYRImBhJdOpPM4aRR2W0bT/ay9Bh+uqyf1SE X-Received: by 2002:a17:90a:6003:b0:1c6:64a9:2155 with SMTP id y3-20020a17090a600300b001c664a92155mr7491926pji.30.1647548985666; Thu, 17 Mar 2022 13:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647548985; cv=none; d=google.com; s=arc-20160816; b=YFJuMsW6GZOOKtVSqzvnRzb99DdFXTx93habkxay2VAwQfFrbPEjNVcTCkskRZmwFn SaHCYAyNCpwL2Lh/pn1lOhBjPC+EtU28WzilusAtjf9pMXZKOj13P2T73n84dujYUrvD 6nFDC+UO+Sfytjp890xbkVwhKumD+a99HDCI8mZj9BsNVZEi6LKGsE4X30/OkAYMPq95 0anASNOt8S35ct3z5rpIqSG5llpQNJb0enSskutNFpHS9rjnluQyPgQ3RTnZtlDJzY5Z zNX2Wfdih+rYGpw+oYdtBDHPy1Nc7aS7OIzjtV/XH2maw5Xs4CD5xIxKLsFYtB1JcngS /gIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BQGWhJ7tLNedXpJZlS/CVL03fbIK6NbGP818OHSS3g8=; b=nB3eB27bABi3SBtd+mAeXkLAL9AVZ5lParMwq1T6KBYUbnP1QkF690Q+4LGsZ2NE/t 14daS3NXrDJI6fWmVaCwD2/zeYxMoJ6AXRsPF2/r3C2ybYQcR8QZnWRy1x37xwRabnPU eF8odZo2BrPtHBnYs8ca4ggO04I07dby4fnJBCVz2a17WUOAaEcmeayeVAaag+UXI90t /nZ4OqeVdsuBcDUUlzos7ae0AfrH4a/E21mc3jTSNKHiJkM4aTBf9HOQxTVE0IleRhrS TSL5OzNJxEl1TZAIQeVDjyPzIaxPGu/dlc2YZBiTCuIMR9j1QSD8tz5tmLEx9i56EqmP md4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PhCdYRia; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k10-20020a170902ba8a00b00153b2d16556si80542pls.350.2022.03.17.13.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:29:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PhCdYRia; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C3392C9610; Thu, 17 Mar 2022 13:05:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234898AbiCQM6Z (ORCPT + 99 others); Thu, 17 Mar 2022 08:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235077AbiCQMyg (ORCPT ); Thu, 17 Mar 2022 08:54:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E7F1EC6D; Thu, 17 Mar 2022 05:53:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 12589B81E01; Thu, 17 Mar 2022 12:53:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F7CFC340E9; Thu, 17 Mar 2022 12:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521596; bh=o0lMoPtysunsKgbgzC3/md5VDCnp60LnkLkLaYxOo7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PhCdYRiaFoO62mHZDi89+lb6MUdKzVOzgTJF3noBDp0NwrqJD9M+xN4S5qrrsUKuq W+k+qdiuj5jzX3/lScrrcI46SmUq6Bk5aUpJ7epHozDL1N1eHDPgva1Od8FQL1OfOi 6w+CRbzRN9sscfz3H5HqDfFdFZqF9E6EA2+5Rbcg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.16 20/28] Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource Date: Thu, 17 Mar 2022 13:46:11 +0100 Message-Id: <20220317124527.340395229@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124526.768423926@linuxfoundation.org> References: <20220317124526.768423926@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ 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 Link: https://lore.kernel.org/r/20220228111613.363336-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- 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 e053aadea3c9..d3136842b717 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -745,7 +745,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; @@ -758,6 +758,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