* [PATCH v2 1/4] dt-bindings: input: touchscreen: add bindings for eeti touchscreen controller
2018-06-23 15:45 [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
@ 2018-06-23 15:45 ` Daniel Mack
2018-06-25 20:25 ` Rob Herring
2018-06-23 15:45 ` [PATCH v2 2/4] input: touchscreen: eeti: add device tree matching table Daniel Mack
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2018-06-23 15:45 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, Daniel Mack
Describe the bindings for EETI touchscreen controllers.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
.../bindings/input/touchscreen/eeti.txt | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/eeti.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/eeti.txt b/Documentation/devicetree/bindings/input/touchscreen/eeti.txt
new file mode 100644
index 000000000000..69c32c286ec7
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/eeti.txt
@@ -0,0 +1,31 @@
+Bindings for EETI touchscreen controller
+
+Required properties:
+- compatible: should be "eeti,exc3000-i2c"
+- reg: I2C address of the chip. Should be set to <0xa>
+- interrupts: interrupt to which the chip is connected
+
+Optional properties:
+- attn-gpios: A handle to a GPIO to check whether interrupt is still
+ latched. This is necessary for platforms that lack
+ support for level-triggered IRQs.
+
+The following optional properties described in touchscreen.txt are
+also supported:
+
+- touchscreen-inverted-x
+- touchscreen-inverted-y
+- touchscreen-swapped-x-y
+
+Example:
+
+i2c-master {
+ touchscreen@a {
+ compatible = "eeti,exc3000-i2c";
+ reg = <0xa>;
+ interrupt-parent = <&gpio>;
+ interrupts = <123 IRQ_TYPE_EDGE_RISING>;
+ attn-gpios = <&gpio 123 GPIO_ACTIVE_HIGH>;
+ };
+};
+
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] input: touchscreen: eeti: add device tree matching table
2018-06-23 15:45 [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
2018-06-23 15:45 ` [PATCH v2 1/4] dt-bindings: input: touchscreen: add bindings for eeti touchscreen controller Daniel Mack
@ 2018-06-23 15:45 ` Daniel Mack
2018-06-23 15:45 ` [PATCH v2 3/4] input: touchscreen: eeti: drop module parameters, parse DT properties Daniel Mack
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2018-06-23 15:45 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, Daniel Mack
Provide a match table so that the driver can be used in devicetree setups.
More properties are added in a later patch.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
drivers/input/touchscreen/eeti_ts.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 2facad75eb6d..cc4fd33f9d6d 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -32,6 +32,7 @@
#include <linux/i2c.h>
#include <linux/timer.h>
#include <linux/gpio/consumer.h>
+#include <linux/of.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
@@ -262,10 +263,18 @@ static const struct i2c_device_id eeti_ts_id[] = {
};
MODULE_DEVICE_TABLE(i2c, eeti_ts_id);
+#ifdef CONFIG_OF
+static const struct of_device_id of_eeti_ts_match[] = {
+ { .compatible = "eeti,exc3000-i2c", },
+ { }
+};
+#endif
+
static struct i2c_driver eeti_ts_driver = {
.driver = {
.name = "eeti_ts",
.pm = &eeti_ts_pm,
+ .of_match_table = of_match_ptr(of_eeti_ts_match),
},
.probe = eeti_ts_probe,
.id_table = eeti_ts_id,
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] input: touchscreen: eeti: drop module parameters, parse DT properties
2018-06-23 15:45 [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
2018-06-23 15:45 ` [PATCH v2 1/4] dt-bindings: input: touchscreen: add bindings for eeti touchscreen controller Daniel Mack
2018-06-23 15:45 ` [PATCH v2 2/4] input: touchscreen: eeti: add device tree matching table Daniel Mack
@ 2018-06-23 15:45 ` Daniel Mack
2018-06-23 15:45 ` [PATCH v2 4/4] input: touchscreen: eeti: fix link to documentation and email address in header Daniel Mack
2018-07-02 7:55 ` [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
4 siblings, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2018-06-23 15:45 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, Daniel Mack
The only user of this driver in mainline does not make use of the module
parameters, so let's remove them. All properties for this driver should be
set through DT or pdata.
Use touchscreen_parse_properties() to automatically set some of the common
touchscreen properties and derive the axis inversion through that.
And finally, use touchscreen_report_pos() to handle the DT properties
automatically instead of doing the inversion ourselves.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
drivers/input/touchscreen/eeti_ts.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index cc4fd33f9d6d..84561dfde7c4 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -25,9 +25,9 @@
*/
#include <linux/module.h>
-#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/input.h>
+#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/timer.h>
@@ -36,18 +36,11 @@
#include <linux/slab.h>
#include <asm/unaligned.h>
-static bool flip_x;
-module_param(flip_x, bool, 0644);
-MODULE_PARM_DESC(flip_x, "flip x coordinate");
-
-static bool flip_y;
-module_param(flip_y, bool, 0644);
-MODULE_PARM_DESC(flip_y, "flip y coordinate");
-
struct eeti_ts {
struct i2c_client *client;
struct input_dev *input;
struct gpio_desc *attn_gpio;
+ struct touchscreen_properties props;
bool running;
};
@@ -74,17 +67,10 @@ static void eeti_ts_report_event(struct eeti_ts *eeti, u8 *buf)
x >>= res - EETI_TS_BITDEPTH;
y >>= res - EETI_TS_BITDEPTH;
- if (flip_x)
- x = EETI_MAXVAL - x;
-
- if (flip_y)
- y = EETI_MAXVAL - y;
-
if (buf[0] & REPORT_BIT_HAS_PRESSURE)
input_report_abs(eeti->input, ABS_PRESSURE, buf[5]);
- input_report_abs(eeti->input, ABS_X, x);
- input_report_abs(eeti->input, ABS_Y, y);
+ touchscreen_report_pos(eeti->input, &eeti->props, x, y, false);
input_report_key(eeti->input, BTN_TOUCH, buf[0] & REPORT_BIT_PRESSED);
input_sync(eeti->input);
}
@@ -179,6 +165,8 @@ static int eeti_ts_probe(struct i2c_client *client,
input_set_abs_params(input, ABS_Y, 0, EETI_MAXVAL, 0, 0);
input_set_abs_params(input, ABS_PRESSURE, 0, 0xff, 0, 0);
+ touchscreen_parse_properties(input, false, &eeti->props);
+
input->name = client->name;
input->id.bustype = BUS_I2C;
input->open = eeti_ts_open;
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] input: touchscreen: eeti: fix link to documentation and email address in header
2018-06-23 15:45 [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
` (2 preceding siblings ...)
2018-06-23 15:45 ` [PATCH v2 3/4] input: touchscreen: eeti: drop module parameters, parse DT properties Daniel Mack
@ 2018-06-23 15:45 ` Daniel Mack
2018-07-02 7:55 ` [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
4 siblings, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2018-06-23 15:45 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, Daniel Mack
Keep the documentation link up-to-date in case anybody need to dive into it
again, and update email address while at it.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
drivers/input/touchscreen/eeti_ts.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 84561dfde7c4..7fe41965c5d1 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -1,9 +1,9 @@
/*
* Touch Screen driver for EETI's I2C connected touch screen panels
- * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
+ * Copyright (c) 2009,2018 Daniel Mack <daniel@zonque.org>
*
* See EETI's software guide for the protocol specification:
- * http://home.eeti.com.tw/web20/eg/guide.htm
+ * http://home.eeti.com.tw/documentation.html
*
* Based on migor_ts.c
* Copyright (c) 2008 Magnus Damm
@@ -271,5 +271,5 @@ static struct i2c_driver eeti_ts_driver = {
module_i2c_driver(eeti_ts_driver);
MODULE_DESCRIPTION("EETI Touchscreen driver");
-MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
+MODULE_AUTHOR("Daniel Mack <daniel@zonque.org>");
MODULE_LICENSE("GPL");
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups
2018-06-23 15:45 [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
` (3 preceding siblings ...)
2018-06-23 15:45 ` [PATCH v2 4/4] input: touchscreen: eeti: fix link to documentation and email address in header Daniel Mack
@ 2018-07-02 7:55 ` Daniel Mack
2018-07-04 15:47 ` Dmitry Torokhov
4 siblings, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2018-07-02 7:55 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree
Hi Dmitry,
On Saturday, June 23, 2018 05:45 PM, Daniel Mack wrote:
> This is v2 of the series that brings DT bindings to the eeti driver and
> cleans up the code a bit.
Is this set good to go in or should I repost it with Rob's Reviewed-by
in 1/4?
Thanks,
Daniel
>
> Changelog:
>
> v1 → v2:
> * dropped module parameters
> * use touchscreen_report_pos() and drop some code for that
> * squashes 4/5 and 5/5 of v1
>
> Daniel Mack (4):
> dt-bindings: input: touchscreen: add bindings for eeti touchscreen
> controller
> input: touchscreen: eeti: add device tree matching table
> input: touchscreen: eeti: drop module parameters, parse DT properties
> input: touchscreen: eeti: fix link to documentation and email address
> in header
>
> .../bindings/input/touchscreen/eeti.txt | 31 ++++++++++++++++
> drivers/input/touchscreen/eeti_ts.c | 37 +++++++++----------
> 2 files changed, 48 insertions(+), 20 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/input/touchscreen/eeti.txt
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups
2018-07-02 7:55 ` [PATCH v2 0/4] input: touchscreen: eeti: DT bindings and clean-ups Daniel Mack
@ 2018-07-04 15:47 ` Dmitry Torokhov
0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2018-07-04 15:47 UTC (permalink / raw)
To: Daniel Mack; +Cc: robh+dt, linux-input, devicetree
On Mon, Jul 02, 2018 at 09:55:25AM +0200, Daniel Mack wrote:
> Hi Dmitry,
>
> On Saturday, June 23, 2018 05:45 PM, Daniel Mack wrote:
> > This is v2 of the series that brings DT bindings to the eeti driver and
> > cleans up the code a bit.
>
> Is this set good to go in or should I repost it with Rob's Reviewed-by in
> 1/4?
No, I applied the lot, thanks.
>
>
> Thanks,
> Daniel
>
>
> >
> > Changelog:
> >
> > v1 → v2:
> > * dropped module parameters
> > * use touchscreen_report_pos() and drop some code for that
> > * squashes 4/5 and 5/5 of v1
> >
> > Daniel Mack (4):
> > dt-bindings: input: touchscreen: add bindings for eeti touchscreen
> > controller
> > input: touchscreen: eeti: add device tree matching table
> > input: touchscreen: eeti: drop module parameters, parse DT properties
> > input: touchscreen: eeti: fix link to documentation and email address
> > in header
> >
> > .../bindings/input/touchscreen/eeti.txt | 31 ++++++++++++++++
> > drivers/input/touchscreen/eeti_ts.c | 37 +++++++++----------
> > 2 files changed, 48 insertions(+), 20 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/input/touchscreen/eeti.txt
> >
>
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread