All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
@ 2022-09-20  4:26 ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

This patch fixes interrupt trigger (should be level low as that is what the
driver is always using), the GPIO that is the interrupt source that is also
used to wake up chip by driving the line low.

The proper polarity is be needed for converting the driver to gpiod API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++--
 arch/arm/boot/dts/imx6qdl-sabresd.dtsi   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 1368a4762037..1883350d004e 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -451,8 +451,8 @@ touchscreen@4 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_egalax_int>;
 		interrupt-parent = <&gpio2>;
-		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
-		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
+		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
 	};
 };
 
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 37482a9023fc..09f4c2fa3ad6 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -311,8 +311,8 @@ touchscreen@4 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_i2c2_egalax_int>;
 		interrupt-parent = <&gpio6>;
-		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
-		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>;
+		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
 	};
 
 	ov5640: camera@3c {
@@ -450,8 +450,8 @@ egalax_ts@4 {
 		compatible = "eeti,egalax_ts";
 		reg = <0x04>;
 		interrupt-parent = <&gpio6>;
-		interrupts = <7 2>;
-		wakeup-gpios = <&gpio6 7 0>;
+		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
 	};
 
 	magnetometer@e {
-- 
2.37.3.968.ga6b4b080e4-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
@ 2022-09-20  4:26 ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

This patch fixes interrupt trigger (should be level low as that is what the
driver is always using), the GPIO that is the interrupt source that is also
used to wake up chip by driving the line low.

The proper polarity is be needed for converting the driver to gpiod API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++--
 arch/arm/boot/dts/imx6qdl-sabresd.dtsi   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 1368a4762037..1883350d004e 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -451,8 +451,8 @@ touchscreen@4 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_egalax_int>;
 		interrupt-parent = <&gpio2>;
-		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
-		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
+		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
 	};
 };
 
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 37482a9023fc..09f4c2fa3ad6 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -311,8 +311,8 @@ touchscreen@4 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_i2c2_egalax_int>;
 		interrupt-parent = <&gpio6>;
-		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
-		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>;
+		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
 	};
 
 	ov5640: camera@3c {
@@ -450,8 +450,8 @@ egalax_ts@4 {
 		compatible = "eeti,egalax_ts";
 		reg = <0x04>;
 		interrupt-parent = <&gpio6>;
-		interrupts = <7 2>;
-		wakeup-gpios = <&gpio6 7 0>;
+		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
 	};
 
 	magnetometer@e {
-- 
2.37.3.968.ga6b4b080e4-goog


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example
  2022-09-20  4:26 ` Dmitry Torokhov
@ 2022-09-20  4:26   ` Dmitry Torokhov
  -1 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

The driver is using level triggered interrupt (low) which is backed by
and active low GPIO that can be used to wake the controller by driving it
low. Let's annotate it properly in the example.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 .../devicetree/bindings/input/touchscreen/egalax-ts.txt       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
index 92fb2620f5e2..ebbe93810574 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
@@ -13,6 +13,6 @@ Example:
 		compatible = "eeti,egalax_ts";
 		reg = <0x04>;
 		interrupt-parent = <&gpio1>;
-		interrupts = <9 2>;
-		wakeup-gpios = <&gpio1 9 0>;
+		interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
 	};
-- 
2.37.3.968.ga6b4b080e4-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example
@ 2022-09-20  4:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

The driver is using level triggered interrupt (low) which is backed by
and active low GPIO that can be used to wake the controller by driving it
low. Let's annotate it properly in the example.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 .../devicetree/bindings/input/touchscreen/egalax-ts.txt       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
index 92fb2620f5e2..ebbe93810574 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
@@ -13,6 +13,6 @@ Example:
 		compatible = "eeti,egalax_ts";
 		reg = <0x04>;
 		interrupt-parent = <&gpio1>;
-		interrupts = <9 2>;
-		wakeup-gpios = <&gpio1 9 0>;
+		interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+		wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
 	};
-- 
2.37.3.968.ga6b4b080e4-goog


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/4] Input: egalax_ts - switch to using gpiod API
  2022-09-20  4:26 ` Dmitry Torokhov
@ 2022-09-20  4:26   ` Dmitry Torokhov
  -1 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

This updates the driver to gpiod API, and removes yet another use of
of_get_named_gpio().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/egalax_ts.c | 42 +++++++++++----------------
 1 file changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 83ac8c128192..9e9b1c52720d 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -14,17 +14,17 @@
   - auto idle mode support
 */
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
 #include <linux/irq.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/bitops.h>
 #include <linux/input/mt.h>
-#include <linux/of_gpio.h>
 
 /*
  * Mouse Mode: some panel may configure the controller to mouse mode,
@@ -119,32 +119,26 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
 /* wake up controller by an falling edge of interrupt gpio.  */
 static int egalax_wake_up_device(struct i2c_client *client)
 {
-	struct device_node *np = client->dev.of_node;
-	int gpio;
+	struct gpio_desc *gpio;
 	int ret;
 
-	if (!np)
-		return -ENODEV;
-
-	gpio = of_get_named_gpio(np, "wakeup-gpios", 0);
-	if (!gpio_is_valid(gpio))
-		return -ENODEV;
-
-	ret = gpio_request(gpio, "egalax_irq");
-	if (ret < 0) {
-		dev_err(&client->dev,
-			"request gpio failed, cannot wake up controller: %d\n",
-			ret);
+	/* wake up controller via an falling edge on IRQ gpio. */
+	gpio = gpiod_get(&client->dev, "wakeup", GPIOD_OUT_HIGH);
+	ret = PTR_ERR_OR_ZERO(gpio);
+	if (ret) {
+		if (ret != -EPROBE_DEFER)
+			dev_err(&client->dev,
+				"failed to request wakeup gpio, cannot wake up controller: %d\n",
+				ret);
 		return ret;
 	}
 
-	/* wake up controller via an falling edge on IRQ gpio. */
-	gpio_direction_output(gpio, 0);
-	gpio_set_value(gpio, 1);
+	/* release the line */
+	gpiod_set_value_cansleep(gpio, 0);
 
-	/* controller should be waken up, return irq.  */
-	gpio_direction_input(gpio);
-	gpio_free(gpio);
+	/* controller should be woken up, return irq.  */
+	gpiod_direction_input(gpio);
+	gpiod_put(gpio);
 
 	return 0;
 }
@@ -185,10 +179,8 @@ static int egalax_ts_probe(struct i2c_client *client,
 
 	/* controller may be in sleep, wake it up. */
 	error = egalax_wake_up_device(client);
-	if (error) {
-		dev_err(&client->dev, "Failed to wake up the controller\n");
+	if (error)
 		return error;
-	}
 
 	error = egalax_firmware_version(client);
 	if (error < 0) {
-- 
2.37.3.968.ga6b4b080e4-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/4] Input: egalax_ts - switch to using gpiod API
@ 2022-09-20  4:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

This updates the driver to gpiod API, and removes yet another use of
of_get_named_gpio().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/egalax_ts.c | 42 +++++++++++----------------
 1 file changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 83ac8c128192..9e9b1c52720d 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -14,17 +14,17 @@
   - auto idle mode support
 */
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
 #include <linux/irq.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/bitops.h>
 #include <linux/input/mt.h>
-#include <linux/of_gpio.h>
 
 /*
  * Mouse Mode: some panel may configure the controller to mouse mode,
@@ -119,32 +119,26 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
 /* wake up controller by an falling edge of interrupt gpio.  */
 static int egalax_wake_up_device(struct i2c_client *client)
 {
-	struct device_node *np = client->dev.of_node;
-	int gpio;
+	struct gpio_desc *gpio;
 	int ret;
 
-	if (!np)
-		return -ENODEV;
-
-	gpio = of_get_named_gpio(np, "wakeup-gpios", 0);
-	if (!gpio_is_valid(gpio))
-		return -ENODEV;
-
-	ret = gpio_request(gpio, "egalax_irq");
-	if (ret < 0) {
-		dev_err(&client->dev,
-			"request gpio failed, cannot wake up controller: %d\n",
-			ret);
+	/* wake up controller via an falling edge on IRQ gpio. */
+	gpio = gpiod_get(&client->dev, "wakeup", GPIOD_OUT_HIGH);
+	ret = PTR_ERR_OR_ZERO(gpio);
+	if (ret) {
+		if (ret != -EPROBE_DEFER)
+			dev_err(&client->dev,
+				"failed to request wakeup gpio, cannot wake up controller: %d\n",
+				ret);
 		return ret;
 	}
 
-	/* wake up controller via an falling edge on IRQ gpio. */
-	gpio_direction_output(gpio, 0);
-	gpio_set_value(gpio, 1);
+	/* release the line */
+	gpiod_set_value_cansleep(gpio, 0);
 
-	/* controller should be waken up, return irq.  */
-	gpio_direction_input(gpio);
-	gpio_free(gpio);
+	/* controller should be woken up, return irq.  */
+	gpiod_direction_input(gpio);
+	gpiod_put(gpio);
 
 	return 0;
 }
@@ -185,10 +179,8 @@ static int egalax_ts_probe(struct i2c_client *client,
 
 	/* controller may be in sleep, wake it up. */
 	error = egalax_wake_up_device(client);
-	if (error) {
-		dev_err(&client->dev, "Failed to wake up the controller\n");
+	if (error)
 		return error;
-	}
 
 	error = egalax_firmware_version(client);
 	if (error < 0) {
-- 
2.37.3.968.ga6b4b080e4-goog


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/4] Input: egalax_ts - do not hardcode interrupt trigger
  2022-09-20  4:26 ` Dmitry Torokhov
@ 2022-09-20  4:26   ` Dmitry Torokhov
  -1 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

Stop hard-coding interrupt trigger, instead rely on the platform code
to do the right thing, according to DT or ACPI data.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/egalax_ts.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 9e9b1c52720d..8333a512b605 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -203,10 +203,9 @@ static int egalax_ts_probe(struct i2c_client *client,
 			     ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0);
 	input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0);
 
-	error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
-					  egalax_ts_interrupt,
-					  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-					  "egalax_ts", ts);
+	error = devm_request_threaded_irq(&client->dev, client->irq,
+					  NULL, egalax_ts_interrupt,
+					  IRQF_ONESHOT, "egalax_ts", ts);
 	if (error < 0) {
 		dev_err(&client->dev, "Failed to register interrupt\n");
 		return error;
-- 
2.37.3.968.ga6b4b080e4-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/4] Input: egalax_ts - do not hardcode interrupt trigger
@ 2022-09-20  4:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-09-20  4:26 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

Stop hard-coding interrupt trigger, instead rely on the platform code
to do the right thing, according to DT or ACPI data.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/egalax_ts.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 9e9b1c52720d..8333a512b605 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -203,10 +203,9 @@ static int egalax_ts_probe(struct i2c_client *client,
 			     ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0);
 	input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0);
 
-	error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
-					  egalax_ts_interrupt,
-					  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-					  "egalax_ts", ts);
+	error = devm_request_threaded_irq(&client->dev, client->irq,
+					  NULL, egalax_ts_interrupt,
+					  IRQF_ONESHOT, "egalax_ts", ts);
 	if (error < 0) {
 		dev_err(&client->dev, "Failed to register interrupt\n");
 		return error;
-- 
2.37.3.968.ga6b4b080e4-goog


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example
  2022-09-20  4:26   ` Dmitry Torokhov
@ 2022-09-21  6:47     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-21  6:47 UTC (permalink / raw)
  To: Dmitry Torokhov, Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

On 20/09/2022 06:26, Dmitry Torokhov wrote:
> The driver is using level triggered interrupt (low) which is backed by
> and active low GPIO that can be used to wake the controller by driving it
> low. Let's annotate it properly in the example.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example
@ 2022-09-21  6:47     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-21  6:47 UTC (permalink / raw)
  To: Dmitry Torokhov, Shawn Guo, Sascha Hauer, linux-input
  Cc: Krzysztof Kozlowski, Fabio Estevam, devicetree, linux-arm-kernel,
	linux-kernel

On 20/09/2022 06:26, Dmitry Torokhov wrote:
> The driver is using level triggered interrupt (low) which is backed by
> and active low GPIO that can be used to wake the controller by driving it
> low. Let's annotate it properly in the example.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
  2022-09-20  4:26 ` Dmitry Torokhov
@ 2022-10-23  9:30   ` Shawn Guo
  -1 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2022-10-23  9:30 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Sascha Hauer, linux-input, Krzysztof Kozlowski, Fabio Estevam,
	devicetree, linux-arm-kernel, linux-kernel

On Mon, Sep 19, 2022 at 09:26:05PM -0700, Dmitry Torokhov wrote:
> This patch fixes interrupt trigger (should be level low as that is what the
> driver is always using), the GPIO that is the interrupt source that is also
> used to wake up chip by driving the line low.
> 
> The proper polarity is be needed for converting the driver to gpiod API.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Looks good to me.  Let me know if you want me to pick it up.  Otherwise,

Acked-by: Shawn Guo <shawnguo@kernel.org>

Shawn

> ---
>  arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++--
>  arch/arm/boot/dts/imx6qdl-sabresd.dtsi   | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> index 1368a4762037..1883350d004e 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> @@ -451,8 +451,8 @@ touchscreen@4 {
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&pinctrl_egalax_int>;
>  		interrupt-parent = <&gpio2>;
> -		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
> -		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> +		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
>  	};
>  };
>  
> diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> index 37482a9023fc..09f4c2fa3ad6 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> @@ -311,8 +311,8 @@ touchscreen@4 {
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&pinctrl_i2c2_egalax_int>;
>  		interrupt-parent = <&gpio6>;
> -		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
> -		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>;
> +		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
>  	};
>  
>  	ov5640: camera@3c {
> @@ -450,8 +450,8 @@ egalax_ts@4 {
>  		compatible = "eeti,egalax_ts";
>  		reg = <0x04>;
>  		interrupt-parent = <&gpio6>;
> -		interrupts = <7 2>;
> -		wakeup-gpios = <&gpio6 7 0>;
> +		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
>  	};
>  
>  	magnetometer@e {
> -- 
> 2.37.3.968.ga6b4b080e4-goog
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
@ 2022-10-23  9:30   ` Shawn Guo
  0 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2022-10-23  9:30 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Sascha Hauer, linux-input, Krzysztof Kozlowski, Fabio Estevam,
	devicetree, linux-arm-kernel, linux-kernel

On Mon, Sep 19, 2022 at 09:26:05PM -0700, Dmitry Torokhov wrote:
> This patch fixes interrupt trigger (should be level low as that is what the
> driver is always using), the GPIO that is the interrupt source that is also
> used to wake up chip by driving the line low.
> 
> The proper polarity is be needed for converting the driver to gpiod API.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Looks good to me.  Let me know if you want me to pick it up.  Otherwise,

Acked-by: Shawn Guo <shawnguo@kernel.org>

Shawn

> ---
>  arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++--
>  arch/arm/boot/dts/imx6qdl-sabresd.dtsi   | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> index 1368a4762037..1883350d004e 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> @@ -451,8 +451,8 @@ touchscreen@4 {
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&pinctrl_egalax_int>;
>  		interrupt-parent = <&gpio2>;
> -		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
> -		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> +		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
>  	};
>  };
>  
> diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> index 37482a9023fc..09f4c2fa3ad6 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> @@ -311,8 +311,8 @@ touchscreen@4 {
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&pinctrl_i2c2_egalax_int>;
>  		interrupt-parent = <&gpio6>;
> -		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
> -		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>;
> +		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
>  	};
>  
>  	ov5640: camera@3c {
> @@ -450,8 +450,8 @@ egalax_ts@4 {
>  		compatible = "eeti,egalax_ts";
>  		reg = <0x04>;
>  		interrupt-parent = <&gpio6>;
> -		interrupts = <7 2>;
> -		wakeup-gpios = <&gpio6 7 0>;
> +		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
> +		wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
>  	};
>  
>  	magnetometer@e {
> -- 
> 2.37.3.968.ga6b4b080e4-goog
> 

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
  2022-10-23  9:30   ` Shawn Guo
@ 2022-10-24 12:04     ` Dmitry Torokhov
  -1 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-10-24 12:04 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Sascha Hauer, linux-input, Krzysztof Kozlowski, Fabio Estevam,
	devicetree, linux-arm-kernel, linux-kernel

On Sun, Oct 23, 2022 at 05:30:16PM +0800, Shawn Guo wrote:
> On Mon, Sep 19, 2022 at 09:26:05PM -0700, Dmitry Torokhov wrote:
> > This patch fixes interrupt trigger (should be level low as that is what the
> > driver is always using), the GPIO that is the interrupt source that is also
> > used to wake up chip by driving the line low.
> > 
> > The proper polarity is be needed for converting the driver to gpiod API.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Looks good to me.  Let me know if you want me to pick it up.  Otherwise,
> 
> Acked-by: Shawn Guo <shawnguo@kernel.org>

Thank you, I merged it with the other 3 patches through my tree.

-- 
Dmitry

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties
@ 2022-10-24 12:04     ` Dmitry Torokhov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2022-10-24 12:04 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Sascha Hauer, linux-input, Krzysztof Kozlowski, Fabio Estevam,
	devicetree, linux-arm-kernel, linux-kernel

On Sun, Oct 23, 2022 at 05:30:16PM +0800, Shawn Guo wrote:
> On Mon, Sep 19, 2022 at 09:26:05PM -0700, Dmitry Torokhov wrote:
> > This patch fixes interrupt trigger (should be level low as that is what the
> > driver is always using), the GPIO that is the interrupt source that is also
> > used to wake up chip by driving the line low.
> > 
> > The proper polarity is be needed for converting the driver to gpiod API.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Looks good to me.  Let me know if you want me to pick it up.  Otherwise,
> 
> Acked-by: Shawn Guo <shawnguo@kernel.org>

Thank you, I merged it with the other 3 patches through my tree.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-10-24 12:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-20  4:26 [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties Dmitry Torokhov
2022-09-20  4:26 ` Dmitry Torokhov
2022-09-20  4:26 ` [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example Dmitry Torokhov
2022-09-20  4:26   ` Dmitry Torokhov
2022-09-21  6:47   ` Krzysztof Kozlowski
2022-09-21  6:47     ` Krzysztof Kozlowski
2022-09-20  4:26 ` [PATCH 3/4] Input: egalax_ts - switch to using gpiod API Dmitry Torokhov
2022-09-20  4:26   ` Dmitry Torokhov
2022-09-20  4:26 ` [PATCH 4/4] Input: egalax_ts - do not hardcode interrupt trigger Dmitry Torokhov
2022-09-20  4:26   ` Dmitry Torokhov
2022-10-23  9:30 ` [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties Shawn Guo
2022-10-23  9:30   ` Shawn Guo
2022-10-24 12:04   ` Dmitry Torokhov
2022-10-24 12:04     ` Dmitry Torokhov

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.