Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include I2C bus details in ft5x06 and goodix touch driver names #5703

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drivers/input/touchscreen/edt-ft5x06.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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
Expand Down Expand Up @@ -134,7 +135,7 @@ struct edt_ft5x06_ts_data {
int max_support_points;
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;

Expand Down Expand Up @@ -965,6 +966,9 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
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
Expand Down
5 changes: 4 additions & 1 deletion drivers/input/touchscreen/goodix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,10 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
return -ENOMEM;
}

ts->input_dev->name = "Goodix Capacitive TouchScreen";
snprintf(ts->name, GOODIX_NAME_MAX_LEN, "%s Goodix Capacitive TouchScreen",
dev_name(&ts->client->dev));

ts->input_dev->name = ts->name;
ts->input_dev->phys = "input/ts";
ts->input_dev->id.bustype = BUS_I2C;
ts->input_dev->id.vendor = 0x0416;
Expand Down
3 changes: 3 additions & 0 deletions drivers/input/touchscreen/goodix.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#define GOODIX_CONFIG_MAX_LENGTH 240
#define GOODIX_MAX_KEYS 7

#define GOODIX_NAME_MAX_LEN 38

enum goodix_irq_pin_access_method {
IRQ_PIN_ACCESS_NONE,
IRQ_PIN_ACCESS_GPIO,
Expand Down Expand Up @@ -91,6 +93,7 @@ struct goodix_ts_data {
enum gpiod_flags gpiod_rst_flags;
char id[GOODIX_ID_MAX_LEN + 1];
char cfg_name[64];
char name[GOODIX_NAME_MAX_LEN];
u16 version;
bool reset_controller_at_probe;
bool load_cfg_from_disk;
Expand Down