linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] input: goodix - support Goodix gt5688
@ 2019-02-15 14:11 Guido Günther
  2019-02-15 14:11 ` [PATCH v3 1/3] " Guido Günther
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Guido Günther @ 2019-02-15 14:11 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Mark Rutland, Bastien Nocera,
	Matthias Brugger, Guido Günther, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek

Besides the support for gt5688 two more minimal changes piled up so I'm
folding these in here. One is a doc update for the goodix bindings, the
other one makes it a bit simpler to figure out configuration problems
(like lack of touchscreen-size-{x,y} in the device tree.

I've kept the original subject to (hopefully) not break the series for
patchwork. All patches can be applied independently. Series is based on
next-20190208.

Changes from v2
* Add 'dt-bindings: input: Refer to touchscreen.txt for goodix ts'
* Add 'input: goodix: Print values in case of inconsistencies'
  (sent out separtely before, no comments so far)
* Collect 'Reviewed-By' on 'input: goodix - support Goodix gt5688'

Changes from v1
* Add tested board to commit message

Guido Günther (3):
  input: goodix - support Goodix gt5688
  dt-bindings: input: Refer to touchscreen.txt for goodix ts
  input: goodix: Print values in case of inconsistencies

 .../bindings/input/touchscreen/goodix.txt          | 14 +++++++++-----
 drivers/input/touchscreen/goodix.c                 |  6 +++++-
 2 files changed, 14 insertions(+), 6 deletions(-)

-- 
2.20.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v3 1/3] input: goodix - support Goodix gt5688
  2019-02-15 14:11 [PATCH v3 0/3] input: goodix - support Goodix gt5688 Guido Günther
@ 2019-02-15 14:11 ` Guido Günther
  2019-02-15 14:11 ` [PATCH v3 2/3] dt-bindings: input: Refer to touchscreen.txt for goodix ts Guido Günther
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Guido Günther @ 2019-02-15 14:11 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Mark Rutland, Bastien Nocera,
	Matthias Brugger, Guido Günther, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek

From what I've seen in vendor trees it's fine to treat this as gt1x¹.
Tested on the Purism Librem 5 Devkit (Rocktech JH057N00900 panel).

[1]: https://github.com/TadiT7/android_kernel_mtk-4.4/tree/master/drivers/input/touchscreen/mediatek/GT5688

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
---
 Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
 drivers/input/touchscreen/goodix.c                             | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index f7e95c52f3c7..57d3d8870a09 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -3,6 +3,7 @@ Device tree bindings for Goodix GT9xx series touchscreen controller
 Required properties:
 
  - compatible		: Should be "goodix,gt1151"
+				 or "goodix,gt5688"
 				 or "goodix,gt911"
 				 or "goodix,gt9110"
 				 or "goodix,gt912"
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index f2d9c2c41885..47b1ced41576 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -216,6 +216,7 @@ static const struct goodix_chip_data *goodix_get_chip_data(u16 id)
 {
 	switch (id) {
 	case 1151:
+	case 5688:
 		return &gt1x_chip_data;
 
 	case 911:
@@ -942,6 +943,7 @@ MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
 #ifdef CONFIG_OF
 static const struct of_device_id goodix_of_match[] = {
 	{ .compatible = "goodix,gt1151" },
+	{ .compatible = "goodix,gt5688" },
 	{ .compatible = "goodix,gt911" },
 	{ .compatible = "goodix,gt9110" },
 	{ .compatible = "goodix,gt912" },
-- 
2.20.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v3 2/3] dt-bindings: input: Refer to touchscreen.txt for goodix ts
  2019-02-15 14:11 [PATCH v3 0/3] input: goodix - support Goodix gt5688 Guido Günther
  2019-02-15 14:11 ` [PATCH v3 1/3] " Guido Günther
@ 2019-02-15 14:11 ` Guido Günther
  2019-02-15 14:11 ` [PATCH v3 3/3] input: goodix: Print values in case of inconsistencies Guido Günther
  2019-02-17  7:07 ` [PATCH v3 0/3] input: goodix - support Goodix gt5688 Dmitry Torokhov
  3 siblings, 0 replies; 5+ messages in thread
From: Guido Günther @ 2019-02-15 14:11 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Mark Rutland, Bastien Nocera,
	Matthias Brugger, Guido Günther, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek

Refer to touchscreen.txt for generic touch properties. This avoids
duplication and we're using the generic code to parse these in the
driver. While at that add touchscreen-size-{x,y} which are respected by
the driver as well.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
---
 .../bindings/input/touchscreen/goodix.txt           | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index 57d3d8870a09..8cf0b4d38a7e 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -19,11 +19,14 @@ Optional properties:
  - irq-gpios		: GPIO pin used for IRQ. The driver uses the
 			  interrupt gpio pin as output to reset the device.
  - reset-gpios		: GPIO pin used for reset
-
- - touchscreen-inverted-x  : X axis is inverted (boolean)
- - touchscreen-inverted-y  : Y axis is inverted (boolean)
- - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
-                             (swapping is done after inverting the axis)
+ - touchscreen-inverted-x
+ - touchscreen-inverted-y
+ - touchscreen-size-x
+ - touchscreen-size-y
+ - touchscreen-swapped-x-y
+
+The touchscreen-* properties are documented in touchscreen.txt in this
+directory.
 
 Example:
 
-- 
2.20.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v3 3/3] input: goodix: Print values in case of inconsistencies
  2019-02-15 14:11 [PATCH v3 0/3] input: goodix - support Goodix gt5688 Guido Günther
  2019-02-15 14:11 ` [PATCH v3 1/3] " Guido Günther
  2019-02-15 14:11 ` [PATCH v3 2/3] dt-bindings: input: Refer to touchscreen.txt for goodix ts Guido Günther
@ 2019-02-15 14:11 ` Guido Günther
  2019-02-17  7:07 ` [PATCH v3 0/3] input: goodix - support Goodix gt5688 Dmitry Torokhov
  3 siblings, 0 replies; 5+ messages in thread
From: Guido Günther @ 2019-02-15 14:11 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Mark Rutland, Bastien Nocera,
	Matthias Brugger, Guido Günther, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek

"Invalid config" gives little idea what's wrong. Print the values that
must not be 0 so we know which ones are off.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
---
 drivers/input/touchscreen/goodix.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 47b1ced41576..f57d82220a88 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -693,7 +693,9 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
 	touchscreen_parse_properties(ts->input_dev, true, &ts->prop);
 
 	if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) {
-		dev_err(&ts->client->dev, "Invalid config, using defaults\n");
+		dev_err(&ts->client->dev,
+			"Invalid config (%d, %d, %d), using defaults\n",
+			ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);
 		ts->prop.max_x = GOODIX_MAX_WIDTH - 1;
 		ts->prop.max_y = GOODIX_MAX_HEIGHT - 1;
 		ts->max_touch_num = GOODIX_MAX_CONTACTS;
-- 
2.20.1


_______________________________________________
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] 5+ messages in thread

* Re: [PATCH v3 0/3] input: goodix - support Goodix gt5688
  2019-02-15 14:11 [PATCH v3 0/3] input: goodix - support Goodix gt5688 Guido Günther
                   ` (2 preceding siblings ...)
  2019-02-15 14:11 ` [PATCH v3 3/3] input: goodix: Print values in case of inconsistencies Guido Günther
@ 2019-02-17  7:07 ` Dmitry Torokhov
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2019-02-17  7:07 UTC (permalink / raw)
  To: Guido Günther
  Cc: Mark Rutland, devicetree, linux-kernel, Rob Herring,
	linux-mediatek, Bastien Nocera, linux-input, Matthias Brugger,
	linux-arm-kernel

On Fri, Feb 15, 2019 at 03:11:50PM +0100, Guido Günther wrote:
> Besides the support for gt5688 two more minimal changes piled up so I'm
> folding these in here. One is a doc update for the goodix bindings, the
> other one makes it a bit simpler to figure out configuration problems
> (like lack of touchscreen-size-{x,y} in the device tree.
> 
> I've kept the original subject to (hopefully) not break the series for
> patchwork. All patches can be applied independently. Series is based on
> next-20190208.
> 
> Changes from v2
> * Add 'dt-bindings: input: Refer to touchscreen.txt for goodix ts'
> * Add 'input: goodix: Print values in case of inconsistencies'
>   (sent out separtely before, no comments so far)
> * Collect 'Reviewed-By' on 'input: goodix - support Goodix gt5688'

Applied the lot, thank you.

-- 
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] 5+ messages in thread

end of thread, other threads:[~2019-02-17  7:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 14:11 [PATCH v3 0/3] input: goodix - support Goodix gt5688 Guido Günther
2019-02-15 14:11 ` [PATCH v3 1/3] " Guido Günther
2019-02-15 14:11 ` [PATCH v3 2/3] dt-bindings: input: Refer to touchscreen.txt for goodix ts Guido Günther
2019-02-15 14:11 ` [PATCH v3 3/3] input: goodix: Print values in case of inconsistencies Guido Günther
2019-02-17  7:07 ` [PATCH v3 0/3] input: goodix - support Goodix gt5688 Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).