Skip to content

Commit

Permalink
Input: atmel_mxt_ts - allow input name to be specified in platform data
Browse files Browse the repository at this point in the history
Android systems identify the input device and map to IDC file by using the
input device name. To avoid unnecessary deltas to the driver file, allow
this to be set from the platform data.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
  • Loading branch information
ndyer committed Apr 26, 2016
1 parent 71a2a4d commit cbf94a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/input/atmel,maxtouch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Optional properties for main touchpad device:
- atmel,cfg_name: Provide name of configuration file in OBP_RAW format. This
will be downloaded from the firmware loader on probe to the device.

- atmel,input_name: Override name of input device from the default.

Example:

touch@4b {
Expand Down
8 changes: 7 additions & 1 deletion drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,11 @@ static int mxt_initialize_input_device(struct mxt_data *data)
if (!input_dev)
return -ENOMEM;

input_dev->name = "Atmel maXTouch Touchscreen";
if (data->pdata->input_name)
input_dev->name = data->pdata->input_name;
else
input_dev->name = "Atmel maXTouch Touchscreen";

input_dev->phys = data->phys;
input_dev->id.bustype = BUS_I2C;
input_dev->dev.parent = dev;
Expand Down Expand Up @@ -3129,6 +3133,8 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)

of_property_read_string(np, "atmel,cfg_name", &pdata->cfg_name);

of_property_read_string(np, "atmel,input_name", &pdata->input_name);

if (of_find_property(np, "linux,gpio-keymap", &proplen)) {
pdata->t19_num_keys = proplen / sizeof(u32);

Expand Down
1 change: 1 addition & 0 deletions include/linux/platform_data/atmel_mxt_ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct mxt_platform_data {
const unsigned int *t15_keymap;
unsigned long gpio_reset;
const char *cfg_name;
const char *input_name;
};

#endif /* __LINUX_PLATFORM_DATA_ATMEL_MXT_TS_H */

0 comments on commit cbf94a7

Please sign in to comment.