From patchwork Fri May 17 16:24:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2583811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id B6276DF215 for ; Fri, 17 May 2013 16:26:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNTn-0008Qa-6T; Fri, 17 May 2013 16:26:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNTY-0001RY-VS; Fri, 17 May 2013 16:25:48 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNTE-0001O0-0Q for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 16:25:28 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MMY003AFAXG67C0@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 17:24:59 +0100 (BST) X-AuditID: cbfec7f4-b7fd76d0000035e1-04-519659dbdbe2 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id B4.95.13793.BD956915; Fri, 17 May 2013 17:24:59 +0100 (BST) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MMY00K5ZAXKIM00@eusync2.samsung.com>; Fri, 17 May 2013 17:24:59 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/6] pinctrl: exynos: Add support for set_irq_wake of wake-up EINTs Date: Fri, 17 May 2013 18:24:27 +0200 Message-id: <1368807872-2601-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.2.1 In-reply-to: <1368807872-2601-1-git-send-email-t.figa@samsung.com> References: <1368807872-2601-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGLMWRmVeSWpSXmKPExsVy+t/xK7q3I6cFGhzeaWjxd9Ixdouzyw6y Wfx/9JrVonfBVTaLs01v2C2m/FnOZLHp8TVWixnn9zFZnLr+mc3iwoqN7BavDraxWKyf8ZrF 4tiMJYwOvB6/f01i9JjdcJHF4861PWwem5fUe1w50cTq0bdlFaPH9mvzmD0+b5Lz2Dg3NIAz issmJTUnsyy1SN8ugSvj5ZEe5oKf3BWXNp5nb2D8xdnFyMkhIWAiseDkfTYIW0ziwr31QDYX h5DAUkaJ7YuvskI4fUwSXQevsYNUsQmoSXxueATWISKgKvG5bQE7SBGzwE5micsPbrJ0MXJw CAuEShyfXwRSwwJU0/xqGguIzSvgKDHrUS8LxDYFiePbtzGC2JwCThJvZs1hBrGFgGpudp1l ncDIu4CRYRWjaGppckFxUnquoV5xYm5xaV66XnJ+7iZGSNh+2cG4+JjVIUYBDkYlHt6ZztMC hVgTy4orcw8xSnAwK4nwHv84NVCINyWxsiq1KD++qDQntfgQIxMHp1QDY6Lxt7xn1pee7M5b sHvdgVO7y7c5bcuYdP9RzIyJ61Yf2mnxvnCVC9sN0eodNQuXHO0w8p7fFabzRFpRN5gpJsH5 7fPPbdlvbq8JVNgnoNPkYHiw0Dtq5r+UOWpxfVvrv2lYb0xSWOrbef39AhaDF30ZJ2e6K7H8 Fyh7bm+1YnrmwaU6hgqe2UosxRmJhlrMRcWJAJYL0KQ5AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130517_122528_219455_9985E381 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -7.5 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.13 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, =?UTF-8?q?Heiko=20St=C3=BCbner?= , arnd@arndb.de, Stephen Warren , Linus Walleij , Prathyush K , Doug Anderson , Kyungmin Park , Thomas Abraham , olof@lixom.net, Tomasz Figa , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds support of IRQ wake-up ability configuration for wake-up EINTs on Exynos SoCs. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park Tested-by: Doug Anderson Reviewed-by: Doug Anderson --- drivers/pinctrl/pinctrl-exynos.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index ac74281..4f868e5 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c @@ -326,6 +326,28 @@ static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type) return 0; } +static u32 exynos_eint_wake_mask = 0xffffffff; + +u32 exynos_get_eint_wake_mask(void) +{ + return exynos_eint_wake_mask; +} + +static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) +{ + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); + unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); + + pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq); + + if (!on) + exynos_eint_wake_mask |= bit; + else + exynos_eint_wake_mask &= ~bit; + + return 0; +} + /* * irq_chip for wakeup interrupts */ @@ -335,6 +357,7 @@ static struct irq_chip exynos_wkup_irq_chip = { .irq_mask = exynos_wkup_irq_mask, .irq_ack = exynos_wkup_irq_ack, .irq_set_type = exynos_wkup_irq_set_type, + .irq_set_wake = exynos_wkup_irq_set_wake, }; /* interrupt handler for wakeup interrupts 0..15 */