Input: ab8500-ponkey - add device tree support
authorLee Jones <lee.jones@linaro.org>
Tue, 12 Jun 2012 07:21:47 +0000 (00:21 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 12 Jun 2012 07:39:47 +0000 (00:39 -0700)
Allow the ab8500-ponkey driver to be probed during boot when Device Tree is
enabled.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/misc/ab8500-ponkey.c

index 350fd0c385d2449115ea332fdf8f27601c46485c..84ec691c05aa983751492a8dff29c5ca87b27ad2 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/input.h>
 #include <linux/interrupt.h>
 #include <linux/mfd/abx500/ab8500.h>
+#include <linux/of.h>
 #include <linux/slab.h>
 
 /**
@@ -131,10 +132,18 @@ static int __devexit ab8500_ponkey_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id ab8500_ponkey_match[] = {
+       { .compatible = "stericsson,ab8500-ponkey", },
+       {}
+};
+#endif
+
 static struct platform_driver ab8500_ponkey_driver = {
        .driver         = {
                .name   = "ab8500-poweron-key",
                .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(ab8500_ponkey_match),
        },
        .probe          = ab8500_ponkey_probe,
        .remove         = __devexit_p(ab8500_ponkey_remove),