diff mbox series

[2/2] Input: st1232 - handle common DT bindings

Message ID 1548666345-24667-2-git-send-email-matthias.fend@wolfvision.net (mailing list archive)
State Changes Requested
Headers show
Series [1/2] dt-bindings: input: touchscreen: st1232i: reference common DT bindings | expand

Commit Message

Matthias Fend Jan. 28, 2019, 9:06 a.m. UTC
This is required to specify generic touchscreen properties via DT.

Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
---
 drivers/input/touchscreen/st1232.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dmitry Torokhov Jan. 28, 2019, 7:08 p.m. UTC | #1
Hi Matthias,

On Mon, Jan 28, 2019 at 09:06:08AM +0000, Matthias Fend wrote:
> This is required to specify generic touchscreen properties via DT.
> 
> Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
> ---
>  drivers/input/touchscreen/st1232.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
> index 11ff32c..ad617ac 100644
> --- a/drivers/input/touchscreen/st1232.c
> +++ b/drivers/input/touchscreen/st1232.c
> @@ -21,6 +21,7 @@
>  #include <linux/pm_qos.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
> +#include <linux/input/touchscreen.h>
>  
>  #define ST1232_TS_NAME	"st1232-ts"
>  
> @@ -195,6 +196,7 @@ static int st1232_ts_probe(struct i2c_client *client,
>  	input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0);
>  	input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0);
>  	input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0);
> +	touchscreen_parse_properties(input_dev, true, NULL);

Do you think you could complete the conversion and also use
touchscreen_report_pos() to support common transformations (swap,
invert)?

Thanks!
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 11ff32c..ad617ac 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -21,6 +21,7 @@ 
 #include <linux/pm_qos.h>
 #include <linux/slab.h>
 #include <linux/types.h>
+#include <linux/input/touchscreen.h>
 
 #define ST1232_TS_NAME	"st1232-ts"
 
@@ -195,6 +196,7 @@  static int st1232_ts_probe(struct i2c_client *client,
 	input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0);
 	input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0);
 	input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0);
+	touchscreen_parse_properties(input_dev, true, NULL);
 
 	error = devm_request_threaded_irq(&client->dev, client->irq,
 					  NULL, st1232_ts_irq_handler,