Skip to content

Commit 38a38f5

Browse files
committed
Input: silead - Always support 10 fingers
When support for Silead touchscreens was orginal added some touchscreens with older firmware versions only supported 5 fingers and this was made the default requiring the setting of a "silead,max-fingers=10" uint32 device-property for all touchscreen models which do support 10 fingers. There are very few models with the old 5 finger fw, so in practice the setting of the "silead,max-fingers=10" is boilerplate which needs to be copy and pasted to every touchscreen config. Reporting that 10 fingers are supported on devices which only support 5 fingers doesn't cause any problems for userspace in practice, since at max 4 finger gestures are supported anyways. Drop the max_fingers configuration and simply always assume 10 fingers. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3050052 commit 38a38f5

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

drivers/input/touchscreen/silead.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ struct silead_ts_data {
7171
struct regulator_bulk_data regulators[2];
7272
char fw_name[64];
7373
struct touchscreen_properties prop;
74-
u32 max_fingers;
7574
u32 chip_id;
7675
struct input_mt_pos pos[SILEAD_MAX_FINGERS];
7776
int slots[SILEAD_MAX_FINGERS];
@@ -136,7 +135,7 @@ static int silead_ts_request_input_dev(struct silead_ts_data *data)
136135
touchscreen_parse_properties(data->input, true, &data->prop);
137136
silead_apply_efi_fw_min_max(data);
138137

139-
input_mt_init_slots(data->input, data->max_fingers,
138+
input_mt_init_slots(data->input, SILEAD_MAX_FINGERS,
140139
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED |
141140
INPUT_MT_TRACK);
142141

@@ -256,10 +255,10 @@ static void silead_ts_read_data(struct i2c_client *client)
256255
return;
257256
}
258257

259-
if (buf[0] > data->max_fingers) {
258+
if (buf[0] > SILEAD_MAX_FINGERS) {
260259
dev_warn(dev, "More touches reported then supported %d > %d\n",
261-
buf[0], data->max_fingers);
262-
buf[0] = data->max_fingers;
260+
buf[0], SILEAD_MAX_FINGERS);
261+
buf[0] = SILEAD_MAX_FINGERS;
263262
}
264263

265264
if (silead_ts_handle_pen_data(data, buf))
@@ -315,7 +314,6 @@ static void silead_ts_read_data(struct i2c_client *client)
315314

316315
static int silead_ts_init(struct i2c_client *client)
317316
{
318-
struct silead_ts_data *data = i2c_get_clientdata(client);
319317
int error;
320318

321319
error = i2c_smbus_write_byte_data(client, SILEAD_REG_RESET,
@@ -325,7 +323,7 @@ static int silead_ts_init(struct i2c_client *client)
325323
usleep_range(SILEAD_CMD_SLEEP_MIN, SILEAD_CMD_SLEEP_MAX);
326324

327325
error = i2c_smbus_write_byte_data(client, SILEAD_REG_TOUCH_NR,
328-
data->max_fingers);
326+
SILEAD_MAX_FINGERS);
329327
if (error)
330328
goto i2c_write_err;
331329
usleep_range(SILEAD_CMD_SLEEP_MIN, SILEAD_CMD_SLEEP_MAX);
@@ -591,13 +589,6 @@ static void silead_ts_read_props(struct i2c_client *client)
591589
const char *str;
592590
int error;
593591

594-
error = device_property_read_u32(dev, "silead,max-fingers",
595-
&data->max_fingers);
596-
if (error) {
597-
dev_dbg(dev, "Max fingers read error %d\n", error);
598-
data->max_fingers = 5; /* Most devices handle up-to 5 fingers */
599-
}
600-
601592
error = device_property_read_string(dev, "firmware-name", &str);
602593
if (!error)
603594
snprintf(data->fw_name, sizeof(data->fw_name),

0 commit comments

Comments
 (0)