From patchwork Mon Sep 22 17:09:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 392086 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 A72831400F1 for ; Tue, 23 Sep 2014 03:11:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbaIVRJn (ORCPT ); Mon, 22 Sep 2014 13:09:43 -0400 Received: from mail.kmu-office.ch ([178.209.48.102]:58148 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754580AbaIVRJm (ORCPT ); Mon, 22 Sep 2014 13:09:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id CC58A42D1B0; Mon, 22 Sep 2014 19:08:19 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kmu-office.ch X-Amavis-Alert: BAD HEADER, Duplicate header field: "In-Reply-To" Received: from mail.kmu-office.ch ([127.0.0.1]) by localhost (mail.kmu-office.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VGnDX2j7oDpb; Mon, 22 Sep 2014 19:08:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id 2B6D342D1D0; Mon, 22 Sep 2014 19:08:15 +0200 (CEST) Received: from trochilidae.toradex.int (unknown [46.140.72.82]) (Authenticated sender: stefan@agner.ch) by mail.kmu-office.ch (Postfix) with ESMTPSA id 8503D42D1C2; Mon, 22 Sep 2014 19:08:14 +0200 (CEST) From: Stefan Agner To: shawn.guo@freescale.com, kernel@pengutronix.de, linus.walleij@linaro.org, gnurou@gmail.com Cc: linux@arm.linux.org.uk, jingchang.lu@freescale.com, b20788@freescale.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, stefan@agner.ch Subject: [PATCH 5/9] gpio: vf610: Extend with wakeup support Date: Mon, 22 Sep 2014 19:09:26 +0200 Message-Id: <704b6bb97147b3d0ee1557b43d85ab9376c28666.1411404079.git.stefan@agner.ch> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Support Vybrid GPIO's as wakeup source by requesting the parent IRQ as wakeup IRQ. Signed-off-by: Stefan Agner --- drivers/gpio/gpio-vf610.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 5f59424..50326af 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -196,12 +196,28 @@ static void vf610_gpio_irq_unmask(struct irq_data *d) pcr_base); } +static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable) +{ + struct vf610_gpio_port *port = irq_data_get_irq_chip_data(d); + + if (enable) + enable_irq_wake(port->irq); + else + disable_irq_wake(port->irq); + + return 0; +} + + static struct irq_chip vf610_gpio_irq_chip = { .name = "gpio-vf610", .irq_ack = vf610_gpio_irq_ack, .irq_mask = vf610_gpio_irq_mask, .irq_unmask = vf610_gpio_irq_unmask, .irq_set_type = vf610_gpio_irq_set_type, +#ifdef CONFIG_PM_SLEEP + .irq_set_wake = vf610_gpio_irq_set_wake, +#endif }; static int vf610_gpio_probe(struct platform_device *pdev)