Commit 16ab4f43 authored by Matthias Fend's avatar Matthias Fend Committed by Dmitry Torokhov

Input: st1232 - handle common DT bindings

This is required to specify generic touchscreen properties via DT.
Signed-off-by: default avatarMatthias Fend <matthias.fend@wolfvision.net>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 6b65189a
...@@ -10,6 +10,8 @@ Required properties: ...@@ -10,6 +10,8 @@ Required properties:
Optional properties: Optional properties:
- gpios: a phandle to the reset GPIO - gpios: a phandle to the reset GPIO
For additional optional properties see: touchscreen.txt
Example: Example:
i2c@00000000 { i2c@00000000 {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/input/touchscreen.h>
#define ST1232_TS_NAME "st1232-ts" #define ST1232_TS_NAME "st1232-ts"
#define ST1633_TS_NAME "st1633-ts" #define ST1633_TS_NAME "st1633-ts"
...@@ -43,6 +44,7 @@ struct st_chip_info { ...@@ -43,6 +44,7 @@ struct st_chip_info {
struct st1232_ts_data { struct st1232_ts_data {
struct i2c_client *client; struct i2c_client *client;
struct input_dev *input_dev; struct input_dev *input_dev;
struct touchscreen_properties prop;
struct dev_pm_qos_request low_latency_req; struct dev_pm_qos_request low_latency_req;
struct gpio_desc *reset_gpio; struct gpio_desc *reset_gpio;
const struct st_chip_info *chip_info; const struct st_chip_info *chip_info;
...@@ -112,8 +114,8 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id) ...@@ -112,8 +114,8 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR,
finger[i].t); finger[i].t);
input_report_abs(input_dev, ABS_MT_POSITION_X, finger[i].x); touchscreen_report_pos(input_dev, &ts->prop,
input_report_abs(input_dev, ABS_MT_POSITION_Y, finger[i].y); finger[i].x, finger[i].y, true);
input_mt_sync(input_dev); input_mt_sync(input_dev);
count++; count++;
} }
...@@ -243,6 +245,8 @@ static int st1232_ts_probe(struct i2c_client *client, ...@@ -243,6 +245,8 @@ static int st1232_ts_probe(struct i2c_client *client,
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
0, ts->chip_info->max_y, 0, 0); 0, ts->chip_info->max_y, 0, 0);
touchscreen_parse_properties(input_dev, true, &ts->prop);
error = devm_request_threaded_irq(&client->dev, client->irq, error = devm_request_threaded_irq(&client->dev, client->irq,
NULL, st1232_ts_irq_handler, NULL, st1232_ts_irq_handler,
IRQF_ONESHOT, IRQF_ONESHOT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment