diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-08-14 21:26:07 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-08-14 21:26:07 -0700 |
| commit | b4d85f863e5a6f1fa01b186001af0f68f4f5239e (patch) | |
| tree | 4991b5a24f0d613d6f9675794d5a905717cab14d /drivers/input/touchscreen | |
| parent | 062dc4693e2c10d77de06f61e6f3faf37c0a8383 (diff) | |
| parent | 9a29ee801f525bcad71fea021bfe2a030885c8df (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 7.3 merge window.
Diffstat (limited to 'drivers/input/touchscreen')
| -rw-r--r-- | drivers/input/touchscreen/cyttsp5.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/elo.c | 4 | ||||
| -rw-r--r-- | drivers/input/touchscreen/himax_hx852x.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/hynitron_cstxxx.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/ili210x.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/inexio.c | 4 | ||||
| -rw-r--r-- | drivers/input/touchscreen/iqs5xx.c | 4 | ||||
| -rw-r--r-- | drivers/input/touchscreen/mms114.c | 299 | ||||
| -rw-r--r-- | drivers/input/touchscreen/msg2638.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/resistive-adc-touch.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/sur40.c | 4 | ||||
| -rw-r--r-- | drivers/input/touchscreen/tsc2007_core.c | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/wacom_w8001.c | 17 |
13 files changed, 186 insertions, 153 deletions
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c index 73c397e44da4..9266c07314be 100644 --- a/drivers/input/touchscreen/cyttsp5.c +++ b/drivers/input/touchscreen/cyttsp5.c @@ -18,7 +18,6 @@ #include <linux/input/touchscreen.h> #include <linux/interrupt.h> #include <linux/i2c.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/unaligned.h> diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index 6814d5789b6f..97aeec7ef709 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c @@ -257,7 +257,7 @@ static int elo_command_10(struct elo *elo, unsigned char *packet) static int elo_setup_10(struct elo *elo) { - static const char *elo_types[] = { "Accu", "Dura", "Intelli", "Carroll" }; + static const char * const elo_types[] = { "Accu", "Dura", "Intelli", "Carroll" }; struct input_dev *dev = elo->dev; unsigned char packet[ELO10_PACKET_LEN] = { ELO10_ID_CMD }; @@ -273,7 +273,7 @@ static int elo_setup_10(struct elo *elo) dev_info(&elo->serio->dev, "%sTouch touchscreen, fw: %02x.%02x, features: 0x%02x, controller: 0x%02x\n", - elo_types[(packet[1] -'0') & 0x03], + elo_types[(packet[1] - '0') & 0x03], packet[5], packet[4], packet[3], packet[7]); return 0; diff --git a/drivers/input/touchscreen/himax_hx852x.c b/drivers/input/touchscreen/himax_hx852x.c index 83c60e137a55..1c488a63e53b 100644 --- a/drivers/input/touchscreen/himax_hx852x.c +++ b/drivers/input/touchscreen/himax_hx852x.c @@ -16,7 +16,6 @@ #include <linux/input/touchscreen.h> #include <linux/interrupt.h> #include <linux/kernel.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/of.h> #include <linux/regulator/consumer.h> diff --git a/drivers/input/touchscreen/hynitron_cstxxx.c b/drivers/input/touchscreen/hynitron_cstxxx.c index af66d91848b3..49fb35c830dc 100644 --- a/drivers/input/touchscreen/hynitron_cstxxx.c +++ b/drivers/input/touchscreen/hynitron_cstxxx.c @@ -19,7 +19,6 @@ #include <linux/input.h> #include <linux/input/mt.h> #include <linux/input/touchscreen.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/property.h> #include <linux/unaligned.h> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index 66ada7ffbc80..3479698f55e3 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -8,7 +8,6 @@ #include <linux/input/mt.h> #include <linux/input/touchscreen.h> #include <linux/interrupt.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/sizes.h> #include <linux/slab.h> diff --git a/drivers/input/touchscreen/inexio.c b/drivers/input/touchscreen/inexio.c index ac3836ff2a30..2fa04eaec292 100644 --- a/drivers/input/touchscreen/inexio.c +++ b/drivers/input/touchscreen/inexio.c @@ -81,7 +81,9 @@ static irqreturn_t inexio_interrupt(struct serio *serio, if (INEXIO_RESPONSE_BEGIN_BYTE&pinexio->data[0]) inexio_process_data(pinexio); else - printk(KERN_DEBUG "inexio.c: unknown/unsynchronized data from device, byte %x\n",pinexio->data[0]); + dev_dbg(&serio->dev, + "unknown/unsynchronized data from device, byte %x\n", + pinexio->data[0]); return IRQ_HANDLED; } diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index b9bbe8b3eab8..88dcf72618df 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -24,7 +24,6 @@ #include <linux/input/touchscreen.h> #include <linux/interrupt.h> #include <linux/kernel.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/unaligned.h> @@ -786,7 +785,8 @@ static int iqs5xx_fw_file_parse(struct i2c_client *client, switch (rec_type) { case IQS5XX_REC_TYPE_DATA: if (rec_addr < IQS5XX_CHKSM || - rec_addr > IQS5XX_PMAP_END) { + rec_addr > IQS5XX_PMAP_END || + rec_len > IQS5XX_PMAP_END + 1 - rec_addr) { dev_err(&client->dev, "Invalid address at record %u\n", rec_num); diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 5cef97246a15..27911a9f4e9e 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -4,6 +4,8 @@ // Copyright (c) 2012 Samsung Electronics Co., Ltd. // Author: Joonyoung Shim <jy0922.shim@samsung.com> +#include <linux/bitfield.h> +#include <linux/bits.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/of.h> @@ -52,21 +54,13 @@ #define MMS114_TYPE_TOUCHSCREEN 1 #define MMS114_TYPE_TOUCHKEY 2 -enum mms_type { - TYPE_MMS114 = 114, - TYPE_MMS134S = 134, - TYPE_MMS136 = 136, - TYPE_MMS152 = 152, - TYPE_MMS345L = 345, -}; - struct mms114_data { + const struct mms_chip *chip; struct i2c_client *client; struct input_dev *input_dev; struct regulator *core_reg; struct regulator *io_reg; struct touchscreen_properties props; - enum mms_type type; unsigned int contact_threshold; unsigned int moving_threshold; @@ -77,9 +71,23 @@ struct mms114_data { u8 cache_mode_control; }; +struct mms_chip { + const char *name; + int event_size; + bool has_config_regs; + int (*get_version)(struct mms114_data *data); +}; + +#define MMS114_FLAGS_ID_MASK GENMASK(3, 0) +#define MMS114_FLAGS_TYPE_MASK GENMASK(6, 5) +#define MMS114_FLAGS_PRESSED_MASK BIT(7) + +#define MMS114_XY_HI_X_MASK GENMASK(3, 0) +#define MMS114_XY_HI_Y_MASK GENMASK(7, 4) + struct mms114_touch { - u8 id:4, reserved_bit4:1, type:2, pressed:1; - u8 x_hi:4, y_hi:4; + u8 flags; + u8 xy_hi; u8 x_lo; u8 y_lo; u8 width; @@ -87,16 +95,16 @@ struct mms114_touch { u8 reserved[2]; } __packed; -static int __mms114_read_reg(struct mms114_data *data, unsigned int reg, - unsigned int len, u8 *val) +static int __mms114_read_reg(struct mms114_data *data, u8 reg, + unsigned int len, void *val) { struct i2c_client *client = data->client; struct i2c_msg xfer[2]; - u8 buf = reg & 0xff; + u8 buf = reg; int error; - if (reg <= MMS114_MODE_CONTROL && reg + len > MMS114_MODE_CONTROL) - BUG(); + if (WARN_ON(reg <= MMS114_MODE_CONTROL && reg + len > MMS114_MODE_CONTROL)) + return -EINVAL; /* Write register */ xfer[0].addr = client->addr; @@ -116,12 +124,12 @@ static int __mms114_read_reg(struct mms114_data *data, unsigned int reg, "%s: i2c transfer failed (%d)\n", __func__, error); return error < 0 ? error : -EIO; } - udelay(MMS114_I2C_DELAY); + usleep_range(MMS114_I2C_DELAY, MMS114_I2C_DELAY + 50); return 0; } -static int mms114_read_reg(struct mms114_data *data, unsigned int reg) +static int mms114_read_reg(struct mms114_data *data, u8 reg) { u8 val; int error; @@ -133,15 +141,14 @@ static int mms114_read_reg(struct mms114_data *data, unsigned int reg) return error < 0 ? error : val; } -static int mms114_write_reg(struct mms114_data *data, unsigned int reg, - unsigned int val) +static int mms114_write_reg(struct mms114_data *data, u8 reg, u8 val) { struct i2c_client *client = data->client; u8 buf[2]; int error; - buf[0] = reg & 0xff; - buf[1] = val & 0xff; + buf[0] = reg; + buf[1] = val; error = i2c_master_send(client, buf, 2); if (error != 2) { @@ -149,7 +156,7 @@ static int mms114_write_reg(struct mms114_data *data, unsigned int reg, "%s: i2c send failed (%d)\n", __func__, error); return error < 0 ? error : -EIO; } - udelay(MMS114_I2C_DELAY); + usleep_range(MMS114_I2C_DELAY, MMS114_I2C_DELAY + 50); if (reg == MMS114_MODE_CONTROL) data->cache_mode_control = val; @@ -157,32 +164,119 @@ static int mms114_write_reg(struct mms114_data *data, unsigned int reg, return 0; } +static int mms114_get_version(struct mms114_data *data) +{ + struct device *dev = &data->client->dev; + u8 buf[6]; + int error; + + error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf); + if (error) + return error; + + dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n", + buf[0], buf[1], buf[3]); + return 0; +} + +static int mms152_get_version(struct mms114_data *data) +{ + struct device *dev = &data->client->dev; + u8 buf[3]; + int group; + int error; + + error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); + if (error) + return error; + + group = i2c_smbus_read_byte_data(data->client, MMS152_COMPAT_GROUP); + if (group < 0) + return group; + + dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x, Compat group: %c\n", + buf[0], buf[1], buf[2], group); + return 0; +} + +static int mms345l_get_version(struct mms114_data *data) +{ + struct device *dev = &data->client->dev; + u8 buf[3]; + int error; + + error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); + if (error) + return error; + + dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n", + buf[0], buf[1], buf[2]); + return 0; +} + +static const struct mms_chip mms114_descriptor = { + .name = "MMS114", + .event_size = MMS114_EVENT_SIZE, + .has_config_regs = true, + .get_version = mms114_get_version, +}; + +static const struct mms_chip mms134s_descriptor = { + .name = "MMS134S", + .event_size = MMS136_EVENT_SIZE, + .has_config_regs = true, + .get_version = mms114_get_version, +}; + +static const struct mms_chip mms136_descriptor = { + .name = "MMS136", + .event_size = MMS136_EVENT_SIZE, + .has_config_regs = true, + .get_version = mms114_get_version, +}; + +static const struct mms_chip mms152_descriptor = { + .name = "MMS152", + .event_size = MMS114_EVENT_SIZE, + .has_config_regs = false, + .get_version = mms152_get_version, +}; + +static const struct mms_chip mms345l_descriptor = { + .name = "MMS345L", + .event_size = MMS114_EVENT_SIZE, + .has_config_regs = false, + .get_version = mms345l_get_version, +}; + static void mms114_process_mt(struct mms114_data *data, struct mms114_touch *touch) { struct i2c_client *client = data->client; struct input_dev *input_dev = data->input_dev; - unsigned int id; + unsigned int id = FIELD_GET(MMS114_FLAGS_ID_MASK, touch->flags); + unsigned int type = FIELD_GET(MMS114_FLAGS_TYPE_MASK, touch->flags); + bool pressed = FIELD_GET(MMS114_FLAGS_PRESSED_MASK, touch->flags); unsigned int x; unsigned int y; - if (touch->id == 0 || touch->id > MMS114_MAX_TOUCH) { - dev_err(&client->dev, "Wrong touch id (%d)\n", touch->id); + if (id == 0 || id > MMS114_MAX_TOUCH) { + dev_err(&client->dev, "Wrong touch id (%d)\n", id); return; } - id = touch->id - 1; - x = touch->x_lo | touch->x_hi << 8; - y = touch->y_lo | touch->y_hi << 8; + id--; + x = touch->x_lo | FIELD_GET(MMS114_XY_HI_X_MASK, touch->xy_hi) << 8; + y = touch->y_lo | FIELD_GET(MMS114_XY_HI_Y_MASK, touch->xy_hi) << 8; dev_dbg(&client->dev, "id: %d, type: %d, pressed: %d, x: %d, y: %d, width: %d, strength: %d\n", - id, touch->type, touch->pressed, + id, type, pressed, x, y, touch->width, touch->strength); input_mt_slot(input_dev, id); - input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, touch->pressed); + input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, pressed); - if (touch->pressed) { + if (pressed) { touchscreen_report_pos(input_dev, &data->props, x, y, true); input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, touch->width); input_report_abs(input_dev, ABS_MT_PRESSURE, touch->strength); @@ -195,21 +289,23 @@ static void mms114_process_touchkey(struct mms114_data *data, struct i2c_client *client = data->client; struct input_dev *input_dev = data->input_dev; unsigned int keycode_id; + unsigned int id = FIELD_GET(MMS114_FLAGS_ID_MASK, touch->flags); + bool pressed = FIELD_GET(MMS114_FLAGS_PRESSED_MASK, touch->flags); - if (touch->id == 0) + if (id == 0) return; - if (touch->id > data->num_keycodes) { + if (id > data->num_keycodes) { dev_err(&client->dev, "Wrong touch id for touchkey (%d)\n", - touch->id); + id); return; } - keycode_id = touch->id - 1; + keycode_id = id - 1; dev_dbg(&client->dev, "keycode id: %d, pressed: %d\n", keycode_id, - touch->pressed); + pressed); - input_report_key(input_dev, data->keycodes[keycode_id], touch->pressed); + input_report_key(input_dev, data->keycodes[keycode_id], pressed); } static irqreturn_t mms114_interrupt(int irq, void *dev_id) @@ -218,8 +314,8 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id) struct i2c_client *client = data->client; struct mms114_touch touch[MMS114_MAX_TOUCH]; struct mms114_touch *t; + int event_size = data->chip->event_size; int packet_size; - int event_size; int touch_size; int index; int error; @@ -234,23 +330,17 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id) goto out; } - /* MMS136 has slightly different event size */ - if (data->type == TYPE_MMS134S || data->type == TYPE_MMS136) - event_size = MMS136_EVENT_SIZE; - else - event_size = MMS114_EVENT_SIZE; - touch_size = packet_size / event_size; - error = __mms114_read_reg(data, MMS114_INFORMATION, packet_size, - (u8 *)touch); - if (error < 0) + error = __mms114_read_reg(data, MMS114_INFORMATION, packet_size, touch); + if (error) goto out; for (index = 0; index < touch_size; index++) { t = (struct mms114_touch *)((u8 *)touch + index * event_size); + unsigned int type = FIELD_GET(MMS114_FLAGS_TYPE_MASK, t->flags); - switch (t->type) { + switch (type) { case MMS114_TYPE_TOUCHSCREEN: mms114_process_mt(data, t); break; @@ -261,7 +351,7 @@ static irqreturn_t mms114_interrupt(int irq, void *dev_id) default: dev_err(&client->dev, "Wrong touch type (%d)\n", - t->type); + type); break; } } @@ -290,65 +380,17 @@ static int mms114_set_active(struct mms114_data *data, bool active) return mms114_write_reg(data, MMS114_MODE_CONTROL, val); } -static int mms114_get_version(struct mms114_data *data) -{ - struct device *dev = &data->client->dev; - u8 buf[6]; - int group; - int error; - - switch (data->type) { - case TYPE_MMS345L: - error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); - if (error) - return error; - - dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n", - buf[0], buf[1], buf[2]); - break; - - case TYPE_MMS152: - error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); - if (error) - return error; - - group = i2c_smbus_read_byte_data(data->client, - MMS152_COMPAT_GROUP); - if (group < 0) - return group; - - dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x, Compat group: %c\n", - buf[0], buf[1], buf[2], group); - break; - - case TYPE_MMS114: - case TYPE_MMS134S: - case TYPE_MMS136: - error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf); - if (error) - return error; - - dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n", - buf[0], buf[1], buf[3]); - break; - } - - return 0; -} - static int mms114_setup_regs(struct mms114_data *data) { const struct touchscreen_properties *props = &data->props; int val; int error; - error = mms114_get_version(data); - if (error < 0) + error = data->chip->get_version(data); + if (error) return error; - /* MMS114, MMS134S and MMS136 have configuration and power on registers */ - if (data->type != TYPE_MMS114 && data->type != TYPE_MMS134S && - data->type != TYPE_MMS136) + if (!data->chip->has_config_regs) return 0; error = mms114_set_active(data, true); @@ -366,21 +408,21 @@ static int mms114_setup_regs(struct mms114_data *data) if (error < 0) return error; - val = props->max_x & 0xff; + val = props->max_y & 0xff; error = mms114_write_reg(data, MMS114_Y_RESOLUTION, val); if (error < 0) return error; if (data->contact_threshold) { error = mms114_write_reg(data, MMS114_CONTACT_THRESHOLD, - data->contact_threshold); + data->contact_threshold); if (error < 0) return error; } if (data->moving_threshold) { error = mms114_write_reg(data, MMS114_MOVING_THRESHOLD, - data->moving_threshold); + data->moving_threshold); if (error < 0) return error; } @@ -466,9 +508,9 @@ static int mms114_parse_legacy_bindings(struct mms114_data *data) } device_property_read_u32(dev, "contact-threshold", - &data->contact_threshold); + &data->contact_threshold); device_property_read_u32(dev, "moving-threshold", - &data->moving_threshold); + &data->moving_threshold); if (device_property_read_bool(dev, "x-invert")) props->invert_x = true; @@ -484,7 +526,6 @@ static int mms114_probe(struct i2c_client *client) { struct mms114_data *data; struct input_dev *input_dev; - const void *match_data; int error; int i; @@ -504,12 +545,10 @@ static int mms114_probe(struct i2c_client *client) data->client = client; data->input_dev = input_dev; - match_data = device_get_match_data(&client->dev); - if (!match_data) + data->chip = i2c_get_match_data(client); + if (!data->chip) return -EINVAL; - data->type = (enum mms_type)match_data; - data->num_keycodes = device_property_count_u32(&client->dev, "linux,keycodes"); if (data->num_keycodes == -EINVAL) { @@ -521,7 +560,7 @@ static int mms114_probe(struct i2c_client *client) return data->num_keycodes; } else if (data->num_keycodes > MMS114_MAX_TOUCHKEYS) { dev_warn(&client->dev, - "Found %d linux,keycodes but max is %d, ignoring the rest\n", + "Found %d linux,keycodes but max is %d, ignoring the rest\n", data->num_keycodes, MMS114_MAX_TOUCHKEYS); data->num_keycodes = MMS114_MAX_TOUCHKEYS; } @@ -566,8 +605,7 @@ static int mms114_probe(struct i2c_client *client) 0, data->props.max_y, 0, 0); } - if (data->type == TYPE_MMS114 || data->type == TYPE_MMS134S || - data->type == TYPE_MMS136) { + if (data->chip->has_config_regs) { /* * The firmware handles movement and pressure fuzz, so * don't duplicate that in software. @@ -582,8 +620,8 @@ static int mms114_probe(struct i2c_client *client) } input_dev->name = devm_kasprintf(&client->dev, GFP_KERNEL, - "MELFAS MMS%d Touchscreen", - data->type); + "MELFAS %s Touchscreen", + data->chip->name); if (!input_dev->name) return -ENOMEM; @@ -679,29 +717,22 @@ static int mms114_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume); static const struct i2c_device_id mms114_id[] = { - { .name = "mms114" }, + { .name = "mms114", .driver_data = (kernel_ulong_t)&mms114_descriptor }, + { .name = "mms134s", .driver_data = (kernel_ulong_t)&mms134s_descriptor }, + { .name = "mms136", .driver_data = (kernel_ulong_t)&mms136_descriptor }, + { .name = "mms152", .driver_data = (kernel_ulong_t)&mms152_descriptor }, + { .name = "mms345l", .driver_data = (kernel_ulong_t)&mms345l_descriptor }, { } }; MODULE_DEVICE_TABLE(i2c, mms114_id); #ifdef CONFIG_OF static const struct of_device_id mms114_dt_match[] = { - { - .compatible = "melfas,mms114", - .data = (void *)TYPE_MMS114, - }, { - .compatible = "melfas,mms134s", - .data = (void *)TYPE_MMS134S, - }, { - .compatible = "melfas,mms136", - .data = (void *)TYPE_MMS136, - }, { - .compatible = "melfas,mms152", - .data = (void *)TYPE_MMS152, - }, { - .compatible = "melfas,mms345l", - .data = (void *)TYPE_MMS345L, - }, + { .compatible = "melfas,mms114", .data = &mms114_descriptor }, + { .compatible = "melfas,mms134s", .data = &mms134s_descriptor }, + { .compatible = "melfas,mms136", .data = &mms136_descriptor }, + { .compatible = "melfas,mms152", .data = &mms152_descriptor }, + { .compatible = "melfas,mms345l", .data = &mms345l_descriptor }, { } }; MODULE_DEVICE_TABLE(of, mms114_dt_match); @@ -722,4 +753,4 @@ module_i2c_driver(mms114_driver); /* Module information */ MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>"); MODULE_DESCRIPTION("MELFAS mms114 Touchscreen driver"); -MODULE_LICENSE("GPL v2"); +MODULE_LICENSE("GPL"); diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c index 240d2eebf1c9..cd40c284d6f4 100644 --- a/drivers/input/touchscreen/msg2638.c +++ b/drivers/input/touchscreen/msg2638.c @@ -19,7 +19,6 @@ #include <linux/input/touchscreen.h> #include <linux/interrupt.h> #include <linux/kernel.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/property.h> #include <linux/regulator/consumer.h> diff --git a/drivers/input/touchscreen/resistive-adc-touch.c b/drivers/input/touchscreen/resistive-adc-touch.c index 7e761ec73273..68f7e2e28f37 100644 --- a/drivers/input/touchscreen/resistive-adc-touch.c +++ b/drivers/input/touchscreen/resistive-adc-touch.c @@ -13,7 +13,6 @@ #include <linux/input/touchscreen.h> #include <linux/iio/consumer.h> #include <linux/iio/iio.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/property.h> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index e9089b0c3e2f..09d8c5f8d09f 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -128,8 +128,8 @@ struct sur40_image_header { /* polling interval (ms) */ #define POLL_INTERVAL 1 -/* maximum number of contacts FIXME: this is a guess? */ -#define MAX_CONTACTS 64 +/* maximum number of contacts */ +#define MAX_CONTACTS 52 /* control commands */ #define SUR40_GET_VERSION 0xb0 /* 12 bytes string */ diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c index 4a775c5df0ea..e4d7da0f4434 100644 --- a/drivers/input/touchscreen/tsc2007_core.c +++ b/drivers/input/touchscreen/tsc2007_core.c @@ -24,7 +24,6 @@ #include <linux/interrupt.h> #include <linux/i2c.h> #include <linux/math64.h> -#include <linux/mod_devicetable.h> #include <linux/property.h> #include <linux/platform_data/tsc2007.h> #include "tsc2007.h" diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 45930d731873..d8d1cdc3f09e 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -417,6 +417,13 @@ static int w8001_detect(struct w8001 *w8001) return 0; } +static void w8001_append_suffix(char *dest, const char *suffix, size_t dest_sz) +{ + size_t used = strnlen(dest, dest_sz); + + strscpy(dest + used, suffix, dest_sz - used); +} + static int w8001_setup_pen(struct w8001 *w8001, char *basename, size_t basename_sz) { @@ -453,7 +460,7 @@ static int w8001_setup_pen(struct w8001 *w8001, char *basename, } w8001->id = 0x90; - strlcat(basename, " Penabled", basename_sz); + w8001_append_suffix(basename, " Penabled", basename_sz); return 0; } @@ -503,14 +510,14 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, case 2: w8001->pktlen = W8001_PKTLEN_TOUCH93; w8001->id = 0x93; - strlcat(basename, " 1FG", basename_sz); + w8001_append_suffix(basename, " 1FG", basename_sz); break; case 1: case 3: case 4: w8001->pktlen = W8001_PKTLEN_TOUCH9A; - strlcat(basename, " 1FG", basename_sz); + w8001_append_suffix(basename, " 1FG", basename_sz); w8001->id = 0x9a; break; @@ -534,7 +541,7 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, input_abs_set_res(dev, ABS_MT_POSITION_X, touch.panel_res); input_abs_set_res(dev, ABS_MT_POSITION_Y, touch.panel_res); - strlcat(basename, " 2FG", basename_sz); + w8001_append_suffix(basename, " 2FG", basename_sz); if (w8001->max_pen_x && w8001->max_pen_y) w8001->id = 0xE3; else @@ -542,7 +549,7 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, break; } - strlcat(basename, " Touchscreen", basename_sz); + w8001_append_suffix(basename, " Touchscreen", basename_sz); return 0; } |
