Commit 593fdd4f authored by Enrico Weigelt, metux IT consult's avatar Enrico Weigelt, metux IT consult Committed by Dmitry Torokhov

Input: gpio_keys_polled - allow specifying name of input device

Instead of hardcoding the input name to the driver name
('gpio-keys-polled'), allow specifying the name of the device via
"label" property. If the property is not present (nor name is set in
board-supplied platform data), we'll default to the old name.
Signed-off-by: default avatarEnrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 17b92927
...@@ -168,6 +168,8 @@ gpio_keys_polled_get_devtree_pdata(struct device *dev) ...@@ -168,6 +168,8 @@ gpio_keys_polled_get_devtree_pdata(struct device *dev)
pdata->rep = device_property_present(dev, "autorepeat"); pdata->rep = device_property_present(dev, "autorepeat");
device_property_read_u32(dev, "poll-interval", &pdata->poll_interval); device_property_read_u32(dev, "poll-interval", &pdata->poll_interval);
device_property_read_string(dev, "label", &pdata->name);
device_for_each_child_node(dev, child) { device_for_each_child_node(dev, child) {
if (fwnode_property_read_u32(child, "linux,code", if (fwnode_property_read_u32(child, "linux,code",
&button->code)) { &button->code)) {
...@@ -270,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) ...@@ -270,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
input = poll_dev->input; input = poll_dev->input;
input->name = pdev->name; input->name = pdata->name ?: pdev->name;
input->phys = DRV_NAME"/input0"; input->phys = DRV_NAME"/input0";
input->id.bustype = BUS_HOST; input->id.bustype = BUS_HOST;
......
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