@@ -9,6 +9,12 @@ Required properties:
- interrupts: The sink for the touchpad's IRQ output
See ../interrupt-controller/interrupts.txt
+Optional properties:
+
+- linux,config-name: name of configuration file that should be loaded
+ into device for optimal functioning. If not specified "maxtouch.cfg"
+ will be used.
+
Optional properties for main touchpad device:
- linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
@@ -2035,7 +2035,8 @@ static int mxt_initialize(struct mxt_data *data)
if (error)
goto err_free_object_table;
- error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
+ error = request_firmware_nowait(THIS_MODULE, true,
+ data->pdata->cfg_name ?: MXT_CFG_NAME,
&client->dev, GFP_KERNEL, data,
mxt_config_cb);
if (error) {
@@ -2375,6 +2376,7 @@ static void mxt_input_close(struct input_dev *dev)
#ifdef CONFIG_OF
static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
{
+ struct device_node *np;
struct mxt_platform_data *pdata;
u32 *keymap;
u32 keycode;
@@ -2383,6 +2385,10 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
if (!client->dev.of_node)
return ERR_PTR(-ENOENT);
+ np = client->dev.of_node;
+ if (!np)
+ return ERR_PTR(-ENOENT);
+
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return ERR_PTR(-ENOMEM);
@@ -2409,6 +2415,8 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
pdata->t19_keymap = keymap;
}
+ of_property_read_string(np, "linux,config-name", &pdata->cfg_name);
+
return pdata;
}
#else
@@ -2439,11 +2447,15 @@ static struct mxt_acpi_platform_data samus_platform_data[] = {
.pdata = {
.t19_num_keys = ARRAY_SIZE(samus_touchpad_buttons),
.t19_keymap = samus_touchpad_buttons,
+ .cfg_name = "samus-337t.raw",
},
},
{
/* Touchscreen */
.hid = "ATML0001",
+ .pdata = {
+ .cfg_name = "samus-2954t2.raw",
+ },
},
{ }
};
@@ -111,6 +111,7 @@ static struct mxt_platform_data atmel_224s_tp_platform_data = {
.irqflags = IRQF_TRIGGER_FALLING,
.t19_num_keys = ARRAY_SIZE(mxt_t19_keys),
.t19_keymap = mxt_t19_keys,
+ .cfg_name = "link-224sl.raw",
};
static struct i2c_board_info atmel_224s_tp_device = {
@@ -121,6 +122,7 @@ static struct i2c_board_info atmel_224s_tp_device = {
static struct mxt_platform_data atmel_1664s_platform_data = {
.irqflags = IRQF_TRIGGER_FALLING,
+ .cfg_name = "link-1664s.raw",
};
static struct i2c_board_info atmel_1664s_device = {
@@ -20,6 +20,7 @@ struct mxt_platform_data {
unsigned long irqflags;
u8 t19_num_keys;
const unsigned int *t19_keymap;
+ const char *cfg_name;
};
#endif /* __LINUX_ATMEL_MXT_TS_H */