]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Input: gpio-keys - allow setting input device name in DT
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 13 Jan 2016 06:56:40 +0000 (22:56 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 13 Jan 2016 08:18:05 +0000 (00:18 -0800)
Allow specifying name if input device via device tree property. This helps
userspace code to get name and perform proper event to key mapping in some
cases (for example, on Android).

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/input/gpio-keys.txt
drivers/input/keyboard/gpio_keys.c

index cf1333d1dd52974e4e960a7c97418f86864e56f1..21641236c095dfc257b0d5375ef0e8710129e690 100644 (file)
@@ -6,6 +6,7 @@ Required properties:
 Optional properties:
        - autorepeat: Boolean, Enable auto repeat feature of Linux input
          subsystem.
+       - label: String, name of the input device.
 
 Each button (key) is represented as a sub-node of "gpio-keys":
 Subnode properties:
index b9f01bd1b7ef1b76a7b4c0d46f71fc3e4ace1818..671cdc9a6aea0e315a071b833d64875db6b0dd29 100644 (file)
@@ -645,6 +645,8 @@ gpio_keys_get_devtree_pdata(struct device *dev)
 
        pdata->rep = !!of_get_property(node, "autorepeat", NULL);
 
+       of_property_read_string(node, "label", &pdata->name);
+
        i = 0;
        for_each_child_of_node(node, pp) {
                enum of_gpio_flags flags;