Skip to content

Commit 2f46205

Browse files
sudeep-hollalinusw
authored andcommitted
gpio: pl061: add support for wakeup configuration
The PL061 supports interrupts and those can be wakeup interrupts. We need to provide support for configuring those interrupts as wakeup sources. This patch adds irq_set_wake callback for PL061 so that GPIO interrupts can be configured as wakeup. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 3773c19 commit 2f46205

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpio/gpio-pl061.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/module.h>
1515
#include <linux/io.h>
1616
#include <linux/ioport.h>
17+
#include <linux/interrupt.h>
1718
#include <linux/irq.h>
1819
#include <linux/irqchip/chained_irq.h>
1920
#include <linux/bitops.h>
@@ -269,12 +270,20 @@ static void pl061_irq_ack(struct irq_data *d)
269270
spin_unlock(&chip->lock);
270271
}
271272

273+
static int pl061_irq_set_wake(struct irq_data *d, unsigned int state)
274+
{
275+
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
276+
277+
return irq_set_irq_wake(gc->irq_parent, state);
278+
}
279+
272280
static struct irq_chip pl061_irqchip = {
273281
.name = "pl061",
274282
.irq_ack = pl061_irq_ack,
275283
.irq_mask = pl061_irq_mask,
276284
.irq_unmask = pl061_irq_unmask,
277285
.irq_set_type = pl061_irq_type,
286+
.irq_set_wake = pl061_irq_set_wake,
278287
};
279288

280289
static int pl061_probe(struct amba_device *adev, const struct amba_id *id)

0 commit comments

Comments
 (0)