From: Laxman Dewangan Date: Wed, 13 Jan 2016 06:56:40 +0000 (-0800) Subject: Input: gpio-keys - allow setting input device name in DT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4dc5f8c953f23d45329abc8b8e04f0c1e314a75;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Input: gpio-keys - allow setting input device name in DT 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 Signed-off-by: Dmitry Torokhov --- diff --git a/Documentation/devicetree/bindings/input/gpio-keys.txt b/Documentation/devicetree/bindings/input/gpio-keys.txt index cf1333d1dd52..21641236c095 100644 --- a/Documentation/devicetree/bindings/input/gpio-keys.txt +++ b/Documentation/devicetree/bindings/input/gpio-keys.txt @@ -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: diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index b9f01bd1b7ef..671cdc9a6aea 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -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;