From patchwork Sat Sep 13 08:50:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 4899431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7A68BEEA6 for ; Sat, 13 Sep 2014 08:54:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18E592018B for ; Sat, 13 Sep 2014 08:54:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E55A201F7 for ; Sat, 13 Sep 2014 08:54:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSj3L-0001hN-Kr; Sat, 13 Sep 2014 08:51:31 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSj3H-0001cZ-Lz for linux-arm-kernel@lists.infradead.org; Sat, 13 Sep 2014 08:51:28 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBU005WG0L3MY50@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 13 Sep 2014 17:51:04 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id FB.18.04442.77504145; Sat, 13 Sep 2014 17:51:03 +0900 (KST) X-AuditID: cbfee690-f79ce6d00000115a-a6-541405778a9d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 86.68.05196.77504145; Sat, 13 Sep 2014 17:51:03 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NBU002Z90KJ4U10@mmp1.samsung.com>; Sat, 13 Sep 2014 17:51:03 +0900 (KST) From: Abhilash Kesavan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] pinctrl: exynos: Generalize the eint16_31 demux code Date: Sat, 13 Sep 2014 14:20:49 +0530 Message-id: <1410598252-30931-3-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1410598252-30931-1-git-send-email-a.kesavan@samsung.com> References: <1410598252-30931-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsWyRsSkVrecVSTEYMd8S4v3y3oYLeYfOcdq seavksWUP8uZLDY9vsZqMeP8PiaL/3t2sFt0LGO0WLXrD6MDp8eaeWsYPXbOusvusWlVJ5vH nWt72Dw2L6n36NuyitHj8ya5APYoLpuU1JzMstQifbsEroyrt30LnglWnJiylamBsY+/i5GT Q0LAROLm+z2MELaYxIV769m6GLk4hASWMkpM3TqHFaZo9cFOFojEIkaJF/snM0M4fUwSS5s+ gFWxCehJLPj3lRnEFhHQkJjS9ZgdxGYWuMwocfJjJYgtLOAp8b7xPhuIzSKgKvFw3y2wGl4B V4nXx1cBzeEA2qYgMWeSDUiYU8BN4vnHDWAjhYBKps1aA3aEhMA2donPq9tYIeYISHybfIgF oldWYtMBZoijJSUOrrjBMoFReAEjwypG0dSC5ILipPQiE73ixNzi0rx0veT83E2MwDg4/e/Z hB2M9w5YH2IU4GBU4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nZeeq/Fdd//aqwg08s8rSYS6TFP53JO6gw4+uTa9W/wp+c fSrxWrDc9nTVw7dqV5cmXO9pmcs+02v2dC7ZJ+c2zZNUW3TW8+v21gc5WxfOPFAqejbcWO6s EktxRqKhFnNRcSIAUvWvU8gCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140913_015127_892801_5D1BC453 X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: -7.2 (-------) Cc: devicetree@vger.kernel.org, kesavan.abhilash@gmail.com, linux-samsung-soc@vger.kernel.org, robh@kernel.org, catalin.marinas@arm.com, linus.walleij@linaro.org, tomasz.figa@gmail.com, thomas.ab@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function exynos_irq_demux_eint16_31 uses pre-defined offsets for external interrupt pending status and mask registers. So this function is not extensible for Exynos7 SoC which have these registers at different offsets. So generalize the exynos_irq_demux_eint16_31 function by using the pending/mask register offset values from the exynos_irq_chip structure. Signed-off-by: Abhilash Kesavan Cc: Thomas Abraham Cc: Tomasz Figa Cc: Linus Walleij --- drivers/pinctrl/samsung/pinctrl-exynos.c | 6 ++++-- drivers/pinctrl/samsung/pinctrl-exynos.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 003bfd8..3133a1e 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -387,10 +387,11 @@ static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) chained_irq_enter(chip, desc); for (i = 0; i < eintd->nr_banks; ++i) { + struct exynos_irq_chip *our_chip = eintd->chip; struct samsung_pin_bank *b = eintd->banks[i]; - pend = readl(d->virt_base + EXYNOS_WKUP_EPEND_OFFSET + pend = readl(d->virt_base + our_chip->eint_pend + b->eint_offset); - mask = readl(d->virt_base + EXYNOS_WKUP_EMASK_OFFSET + mask = readl(d->virt_base + our_chip->eint_mask + b->eint_offset); exynos_irq_demux_eint(pend & ~mask, b->irq_domain); } @@ -508,6 +509,7 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) muxed_data->banks[idx++] = bank; } muxed_data->nr_banks = muxed_banks; + muxed_data->chip = &exynos_wkup_irq_chip; return 0; } diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h index 3c91c35..e060722 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.h +++ b/drivers/pinctrl/samsung/pinctrl-exynos.h @@ -94,6 +94,7 @@ struct exynos_weint_data { * @banks: array of banks being part of the mux */ struct exynos_muxed_weint_data { + struct exynos_irq_chip *chip; unsigned int nr_banks; struct samsung_pin_bank *banks[]; };