Commit 809d9516 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Dmitry Torokhov

Input: gpio-keys - allow disabling individual buttons in DT

Add support to disable buttons from DT via status property if given button
is not supported on given platforms. This will help re-using existing dtsi
files across multiple platforms.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent c4dc5f8c
...@@ -630,7 +630,7 @@ gpio_keys_get_devtree_pdata(struct device *dev) ...@@ -630,7 +630,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
if (!node) if (!node)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
nbuttons = of_get_child_count(node); nbuttons = of_get_available_child_count(node);
if (nbuttons == 0) if (nbuttons == 0)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
...@@ -648,7 +648,7 @@ gpio_keys_get_devtree_pdata(struct device *dev) ...@@ -648,7 +648,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
of_property_read_string(node, "label", &pdata->name); of_property_read_string(node, "label", &pdata->name);
i = 0; i = 0;
for_each_child_of_node(node, pp) { for_each_available_child_of_node(node, pp) {
enum of_gpio_flags flags; enum of_gpio_flags flags;
button = &pdata->buttons[i++]; button = &pdata->buttons[i++];
......
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