From: Russell King Date: Wed, 31 Aug 2016 07:49:44 +0000 (+0100) Subject: gpio: sa1100: use sa11x0_gpio_set_wake() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9dd4819ed58a7f1702d5ba737507d0fef96e68c8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git gpio: sa1100: use sa11x0_gpio_set_wake() Use sa11x0_gpio_set_wake() to set the PWER register, as provided by Dmitry some time back. Signed-off-by: Russell King Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index 8d8ee0ebf14c..fb9d52a57d78 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -73,6 +74,7 @@ static struct gpio_chip sa1100_gpio_chip = { static int GPIO_IRQ_rising_edge; static int GPIO_IRQ_falling_edge; static int GPIO_IRQ_mask; +static int GPIO_IRQ_wake; static int sa1100_gpio_type(struct irq_data *d, unsigned int type) { @@ -131,11 +133,14 @@ static void sa1100_gpio_unmask(struct irq_data *d) static int sa1100_gpio_wake(struct irq_data *d, unsigned int on) { - if (on) - PWER |= BIT(d->hwirq); - else - PWER &= ~BIT(d->hwirq); - return 0; + int ret = sa11x0_gpio_set_wake(d->hwirq, on); + if (!ret) { + if (on) + GPIO_IRQ_wake |= BIT(d->hwirq); + else + GPIO_IRQ_wake &= ~BIT(d->hwirq); + } + return ret; } /* @@ -201,8 +206,8 @@ static int sa1100_gpio_suspend(void) /* * Set the appropriate edges for wakeup. */ - GRER = PWER & GPIO_IRQ_rising_edge; - GFER = PWER & GPIO_IRQ_falling_edge; + GRER = GPIO_IRQ_wake & GPIO_IRQ_rising_edge; + GFER = GPIO_IRQ_wake & GPIO_IRQ_falling_edge; /* * Clear any pending GPIO interrupts.