lkml.org 
[lkml]   [2019]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 17/63] Input: atmel_mxt_ts - allow input name to be specified in platform data
Date
From: Nick Dyer <nick.dyer@itdev.co.uk>

Android systems identify the input device and map to IDC file by using the
input device name. To avoid unnecessary deltas to the driver file, allow
this to be set from the platform data.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
(cherry picked from ndyer/linux/for-upstream commit cbf94a7bda754d2e1899d9f50313a0bccc91422d)
[gdavis: Resolve forward port conflicts due to applying upstream
commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform
data support").]
Signed-off-by: George G. Davis <george_davis@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
.../devicetree/bindings/input/atmel,maxtouch.txt | 2 ++
drivers/input/touchscreen/atmel_mxt_ts.c | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index 713ce870805c..d7db16920083 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -40,6 +40,8 @@ Optional properties for main touchpad device:
- atmel,cfg_name: Provide name of configuration file in OBP_RAW format. This
will be downloaded from the firmware loader on probe to the device.

+- atmel,input_name: Override name of input device from the default.
+
Example:

touch@4b {
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index a5ac2cc93f3f..4f335c3da994 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -336,6 +336,7 @@ struct mxt_data {
char *fw_name;
char *cfg_name;
const char *pcfg_name;
+ const char *input_name;

/* Cached parameters from object table */
u16 T5_address;
@@ -2407,7 +2408,11 @@ static int mxt_initialize_input_device(struct mxt_data *data)
if (!input_dev)
return -ENOMEM;

- input_dev->name = "Atmel maXTouch Touchscreen";
+ if (data->input_name)
+ input_dev->name = data->input_name;
+ else
+ input_dev->name = "Atmel maXTouch Touchscreen";
+
input_dev->phys = data->phys;
input_dev->id.bustype = BUS_I2C;
input_dev->dev.parent = dev;
@@ -3645,6 +3650,8 @@ static int mxt_parse_device_properties(struct mxt_data *data)

device_property_read_string(dev, "atmel,cfg_name", &data->pcfg_name);

+ device_property_read_string(dev, "atmel,input_name", &data->input_name);
+
if (device_property_present(dev, keymap_property)) {
n_keys = device_property_read_u32_array(dev, keymap_property,
NULL, 0);
--
2.19.2
\
 
 \ /
  Last update: 2019-08-16 10:41    [W:0.027 / U:15.696 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site