From patchwork Fri Sep 28 14:28:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1519821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D91DD3FE80 for ; Fri, 28 Sep 2012 14:31:47 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THbZI-0003XK-CO; Fri, 28 Sep 2012 14:29:28 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THbZ5-0003WK-D3 for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 14:29:16 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB2008ICDKH84P0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 23:29:11 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-48-5065b4370e08 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 29.7D.03860.734B5605; Fri, 28 Sep 2012 23:29:11 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MB200E7BDK3XB70@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 23:29:11 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 01/16] pinctrl: exynos: Parse wakeup-eint parameters from DT Date: Fri, 28 Sep 2012 16:28:32 +0200 Message-id: <1348842527-22460-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1348842527-22460-1-git-send-email-t.figa@samsung.com> References: <1348842527-22460-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJMWRmVeSWpSXmKPExsVy+t9jAV3zLakBBlPvKllsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MbzOaWAvm8Fb8m7WWqYGxi7uLkZNDQsBEYtaCE+wQtpjEhXvr 2boYuTiEBBYxSvRf+McCkhAS2MwkcfpQNYjNJqAm8bnhERuILSKgITGl6zFYM7PAZCaJYwvS QWxhgQCJfTsfgNWwCKhKbPl1FszmFXCS+NHfxwyxTF7i6f0+oDgHB6eAs8TaeRoQq5wk+v80 sExg5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cTI9jfz6R3MK5qsDjEKMDBqMTDe2N+ SoAQa2JZcWXuIUYJDmYlEd6M4tQAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzNHkDVAumJJanZ qakFqUUwWSYOTqkGRqZHXpELL3X33X85+dwD+y1S3FrH9X95PDn6Z6piQ2XChBDN60YfH2ef u77x4eV0hTs9XS/+LPpoVvBBdvKjd/9rJIV0xS3enOrsOyuS6X5Jf/WC1ScWvD+z7nfv0ft7 ZFniTz4wV5I5zdWx8mfdYTdR3p+yOe4622uvs2kebDdU4d+xNS7u6AUlluKMREMt5qLiRAC6 ZT7l8wEAAA== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.7 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.8 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, swarren@wwwdotorg.org, devicetree-discuss@lists.ozlabs.org, tomasz.figa@gmail.com, t.figa@samsung.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org, linus.walleij@linaro.org, m.szyprowski@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch converts the pinctrl-exynos driver to parse wakeup interrupt count and register offsets from device tree. It reduces the amount of static platform-specific data and facilitates adding further SoC variants to pinctrl-samsung driver. Signed-off-by: Tomasz Figa --- drivers/pinctrl/pinctrl-exynos.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index 21362f4..b4b58d4 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c @@ -435,6 +435,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) struct device_node *np; struct exynos_weint_data *weint_data; int idx, irq; + u32 val; + int ret; for_each_child_of_node(dev->of_node, np) { if (of_match_node(exynos_wkup_irq_ids, np)) { @@ -445,6 +447,26 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) if (!wkup_np) return -ENODEV; + ret = of_property_read_u32(wkup_np, "samsung,weint-count", &val); + if (ret) + return -EINVAL; + d->ctrl->nr_wint = val; + + ret = of_property_read_u32(wkup_np, "samsung,weint-con", &val); + if (ret) + return -EINVAL; + d->ctrl->weint_con = val; + + ret = of_property_read_u32(wkup_np, "samsung,weint-mask", &val); + if (ret) + return -EINVAL; + d->ctrl->weint_mask = val; + + ret = of_property_read_u32(wkup_np, "samsung,weint-pend", &val); + if (ret) + return -EINVAL; + d->ctrl->weint_pend = val; + d->wkup_irqd = irq_domain_add_linear(wkup_np, d->ctrl->nr_wint, &exynos_wkup_irqd_ops, d); if (!d->wkup_irqd) {