[PATCH 17/40] Input: atmel_mxt_ts - Allow input device name to be configured from platform data
From: Nick Dyer
Date: Fri Feb 22 2013 - 13:18:53 EST
Some systems (for example Android IDC files) rely on this name being
a specific string.
Signed-off-by: Nick Dyer <nick.dyer@xxxxxxxxxxx>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 6 +++++-
include/linux/i2c/atmel_mxt_ts.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index b7e5646..60231bf 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1694,7 +1694,11 @@ static int mxt_initialize_t9_input_device(struct mxt_data *data)
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";
+
snprintf(data->phys, sizeof(data->phys), "i2c-%u-%04x/input0",
client->adapter->nr, client->addr);
input_dev->phys = data->phys;
diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h
index e7bceee..b96b265 100644
--- a/include/linux/i2c/atmel_mxt_ts.h
+++ b/include/linux/i2c/atmel_mxt_ts.h
@@ -19,6 +19,7 @@
struct mxt_platform_data {
unsigned long irqflags;
u8(*read_chg) (void);
+ const char *input_name;
};
#endif /* __LINUX_ATMEL_MXT_TS_H */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/