From patchwork Mon Oct 8 08:39:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1564471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 42078DFFAD for ; Mon, 8 Oct 2012 08:42:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TL8sU-0001g7-8W; Mon, 08 Oct 2012 08:39:56 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TL8sF-0001eD-PX for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 08:39:40 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBK00EWNG21GYG0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 17:39:37 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-14-50729149c7b9 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 41.01.03860.94192705; Mon, 08 Oct 2012 17:39:37 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBK0094QG1I1U90@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 17:39:37 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/16] pinctrl: exynos: Parse wakeup-eint parameters from DT Date: Mon, 08 Oct 2012 10:39:02 +0200 Message-id: <1349685556-23718-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1349685556-23718-1-git-send-email-t.figa@samsung.com> References: <1349685556-23718-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jQV3PiUUBBo8ei1tsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MbzOaWAvm8Fb8m7WWqYGxi7uLkZNDQsBEYlv/HlYIW0ziwr31 bF2MXBxCAtMZJfZf/gjlbGaS2Hv+KjNIFZuAmsTnhkdsILaIgIbElK7H7CA2s8BkJoljC9JB bGEBH4k3O3vB6lkEVCVWXVwDZvMKOEk87l3NBLFNXuLp/T6wOZwCzhInf84Hu0IIqGbJpcss Exh5FzAyrGIUTS1ILihOSs810itOzC0uzUvXS87P3cQI9vkz6R2MqxosDjEKcDAq8fB+1CsK EGJNLCuuzD3EKMHBrCTCm9oPFOJNSaysSi3Kjy8qzUktPsQozcGiJM7b7JESICSQnliSmp2a WpBaBJNl4uCUamCUjL2+T/u7bPmhnW7PM8O5RVW1Q+Z3i6vXvenLyv25ba9Sj4GTrCT/uYV7 ddxq2+9WPV1UNsNuCZt79lmN3sXrM8psTt8TaWepfNKisKrIlkGS0eX/tvM8e9ukz3ROvFve +fOFtVtbpKbKil+serM9mRbE8grXKdcdXpo9eX3PthjlUIu8RCWW4oxEQy3mouJEALcFWYz1 AQAA X-Spam-Note: CRM114 invocation failed X-Spam-Score: -9.0 (---------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-9.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -2.1 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) {