summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2022-09-14 16:14:27 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-09-16 15:38:51 +0200
commit770a71b23c29c28ed467af488821b4b144ef6953 (patch)
treed08931418ba73a995fa89b4d7bf8db6b038f401c /drivers/input
parentInput: auo-pixcir-ts - do not force rising edge interrupt trigger (diff)
downloadlinux-770a71b23c29c28ed467af488821b4b144ef6953.tar.xz
linux-770a71b23c29c28ed467af488821b4b144ef6953.zip
Input: auo-pixcir-ts - switch to using generic device properties
Let's use generic device properties API instead of OF-specific one. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20220914141428.2201784-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/auo-pixcir-ts.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 4960a50f59ea..2deae5a6823a 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -22,6 +22,7 @@
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
+#include <linux/property.h>
/*
* Coordinate calculation:
@@ -474,33 +475,6 @@ unlock:
static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
auo_pixcir_suspend, auo_pixcir_resume);
-#ifdef CONFIG_OF
-static int auo_pixcir_parse_dt(struct device *dev, struct auo_pixcir_ts *ts)
-{
- struct device_node *np = dev->of_node;
-
- if (!np)
- return -ENOENT;
-
- if (of_property_read_u32(np, "x-size", &ts->x_max)) {
- dev_err(dev, "failed to get x-size property\n");
- return -EINVAL;
- }
-
- if (of_property_read_u32(np, "y-size", &ts->y_max)) {
- dev_err(dev, "failed to get y-size property\n");
- return -EINVAL;
- }
-
- return 0;
-}
-#else
-static int auo_pixcir_parse_dt(struct device *dev, struct auo_pixcir_ts *ts)
-{
- return -EINVAL;
-}
-#endif
-
static void auo_pixcir_reset(void *data)
{
struct auo_pixcir_ts *ts = data;
@@ -535,9 +509,15 @@ static int auo_pixcir_probe(struct i2c_client *client,
snprintf(ts->phys, sizeof(ts->phys),
"%s/input0", dev_name(&client->dev));
- error = auo_pixcir_parse_dt(&client->dev, ts);
- if (error)
- return error;
+ if (device_property_read_u32(&client->dev, "x-size", &ts->x_max)) {
+ dev_err(&client->dev, "failed to get x-size property\n");
+ return -EINVAL;
+ }
+
+ if (device_property_read_u32(&client->dev, "y-size", &ts->y_max)) {
+ dev_err(&client->dev, "failed to get y-size property\n");
+ return -EINVAL;
+ }
input_dev->name = "AUO-Pixcir touchscreen";
input_dev->phys = ts->phys;