[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200325133334.19346-23-jiada_wang@mentor.com>
Date: Wed, 25 Mar 2020 06:33:01 -0700
From: Jiada Wang <jiada_wang@...tor.com>
To: <nick@...anahar.org>, <dmitry.torokhov@...il.com>,
<jikos@...nel.org>, <benjamin.tissoires@...hat.com>,
<bsz@...ihalf.com>, <rydberg@...math.org>
CC: <linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<erosca@...adit-jv.com>, <Andrew_Gabbasov@...tor.com>,
<jiada_wang@...tor.com>
Subject: [PATCH v9 22/55] Input: atmel_mxt_ts - allow input name to be specified in platform data
From: Nick Dyer <nick.dyer@...ev.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@...ev.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@...tor.com>
[jiada: Separate Documentation/ portion change to another commit]
Signed-off-by: Jiada Wang <jiada_wang@...tor.com>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index d1865250f492..dfc20c0ca0a5 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;
@@ -2412,7 +2413,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;
@@ -3653,6 +3658,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_count_u32(dev, keymap_property);
if (n_keys <= 0) {
--
2.17.1
Powered by blists - more mailing lists