From patchwork Fri Nov 27 17:19:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 549547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5790E1402DD for ; Sat, 28 Nov 2015 04:19:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754796AbbK0RTn (ORCPT ); Fri, 27 Nov 2015 12:19:43 -0500 Received: from foss.arm.com ([217.140.101.70]:50584 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754306AbbK0RTm (ORCPT ); Fri, 27 Nov 2015 12:19:42 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BFEEF49; Fri, 27 Nov 2015 09:19:23 -0800 (PST) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BF8E23F2E5; Fri, 27 Nov 2015 09:19:36 -0800 (PST) From: Sudeep Holla To: Linus Walleij , linux-gpio@vger.kernel.org Cc: Sudeep Holla , linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH] gpio: pl061: add support for wakeup configuration Date: Fri, 27 Nov 2015 17:19:15 +0000 Message-Id: <1448644755-29183-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 Cc: Alexandre Courbot Signed-off-by: Sudeep Holla --- drivers/gpio/gpio-pl061.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 4d4b37676702..8b1cbd5767f9 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -269,12 +270,20 @@ static void pl061_irq_ack(struct irq_data *d) spin_unlock(&chip->lock); } +static int pl061_irq_set_wake(struct irq_data *d, unsigned int state) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + + return irq_set_irq_wake(gc->irq_parent, state); +} + static struct irq_chip pl061_irqchip = { .name = "pl061", .irq_ack = pl061_irq_ack, .irq_mask = pl061_irq_mask, .irq_unmask = pl061_irq_unmask, .irq_set_type = pl061_irq_type, + .irq_set_wake = pl061_irq_set_wake, }; static int pl061_probe(struct amba_device *adev, const struct amba_id *id)