From patchwork Thu Apr 25 07:38:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 16392 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29D9E2395D for ; Thu, 25 Apr 2013 07:39:39 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f35sf2731552yha.3 for ; Thu, 25 Apr 2013 00:38:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=yIngpeMZvOfXVJOEts9PbPnuA29EG49DllM3yItBJNQ=; b=M3ufq1kJgTN+nmrq9fBDC1IwT7nyHwPMyVx2wm+NPhYml7AJ/sHsGSKVt5mm6tNh+g airkDyCjv8l28hTrT5DowiS1JgQAZKGD6gvBEmH+sGr6GA1Ciu0xTVudJEARG3PJPb49 4i1Al/jZUkZkzznO0zKLVsxmS1WXnXvGtvYJkkAyVT6xR1QubtTp8vIL0YYKWlnPSk0n Wtg8aNbtRv4a1OGg43G8+JHPM7JoW17ZoFPJrhKBthNZH9MSVy2NqZiQZRnsB1PAXEXG D1R4M+i/KX26Qkb0uF3eW/bQ2AFz2fOHBGtVFsE/gFm18KlVbKxAEJySesdccqVqSp4I ZLIg== X-Received: by 10.236.82.46 with SMTP id n34mr19145806yhe.24.1366875526146; Thu, 25 Apr 2013 00:38:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.13.40 with SMTP id e8ls1274639qec.77.gmail; Thu, 25 Apr 2013 00:38:46 -0700 (PDT) X-Received: by 10.220.156.8 with SMTP id u8mr26543692vcw.24.1366875525983; Thu, 25 Apr 2013 00:38:45 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ec8si2816150vdb.7.2013.04.25.00.38.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 00:38:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so2539562vcb.20 for ; Thu, 25 Apr 2013 00:38:45 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr22756269vdb.94.1366875525843; Thu, 25 Apr 2013 00:38:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp9947veb; Thu, 25 Apr 2013 00:38:45 -0700 (PDT) X-Received: by 10.50.27.10 with SMTP id p10mr25287077igg.20.1366875524561; Thu, 25 Apr 2013 00:38:44 -0700 (PDT) Received: from mail-ia0-x231.google.com (mail-ia0-x231.google.com [2607:f8b0:4001:c02::231]) by mx.google.com with ESMTPS id g6si30000228igy.6.2013.04.25.00.38.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 00:38:44 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::231 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=2607:f8b0:4001:c02::231; Received: by mail-ia0-f177.google.com with SMTP id y26so2373996iab.8 for ; Thu, 25 Apr 2013 00:38:43 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.97.7 with SMTP id dw7mr12255150igb.37.1366875523418; Thu, 25 Apr 2013 00:38:43 -0700 (PDT) Received: by 10.231.54.74 with HTTP; Thu, 25 Apr 2013 00:38:43 -0700 (PDT) In-Reply-To: <20130424233348.GA6603@quad.lixom.net> References: <1355403978-388-1-git-send-email-thomas.abraham@linaro.org> <20130424233348.GA6603@quad.lixom.net> Date: Thu, 25 Apr 2013 13:08:43 +0530 Message-ID: Subject: Re: [PATCH] ARM: dts: add pinctrl nodes for Exynos5250 SoC From: Thomas Abraham To: Olof Johansson Cc: arm-linux , linux-samsung-soc , Linus Walleij , Kukjin Kim , Tomasz Figa , Patch Tracking X-Gm-Message-State: ALoCoQnvgZvOlyiHMRC/VBhAJ6+JTnYZqDciAaKOVGHmX0nqFQSp6IUCZU1/uD8clnjxSbFngyCa X-Original-Sender: thomas.abraham@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 25 April 2013 05:03, Olof Johansson wrote: > On Thu, Dec 13, 2012 at 06:36:18PM +0530, Thomas Abraham wrote: >> Add pinctrl device nodes for Exynos5250 SoC. >> >> Signed-off-by: Thomas Abraham > > Replying to an old email of a patch that has been merged because it seems > horribly broken. > > >> diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi >> index 581e57a..eb8d610 100644 >> --- a/arch/arm/boot/dts/exynos5250.dtsi >> +++ b/arch/arm/boot/dts/exynos5250.dtsi >> @@ -18,6 +18,7 @@ >> */ >> >> /include/ "skeleton.dtsi" >> +/include/ "exynos5250-pinctrl.dtsi" >> >> / { >> compatible = "samsung,exynos5250"; >> @@ -48,6 +49,8 @@ >> mshc1 = &dwmmc_1; >> mshc2 = &dwmmc_2; >> mshc3 = &dwmmc_3; >> + pinctrl0 = &pinctrl_0; >> + pinctrl3 = &pinctrl_3; >> }; >> >> gic:interrupt-controller@10481000 { >> @@ -79,6 +82,24 @@ >> interrupts = <0 42 0>; >> }; >> >> + pinctrl_0: pinctrl@11400000 { >> + compatible = "samsung,pinctrl-exynos5250"; >> + reg = <0x11400000 0x1000>; >> + interrupts = <0 46 0>; >> + >> + wakup_eint: wakeup-interrupt-controller { >> + compatible = "samsung,exynos4210-wakeup-eint"; >> + interrupt-parent = <&gic>; >> + interrupts = <0 32 0>; >> + }; > > Typo, should be "wakeup_eint". And what happened to #interrupt-cells? And the > interrupt map? Hi Olof, With the pinctrl driver, there is change in the way the wakeup interrupts are handled. Each of the four wakeup banks (GPX0 to GPX3) are now individual interrupt controllers (introduced by Tomasz Figa). The wakeup interrupts generated by GPX2 and GPX3 are muxed into the <0 32 0> interrupt of GIC. So the interrupts-cells and interrupt map are not required in the above node. The label "wakup_eint" can actually to dropped and probably the node name "wakeup-interrupt-controller" should be renamed to avoid interpreting it as a interrupt controller node. > > Do you have an example of a tested user or a testcase for this? I'm > trying to get interrupts going on these pins, and it's not looking like > it's even close to working. The following is a rudimentary patch with which I have tested wakeup interrupts GPX0[0] and GPX3[7] on smdk5250 board. The gpio number in the dts file can be changed to test wakeup interrupt on pins other than EINT31 (GPX3[7]). Thanks, Thomas. simple patch to test wakeup interrupts on smdk5250 board. Note: some of the smdk5250 boards may have a faulty SW8 button (for EINT31) and so EINT31 might not work on those smdk5250 boards. Signed-off-by: Thomas Abraham --- arch/arm/boot/dts/exynos5250-smdk5250.dts | 5 ++ arch/arm/mach-exynos/Makefile | 2 +- arch/arm/mach-exynos/button-smdk5250.c | 72 +++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-exynos/button-smdk5250.c > > > -Olof diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index 26d856b..eedec6a 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -248,4 +248,9 @@ clock-frequency = <24000000>; }; }; + + test-wkup { + compatible = "test_wkup"; + gpios = <&gpx3 7 0>; + }; }; diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index ef6860b..d7640e3 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -44,7 +44,7 @@ obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o -obj-$(CONFIG_MACH_EXYNOS5_DT) += mach-exynos5-dt.o +obj-$(CONFIG_MACH_EXYNOS5_DT) += mach-exynos5-dt.o button-smdk5250.o # device support diff --git a/arch/arm/mach-exynos/button-smdk5250.c b/arch/arm/mach-exynos/button-smdk5250.c new file mode 100644 index 0000000..2dbb5b4 --- /dev/null +++ b/arch/arm/mach-exynos/button-smdk5250.c @@ -0,0 +1,72 @@ +/* linux/arch/arm/mach-s5pv310/button-smdkv310.c + * + * Copyright (c) 2010 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * Button Driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +static irqreturn_t +s3c_button_interrupt(int irq, void *dev_id) +{ + printk("\n %d irq occured \n", irq); + return IRQ_HANDLED; +} + +static struct irqaction s3c_button_irq = { + .name = "s3c button Tick", + .flags = IRQF_SHARED , + .handler = s3c_button_interrupt, +}; + +static int __init smdk5250_button_test(void) +{ + struct device_node *np; + unsigned long gpio; + int gpio_irq; + + printk(KERN_INFO "\n\n SMDKV5250 Button init function\n"); + + np = of_find_compatible_node(NULL, NULL, "test_wkup"); + if (!np) { + printk("could not find test node.. stopping.\n"); + return -EINVAL; + } + + gpio = of_get_gpio(np, 0); + if (!gpio_is_valid(gpio)) { + printk("\n gpio_weint_mux gpio is invalid\n"); + return -EINVAL; + } + + gpio_irq = gpio_to_irq(gpio); + + irq_set_irq_type(gpio_irq, IRQ_TYPE_EDGE_BOTH); + setup_irq(gpio_irq, &s3c_button_irq); + + return 0; +} +late_initcall(smdk5250_button_test);