1 From e12af83fea018fd672140a2b77b6d96902112097 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 8 Nov 2023 15:50:39 +0000
4 Subject: [PATCH 0741/1085] input: edt-ft5x06: Include I2C details in names for
7 libinput uses the input device name alone. If you have two
8 identical input devices, then there is no way to differentiate
9 between them, and in the case of touchscreens that means no
10 way to associate them with the appropriate display device.
12 Add the I2C bus and address to the start of the input device
13 name so that the name is always unique within the system.
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
17 drivers/input/touchscreen/edt-ft5x06.c | 6 +++++-
18 1 file changed, 5 insertions(+), 1 deletion(-)
20 --- a/drivers/input/touchscreen/edt-ft5x06.c
21 +++ b/drivers/input/touchscreen/edt-ft5x06.c
23 #define TOUCH_EVENT_RESERVED 0x03
25 #define EDT_NAME_LEN 23
26 +#define EDT_NAME_PREFIX_LEN 8
27 #define EDT_SWITCH_MODE_RETRIES 10
28 #define EDT_SWITCH_MODE_DELAY 5 /* msec */
29 #define EDT_RAW_DATA_RETRIES 100
30 @@ -145,7 +146,7 @@ struct edt_ft5x06_ts_data {
32 unsigned int known_ids;
34 - char name[EDT_NAME_LEN];
35 + char name[EDT_NAME_PREFIX_LEN + EDT_NAME_LEN];
36 char fw_version[EDT_NAME_LEN];
39 @@ -937,6 +938,9 @@ static int edt_ft5x06_ts_identify(struct
40 char *model_name = tsdata->name;
41 char *fw_version = tsdata->fw_version;
43 + snprintf(model_name, EDT_NAME_PREFIX_LEN, "%s ", dev_name(&client->dev));
44 + model_name += strlen(model_name);
46 /* see what we find if we assume it is a M06 *
47 * if we get less than EDT_NAME_LEN, we don't want
48 * to have garbage in there