openwrt/target/linux/bcm27xx/patches-6.6/950-0741-input-edt-ft5x06-Include-I2C-details-in-names-for-th.patch
Álvaro Fernández Rojas 8c405cdccc bcm27xx: add 6.6 kernel patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.34..rpi-6.1.y

Some patches needed rebasing and, as usual, the applied and reverted, wireless
drivers, Github workflows, READMEs and defconfigs patches were removed.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-06-18 18:52:49 +02:00

49 lines
1.7 KiB
Diff

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