Merge branch 'torvalds/master'
[firefly-linux-kernel-4.4.55.git] / drivers / input / keyboard / matrix_keypad.c
index 71d77192ac1ef7a1dfa48317b737493a1ac4cffc..7f12b6579f822d48add2f6f42ab7f8a1ad068d11 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-#include <linux/init.h>
 #include <linux/input.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -333,23 +332,24 @@ static int matrix_keypad_init_gpio(struct platform_device *pdev,
        }
 
        if (pdata->clustered_irq > 0) {
-               err = request_irq(pdata->clustered_irq,
+               err = request_any_context_irq(pdata->clustered_irq,
                                matrix_keypad_interrupt,
                                pdata->clustered_irq_flags,
                                "matrix-keypad", keypad);
-               if (err) {
+               if (err < 0) {
                        dev_err(&pdev->dev,
                                "Unable to acquire clustered interrupt\n");
                        goto err_free_rows;
                }
        } else {
                for (i = 0; i < pdata->num_row_gpios; i++) {
-                       err = request_irq(gpio_to_irq(pdata->row_gpios[i]),
+                       err = request_any_context_irq(
+                                       gpio_to_irq(pdata->row_gpios[i]),
                                        matrix_keypad_interrupt,
                                        IRQF_TRIGGER_RISING |
                                        IRQF_TRIGGER_FALLING,
                                        "matrix-keypad", keypad);
-                       if (err) {
+                       if (err < 0) {
                                dev_err(&pdev->dev,
                                        "Unable to acquire interrupt for GPIO line %i\n",
                                        pdata->row_gpios[i]);
@@ -425,8 +425,10 @@ matrix_keypad_parse_dt(struct device *dev)
 
        if (of_get_property(np, "linux,no-autorepeat", NULL))
                pdata->no_autorepeat = true;
-       if (of_get_property(np, "linux,wakeup", NULL))
-               pdata->wakeup = true;
+
+       pdata->wakeup = of_property_read_bool(np, "wakeup-source") ||
+                       of_property_read_bool(np, "linux,wakeup"); /* legacy */
+
        if (of_get_property(np, "gpio-activelow", NULL))
                pdata->active_low = true;
 
@@ -549,8 +551,6 @@ static int matrix_keypad_remove(struct platform_device *pdev)
        input_unregister_device(keypad->input_dev);
        kfree(keypad);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
@@ -567,7 +567,6 @@ static struct platform_driver matrix_keypad_driver = {
        .remove         = matrix_keypad_remove,
        .driver         = {
                .name   = "matrix-keypad",
-               .owner  = THIS_MODULE,
                .pm     = &matrix_keypad_pm_ops,
                .of_match_table = of_match_ptr(matrix_keypad_dt_match),
        },