Commit 46711277 authored by Alexander Stein's avatar Alexander Stein Committed by Dmitry Torokhov

Input: gpio-keys - add support for setting device name

This patch allows to set a device name which helps distinguishing several
gpio-keys devices.
Signed-off-by: default avatarAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 92a47674
...@@ -473,7 +473,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) ...@@ -473,7 +473,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ddata); platform_set_drvdata(pdev, ddata);
input_set_drvdata(input, ddata); input_set_drvdata(input, ddata);
input->name = pdev->name; input->name = pdata->name ? : pdev->name;
input->phys = "gpio-keys/input0"; input->phys = "gpio-keys/input0";
input->dev.parent = &pdev->dev; input->dev.parent = &pdev->dev;
input->open = gpio_keys_open; input->open = gpio_keys_open;
......
...@@ -22,6 +22,7 @@ struct gpio_keys_platform_data { ...@@ -22,6 +22,7 @@ struct gpio_keys_platform_data {
unsigned int rep:1; /* enable input subsystem auto repeat */ unsigned int rep:1; /* enable input subsystem auto repeat */
int (*enable)(struct device *dev); int (*enable)(struct device *dev);
void (*disable)(struct device *dev); void (*disable)(struct device *dev);
const char *name; /* input device name */
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment