aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-10-19 19:28:46 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-19 20:08:46 -0400
commitadb77b3e5118d2760621d8cc740524b816f9006b (patch)
tree5d49dd1e83c73254b4e4e1930fc5a7a1ed7aa733
parent836bd419833ce581a2450fc237f89551c841a156 (diff)
Input: gpio_mouse - add device tree probing
This makes the GPIO mouse probe nicely from the device tree if found in a tree. As the driver uses device properties it can easily be amended to also probe from ACPI devices. Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/gpio_mouse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index 6cd7159f1003..a26d8be6f795 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -14,6 +14,7 @@
14#include <linux/input-polldev.h> 14#include <linux/input-polldev.h>
15#include <linux/gpio/consumer.h> 15#include <linux/gpio/consumer.h>
16#include <linux/property.h> 16#include <linux/property.h>
17#include <linux/of.h>
17 18
18/** 19/**
19 * struct gpio_mouse 20 * struct gpio_mouse
@@ -156,10 +157,17 @@ static int gpio_mouse_probe(struct platform_device *pdev)
156 return 0; 157 return 0;
157} 158}
158 159
160static const struct of_device_id gpio_mouse_of_match[] = {
161 { .compatible = "gpio-mouse", },
162 { },
163};
164MODULE_DEVICE_TABLE(of, gpio_mouse_of_match);
165
159static struct platform_driver gpio_mouse_device_driver = { 166static struct platform_driver gpio_mouse_device_driver = {
160 .probe = gpio_mouse_probe, 167 .probe = gpio_mouse_probe,
161 .driver = { 168 .driver = {
162 .name = "gpio_mouse", 169 .name = "gpio_mouse",
170 .of_match_table = gpio_mouse_of_match,
163 } 171 }
164}; 172};
165module_platform_driver(gpio_mouse_device_driver); 173module_platform_driver(gpio_mouse_device_driver);