All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+kernel@0leil.net>
To: "Samuel Holland" <samuel@sholland.org>,
	"Bastien Nocera" <hadess@hadess.net>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Angus Ainslie" <angus@akkea.ca>,
	"Ondrej Jirman" <megous@megous.com>,
	"Icenowy Zheng" <icenowy@aosc.io>,
	"Andy Gross" <agross@kernel.org>,
	"Aleksei Mamlin" <mamlinav@gmail.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"David Jander" <david@protonic.nl>,
	"Frieder Schrempf" <frieder.schrempf@kontron.de>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@somainline.org>,
	"Peter Geis" <pgwipeout@gmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@somainline.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Michael Riesch" <michael.riesch@wolfvision.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: [PATCH v3 2/9] Input: goodix - make gpiod_get honor GPIOD_ASIS
Date: Mon,  5 Dec 2022 14:40:31 +0100	[thread overview]
Message-ID: <20221103-upstream-goodix-reset-v3-2-0975809eb183@theobroma-systems.com> (raw)
In-Reply-To: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com>

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

For some reason the ACPI GPIO lookup code (acpi_find_gpio followed by
acpi_gpio_update_gpiod_flags) will override the gpiod_flags
passed to gpiod_get() if it can determine a set of flags from the ACPI
GpioIo entry.

For output pins like the reset pin, this requires a pull bias to be set,
which often is not the case, so then the GPIOD_ASIS which we pass in is
used.

But if a pull bias is specified in the ACPI GpioIo entry for the reset
pin then that gets translated to GPIOD_OUT_LOW or GPIOD_OUT_HIGH meaning
we cannot guarantee the same behavior on all boards.

So this may cause unintended side-effects, c.f. commit a2fd46cd3dbb
("Input: goodix - try not to touch the reset-pin on x86/ACPI devices")
for some background.

This is something which we can fix though, we can force the ACPI GPIO
code to honor the GPIOD_ASIS we pass in by passing
ACPI_GPIO_QUIRK_NO_IO_RESTRICTION to the ACPI gpio mapping.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/input/touchscreen/goodix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index d73d4272a8ea5..1639f2f8a31e3 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -803,6 +803,7 @@ static int goodix_reset(struct goodix_ts_data *ts)
 		.name = _name, \
 		.data = _params, \
 		.size = _size, \
+		.quirks = ACPI_GPIO_QUIRK_NO_IO_RESTRICTION, \
 	}
 
 static const struct acpi_gpio_params first_gpio = { 0, 0, false };

-- 
b4 0.10.1

WARNING: multiple messages have this Message-ID (diff)
From: Quentin Schulz <foss+kernel@0leil.net>
To: "Samuel Holland" <samuel@sholland.org>,
	"Bastien Nocera" <hadess@hadess.net>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Angus Ainslie" <angus@akkea.ca>,
	"Ondrej Jirman" <megous@megous.com>,
	"Icenowy Zheng" <icenowy@aosc.io>,
	"Andy Gross" <agross@kernel.org>,
	"Aleksei Mamlin" <mamlinav@gmail.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"David Jander" <david@protonic.nl>,
	"Frieder Schrempf" <frieder.schrempf@kontron.de>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@somainline.org>,
	"Peter Geis" <pgwipeout@gmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@somainline.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Michael Riesch" <michael.riesch@wolfvision.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: [PATCH v3 2/9] Input: goodix - make gpiod_get honor GPIOD_ASIS
Date: Mon,  5 Dec 2022 14:40:31 +0100	[thread overview]
Message-ID: <20221103-upstream-goodix-reset-v3-2-0975809eb183@theobroma-systems.com> (raw)
In-Reply-To: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com>

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

For some reason the ACPI GPIO lookup code (acpi_find_gpio followed by
acpi_gpio_update_gpiod_flags) will override the gpiod_flags
passed to gpiod_get() if it can determine a set of flags from the ACPI
GpioIo entry.

For output pins like the reset pin, this requires a pull bias to be set,
which often is not the case, so then the GPIOD_ASIS which we pass in is
used.

But if a pull bias is specified in the ACPI GpioIo entry for the reset
pin then that gets translated to GPIOD_OUT_LOW or GPIOD_OUT_HIGH meaning
we cannot guarantee the same behavior on all boards.

So this may cause unintended side-effects, c.f. commit a2fd46cd3dbb
("Input: goodix - try not to touch the reset-pin on x86/ACPI devices")
for some background.

This is something which we can fix though, we can force the ACPI GPIO
code to honor the GPIOD_ASIS we pass in by passing
ACPI_GPIO_QUIRK_NO_IO_RESTRICTION to the ACPI gpio mapping.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/input/touchscreen/goodix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index d73d4272a8ea5..1639f2f8a31e3 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -803,6 +803,7 @@ static int goodix_reset(struct goodix_ts_data *ts)
 		.name = _name, \
 		.data = _params, \
 		.size = _size, \
+		.quirks = ACPI_GPIO_QUIRK_NO_IO_RESTRICTION, \
 	}
 
 static const struct acpi_gpio_params first_gpio = { 0, 0, false };

-- 
b4 0.10.1

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Quentin Schulz <foss+kernel@0leil.net>
To: "Samuel Holland" <samuel@sholland.org>,
	"Bastien Nocera" <hadess@hadess.net>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Angus Ainslie" <angus@akkea.ca>,
	"Ondrej Jirman" <megous@megous.com>,
	"Icenowy Zheng" <icenowy@aosc.io>,
	"Andy Gross" <agross@kernel.org>,
	"Aleksei Mamlin" <mamlinav@gmail.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"David Jander" <david@protonic.nl>,
	"Frieder Schrempf" <frieder.schrempf@kontron.de>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@somainline.org>,
	"Peter Geis" <pgwipeout@gmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@somainline.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Michael Riesch" <michael.riesch@wolfvision.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: [PATCH v3 2/9] Input: goodix - make gpiod_get honor GPIOD_ASIS
Date: Mon,  5 Dec 2022 14:40:31 +0100	[thread overview]
Message-ID: <20221103-upstream-goodix-reset-v3-2-0975809eb183@theobroma-systems.com> (raw)
In-Reply-To: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com>

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

For some reason the ACPI GPIO lookup code (acpi_find_gpio followed by
acpi_gpio_update_gpiod_flags) will override the gpiod_flags
passed to gpiod_get() if it can determine a set of flags from the ACPI
GpioIo entry.

For output pins like the reset pin, this requires a pull bias to be set,
which often is not the case, so then the GPIOD_ASIS which we pass in is
used.

But if a pull bias is specified in the ACPI GpioIo entry for the reset
pin then that gets translated to GPIOD_OUT_LOW or GPIOD_OUT_HIGH meaning
we cannot guarantee the same behavior on all boards.

So this may cause unintended side-effects, c.f. commit a2fd46cd3dbb
("Input: goodix - try not to touch the reset-pin on x86/ACPI devices")
for some background.

This is something which we can fix though, we can force the ACPI GPIO
code to honor the GPIOD_ASIS we pass in by passing
ACPI_GPIO_QUIRK_NO_IO_RESTRICTION to the ACPI gpio mapping.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/input/touchscreen/goodix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index d73d4272a8ea5..1639f2f8a31e3 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -803,6 +803,7 @@ static int goodix_reset(struct goodix_ts_data *ts)
 		.name = _name, \
 		.data = _params, \
 		.size = _size, \
+		.quirks = ACPI_GPIO_QUIRK_NO_IO_RESTRICTION, \
 	}
 
 static const struct acpi_gpio_params first_gpio = { 0, 0, false };

-- 
b4 0.10.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-12-05 13:41 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 13:40 [PATCH v3 0/9] fix reset line polarity for Goodix touchscreen controllers Quentin Schulz
2022-12-05 13:40 ` Quentin Schulz
2022-12-05 13:40 ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 1/9] Input: goodix - add macro for gpio mapping Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` Quentin Schulz [this message]
2022-12-05 13:40   ` [PATCH v3 2/9] Input: goodix - make gpiod_get honor GPIOD_ASIS Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 3/9] Input: goodix - fix reset polarity Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 4/9] ARM: dts: imx: fix touchscreen reset GPIO polarity Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-06 11:25   ` Frieder Schrempf
2022-12-06 11:25     ` Frieder Schrempf
2022-12-06 11:25     ` Frieder Schrempf
2022-12-06 12:42     ` Lukasz Majewski
2022-12-06 12:42       ` Lukasz Majewski
2022-12-06 12:42       ` Lukasz Majewski
2022-12-05 13:40 ` [PATCH v3 5/9] ARM: dts: sunxi: fix touchscreen reset GPIO polarity on Wexler TAB7200 tablet Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 6/9] arm64: dts: allwinner: fix touchscreen reset GPIO polarity Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-06  0:26   ` Samuel Holland
2022-12-06  0:26     ` Samuel Holland
2022-12-06  0:26     ` Samuel Holland
2022-12-06 11:11     ` Quentin Schulz
2022-12-06 11:11       ` Quentin Schulz
2022-12-06 11:11       ` Quentin Schulz
2022-12-12  6:32       ` Samuel Holland
2022-12-12  6:32         ` Samuel Holland
2022-12-12  6:32         ` Samuel Holland
2022-12-12 13:21         ` Robin Murphy
2022-12-12 13:21           ` Robin Murphy
2022-12-12 13:21           ` Robin Murphy
2022-12-05 13:40 ` [PATCH v3 7/9] arm64: dts: librem5: " Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 8/9] arm64: dts: qcom: msm8998-fxtec: " Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40 ` [PATCH v3 9/9] arm64: dts: rockchip: " Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-05 13:40   ` Quentin Schulz
2022-12-13 10:24   ` Michael Riesch
2022-12-13 10:24     ` Michael Riesch
2022-12-13 10:24     ` Michael Riesch
2022-12-05 22:19 ` [PATCH v3 0/9] fix reset line polarity for Goodix touchscreen controllers Hans de Goede
2022-12-05 22:19   ` Hans de Goede
2022-12-05 22:19   ` Hans de Goede
2023-01-10 16:17 ` (subset) " Bjorn Andersson
2023-01-10 16:17   ` Bjorn Andersson
2023-01-10 16:17   ` Bjorn Andersson
2023-01-16 12:37   ` Quentin Schulz
2023-01-16 12:37     ` Quentin Schulz
2023-01-16 12:37     ` Quentin Schulz
2023-02-28 17:36     ` Quentin Schulz
2023-02-28 17:36       ` Quentin Schulz
2023-02-28 17:36       ` Quentin Schulz

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=20221103-upstream-goodix-reset-v3-2-0975809eb183@theobroma-systems.com \
    --to=foss+kernel@0leil.net \
    --cc=agross@kernel.org \
    --cc=agx@sigxcpu.org \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=angus@akkea.ca \
    --cc=david@protonic.nl \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=hadess@hadess.net \
    --cc=hdegoede@redhat.com \
    --cc=heiko@sntech.de \
    --cc=icenowy@aosc.io \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=lukma@denx.de \
    --cc=mamlinav@gmail.com \
    --cc=megous@megous.com \
    --cc=michael.riesch@wolfvision.net \
    --cc=pgwipeout@gmail.com \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=samuel@sholland.org \
    --cc=shawnguo@kernel.org \
    --cc=wens@csie.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.