From patchwork Tue Sep 23 08:16:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 4954231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1F4F9F505 for ; Tue, 23 Sep 2014 08:18:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EB6F2020F for ; Tue, 23 Sep 2014 08:18:55 +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 33F2F201FA for ; Tue, 23 Sep 2014 08:18:54 +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 1XWLHF-0000UW-CL; Tue, 23 Sep 2014 08:16:49 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWLHB-0000FD-SA for linux-arm-kernel@lists.infradead.org; Tue, 23 Sep 2014 08:16:46 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NCC00IMZHN9BK30@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 23 Sep 2014 17:16:21 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 6E.F2.18167.45C21245; Tue, 23 Sep 2014 17:16:20 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-3b-54212c5411ab Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 59.A8.09430.45C21245; Tue, 23 Sep 2014 17:16:20 +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 <0NCC00AJWHN23PB1@mmp1.samsung.com>; Tue, 23 Sep 2014 17:16:20 +0900 (KST) From: Abhilash Kesavan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/5] pinctrl: exynos: Generalize the eint16_31 demux code Date: Tue, 23 Sep 2014 13:46:05 +0530 Message-id: <1411460169-30536-2-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1411460169-30536-1-git-send-email-a.kesavan@samsung.com> References: <1411460169-30536-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsWyRsSkVjdERzHEYNobY4v3y3oYLeYfOcdq MeXPciaLTY+vsVrMOL+PyWLRtv/MFh3LGC1W7frD6MDhsWbeGkaPnbPusnvcubaHzWPzknqP vi2rGD0+b5ILYIvisklJzcksSy3St0vgypj+YwdLwTmhit2t5xgbGN/wdzFycEgImEhcPsne xcgJZIpJXLi3nq2LkYtDSGApo0TL/69sEAkTif+3XjNBJBYxSvw4NokZwuljkvi38BoTSBWb gJ7Egn9fmUFsEQENiSldj9lBipgFPjNKHG87zQiSEBbwkZi88xaYzSKgKtFy9w/Ybl4BV4kT 1+cxQpykIDFnkg1ImFPATeLAh7VgVwgBlXz/uQBspoTAKnaJHz/PskHMEZD4NvkQC0SvrMSm A8wQV0tKHFxxg2UCo/ACRoZVjKKpBckFxUnpRSZ6xYm5xaV56XrJ+bmbGIFhf/rfswk7GO8d sD7EK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63iG0/m46qxe4nvEe9TGVW8lnd6OD8vS70s7igb6iT Y/6ExYYdAmtjtyoY86/bvKgkK/xpec5q/QVutmnLe07zlS09tOnuqyyer2ZKLMUZiYZazEXF iQC5Xpd7wQIAAA== 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-20140923_011646_047414_D658EFCB X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -6.0 (------) Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, catalin.marinas@arm.com, Linus Walleij , Tomasz Figa , Thomas Abraham , naveenkrishna.ch@gmail.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=-2.6 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 Reviewed-by: Thomas Abraham Tested-by: Thomas Abraham 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 d7154ed..b5e1cd4 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -444,10 +444,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); } @@ -565,6 +566,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[]; };