From patchwork Thu Sep 20 08:53:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1483401 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 B5E6BDF2D2 for ; Thu, 20 Sep 2012 09:02:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEccx-0008N2-K3; Thu, 20 Sep 2012 09:00:55 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEcVs-00052B-F6 for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 08:53:38 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAN009MV4P23OA0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 17:53:33 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-81-505ad98d04a0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 4A.FE.03783.D89DA505; Thu, 20 Sep 2012 17:53:33 +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 <0MAN00DG64OWJ930@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 17:53:33 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [RFC 1/6] pinctrl: exynos: Parse wakeup-eint parameters from DT Date: Thu, 20 Sep 2012 10:53:12 +0200 Message-id: <1348131197-25506-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1348131197-25506-1-git-send-email-t.figa@samsung.com> References: <1348131197-25506-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd3em1EBBr0/ZS02Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfGkU8vmAqu8VZcv/mFvYFxP3cXIyeHhICJxPnjK5kgbDGJC/fW s3UxcnEICSxilLh6bxcLhLOZSWLa/i1sIFVsAmoSnxsegdkiAhoSU7oes4MUMQs8ZpSYPX8P O0hCWMBD4t3qf2BFLAKqEmc272UBsXkFnCSmzzrNBrFOXuLp/T4wm1PAWeLt38PMXYwcQNuc JKYcUJvAyLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRrDPn0ntYFzZYHGIUYCDUYmH t3F5VIAQa2JZcWXuIUYJDmYlEd6NE4FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeYU/BQYICaQn lqRmp6YWpBbBZJk4OKUaGE8vFj3pevM/+8oDb3++bVR5sfqe89FZDppP73QuVhdI54jdt/pq 9g2ntW4cIfE+LlLrw8uvXDy7XrgztsUhwnrVllYziamCxdN/vuzuu7wg2kAx8VrpmYmTJ83h Uj5TUt5x1N9NYNJV2fi3u7cGTtbIV42w797WHrp7RVh1avmmq9xvDQNXvlFiKc5INNRiLipO BAAGLK0O9QEAAA== X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.5 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] X-Mailman-Approved-At: Thu, 20 Sep 2012 05:00:03 -0400 Cc: kgene.kim@samsung.com, devicetree-discuss@lists.ozlabs.org, 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 Signed-off-by: Kyungmin Park --- 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 0d01d19..575378a 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->gpio_irqd) {