From patchwork Fri Apr 11 00:00:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Kryger X-Patchwork-Id: 28246 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D083A20671 for ; Fri, 11 Apr 2014 00:00:35 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf21898553iec.7 for ; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=UV743zc7jOoXi+AxtyOkzvvLMRo6mSwDWyORuPmQ9uU=; b=Fdp/AlQIdPL1yHQRXRm9A+jfZwTJ8cIlr8KSftEfy0+JLeP4e8lnVyUaPlGrCA+6im D4moqzSjwXfkyhejH1/cEEJGlSeCaPGqw+eNeXq831aqFCJ7/14XXmGngMt+GgIvljDb Xm0hXDZaKQi5UCF6GkyS53XOWghJqxGAHWo9gTq8DgCp0tFyembJMSiYbeNueXyM0XdK 8KWJX3fIpgScmiJcuKm5O4LP9YGgbwwoPDOV7NVuSekgc8OKmqzCMSu20q8o+0sfLY/3 TTY3ZW+OhCPorPBEMu/0yHfIoSEzD4ZYQZCnoQzPmGxdn+EXPuk5jCXxOcpp6lnGkkyM J/tw== X-Gm-Message-State: ALoCoQmmyrJjDiMZBULJEVfS73o7c0Jt+VP4m1ze8tr/ndgj2PvtjliyxipMpoBBjJvUtnhICIOM X-Received: by 10.42.115.129 with SMTP id k1mr8966520icq.25.1397174434813; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.163 with SMTP id b32ls1427549qge.22.gmail; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-Received: by 10.220.170.202 with SMTP id e10mr16890829vcz.20.1397174434589; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id pu9si974093vec.209.2014.04.10.17.00.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 17:00:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so4040970vcb.20 for ; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-Received: by 10.221.55.133 with SMTP id vy5mr16847279vcb.17.1397174434485; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp2778vcb; Thu, 10 Apr 2014 17:00:34 -0700 (PDT) X-Received: by 10.67.13.134 with SMTP id ey6mr23036307pad.44.1397174433774; Thu, 10 Apr 2014 17:00:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ua2si3035358pab.446.2014.04.10.17.00.33; Thu, 10 Apr 2014 17:00:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753896AbaDKAAc (ORCPT + 1 other); Thu, 10 Apr 2014 20:00:32 -0400 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:15467 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753823AbaDKAAb (ORCPT ); Thu, 10 Apr 2014 20:00:31 -0400 X-IronPort-AV: E=Sophos;i="4.97,837,1389772800"; d="scan'208";a="24255257" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 10 Apr 2014 18:01:11 -0700 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 10 Apr 2014 17:00:30 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Thu, 10 Apr 2014 17:00:31 -0700 Received: from dhcp-sv1-10-19-114-209.sj.broadcom.com (mps-infra-lab3.sj.broadcom.com [10.19.114.109]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id CACB427A82; Thu, 10 Apr 2014 17:00:30 -0700 (PDT) Received: by dhcp-sv1-10-19-114-209.sj.broadcom.com (Postfix, from userid 1004) id A9EAE2520E7E; Thu, 10 Apr 2014 17:00:30 -0700 (PDT) From: Tim Kryger To: Markus Mayer , Linus Walleij , Alexandre Courbot CC: Tim Kryger , Broadcom Kernel Feedback List , Linux GPIO Mailing List , Linux Kernel Mailing List Subject: [PATCH] gpio: bcm-kona: Add irq_set_wake method Date: Thu, 10 Apr 2014 17:00:24 -0700 Message-ID: <1397174424-30855-1-git-send-email-tim.kryger@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tim.kryger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If a consumer of a GPIO-based IRQ identifies itself as wanting to have the capability to wake up the system through that interrupt, update the flags to keep that interrupt enabled in suspend. Signed-off-by: Tim Kryger --- drivers/gpio/gpio-bcm-kona.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 3f6b33c..b0e0971 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -20,6 +20,7 @@ #include #include #include +#include #define BCM_GPIO_PASSWD 0x00a5a501 #define GPIO_PER_BANK 32 @@ -340,6 +341,23 @@ static void bcm_kona_gpio_irq_ack(struct irq_data *d) spin_unlock_irqrestore(&kona_gpio->lock, flags); } +#ifdef CONFIG_SUSPEND +static int bcm_kona_gpio_irq_set_wake(struct irq_data *d, unsigned int on) +{ + + struct irq_desc *desc = container_of(d, struct irq_desc, irq_data); + + if (on) + desc->action->flags |= IRQF_NO_SUSPEND; + else + desc->action->flags &= ~IRQF_NO_SUSPEND; + + return 0; +} +#else +#define bcm_kona_gpio_irq_set_wake NULL +#endif + static void bcm_kona_gpio_irq_mask(struct irq_data *d) { struct bcm_kona_gpio *kona_gpio; @@ -494,6 +512,7 @@ static struct irq_chip bcm_gpio_irq_chip = { .irq_set_type = bcm_kona_gpio_irq_set_type, .irq_request_resources = bcm_kona_gpio_irq_reqres, .irq_release_resources = bcm_kona_gpio_irq_relres, + .irq_set_wake = bcm_kona_gpio_irq_set_wake, }; static struct __initconst of_device_id bcm_kona_gpio_of_match[] = {