From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Niestroj Subject: Re: [PATCH] rtc: omap: Support ext_wakeup configuration Date: Tue, 12 Apr 2016 19:25:13 +0200 Message-ID: <570D2F79.9040202@grinn-global.com> References: <1459785403-1725-1-git-send-email-m.niestroj@grinn-global.com> <20160404224046.GA17042@atomide.com> <57078A89.3080809@ti.com> <20160408151408.GS16484@atomide.com> <5707E764.7050204@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5707E764.7050204-l0cyMroinI0@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Grygorii Strashko , Tony Lindgren Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring , Pawel Moll , Alessandro Zummo , Alexandre Belloni , Keerthy , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dave Gerlach , "Menon, Nishanth" List-Id: linux-omap@vger.kernel.org Hi, On 08.04.2016 19:16, Grygorii Strashko wrote: > On 04/08/2016 06:14 PM, Tony Lindgren wrote: >> * Grygorii Strashko [160408 03:41]: >>> Hi Tony, >>> >>> On 04/05/2016 01:40 AM, Tony Lindgren wrote: >>>> Hi, >>>> >>>> * Marcin Niestroj [160404 08:57]: >>>>> Support configuration of ext_wakeup sources. This patch makes it >>>>> possible to enable ext_wakeup and set it's polarity, depending on board >>>>> configuration. AM335x's dedicated PMIC (tps65217) uses ext_wakeup to >>>>> notify about power-button presses. Handling power-button presses enables >>>>> to recover from RTC-only power states correctly. >>>> >>>> I suggest you just set this pin up as a minimal gpiochip. That way >>>> we can use the standard binding :) And if we get lucky, this pin can >>>> also trigger during runtime. >>>> >>> >>> Following my comments on v2 of this patch I propose to rollback to >>> this version of the patch. >>> >>> It seems doesn't fit in gpiochip, it's more likely irqchip, but since >>> rtc can't generate IRQ there are nor reasons for these genetic >>> experiments and RTC's specific bindings looks more suitable, at least for me. >> >> Hmm well gpiochips typically are irqchip too. IMO the generic binding >> here sounds like "gpio-wakeup" as it's an input with polarity and with >> an optional interrupt. >> >> Plain irqchip would work too in this case if there are no other GPIO >> specific features. Some other RTCs may have more GPIO like features. >> >> In any case, setting the ext_wakeup up as an irqchip means that the >> RTC controller can be used as a dedicated wakeirq with Linux :) > > It can't :( It can't generate IRQ when state of ext_wakeup line has > been changed. > >> >> Are you guys sure there's no wake pin events during runtime? AFAIK >> the RTCs just typically produce an interrupt when programmed to >> do so, they don't know the state of the SoC. >> > > I do not think that It can be fit in gpiochip or irqchip - > in my opinion right way is to proceed with bindings proposed by > Marcin in this patch v1. > > But, probably, it could fit in pinctrl: > - this is pin's configuration > - this is one-time configuration > - or - configuration which can be applied before suspend > and resorted after suspend. > > if you still wanna try some generic framework. > pinctrl bindings looks ok for our use case (enable/disable input, configure debounce), except I don't see any way to pass polarity (active low/high) to the driver. -- Marcin Niestroj -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com Received: from vk1046.megiteam.com.pl (2780.rev.megiteam.pl. [91.227.39.128]) by gmr-mx.google.com with ESMTP id k143si806469wmg.1.2016.04.12.10.25.15 for ; Tue, 12 Apr 2016 10:25:15 -0700 (PDT) Subject: [rtc-linux] Re: [PATCH] rtc: omap: Support ext_wakeup configuration To: Grygorii Strashko , Tony Lindgren References: <1459785403-1725-1-git-send-email-m.niestroj@grinn-global.com> <20160404224046.GA17042@atomide.com> <57078A89.3080809@ti.com> <20160408151408.GS16484@atomide.com> <5707E764.7050204@ti.com> Cc: rtc-linux@googlegroups.com, devicetree@vger.kernel.org, Rob Herring , Pawel Moll , Alessandro Zummo , Alexandre Belloni , Keerthy , linux-omap@vger.kernel.org, Dave Gerlach , "Menon, Nishanth" From: Marcin Niestroj Message-ID: <570D2F79.9040202@grinn-global.com> Date: Tue, 12 Apr 2016 19:25:13 +0200 MIME-Version: 1.0 In-Reply-To: <5707E764.7050204@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hi, On 08.04.2016 19:16, Grygorii Strashko wrote: > On 04/08/2016 06:14 PM, Tony Lindgren wrote: >> * Grygorii Strashko [160408 03:41]: >>> Hi Tony, >>> >>> On 04/05/2016 01:40 AM, Tony Lindgren wrote: >>>> Hi, >>>> >>>> * Marcin Niestroj [160404 08:57]: >>>>> Support configuration of ext_wakeup sources. This patch makes it >>>>> possible to enable ext_wakeup and set it's polarity, depending on board >>>>> configuration. AM335x's dedicated PMIC (tps65217) uses ext_wakeup to >>>>> notify about power-button presses. Handling power-button presses enables >>>>> to recover from RTC-only power states correctly. >>>> >>>> I suggest you just set this pin up as a minimal gpiochip. That way >>>> we can use the standard binding :) And if we get lucky, this pin can >>>> also trigger during runtime. >>>> >>> >>> Following my comments on v2 of this patch I propose to rollback to >>> this version of the patch. >>> >>> It seems doesn't fit in gpiochip, it's more likely irqchip, but since >>> rtc can't generate IRQ there are nor reasons for these genetic >>> experiments and RTC's specific bindings looks more suitable, at least for me. >> >> Hmm well gpiochips typically are irqchip too. IMO the generic binding >> here sounds like "gpio-wakeup" as it's an input with polarity and with >> an optional interrupt. >> >> Plain irqchip would work too in this case if there are no other GPIO >> specific features. Some other RTCs may have more GPIO like features. >> >> In any case, setting the ext_wakeup up as an irqchip means that the >> RTC controller can be used as a dedicated wakeirq with Linux :) > > It can't :( It can't generate IRQ when state of ext_wakeup line has > been changed. > >> >> Are you guys sure there's no wake pin events during runtime? AFAIK >> the RTCs just typically produce an interrupt when programmed to >> do so, they don't know the state of the SoC. >> > > I do not think that It can be fit in gpiochip or irqchip - > in my opinion right way is to proceed with bindings proposed by > Marcin in this patch v1. > > But, probably, it could fit in pinctrl: > - this is pin's configuration > - this is one-time configuration > - or - configuration which can be applied before suspend > and resorted after suspend. > > if you still wanna try some generic framework. > pinctrl bindings looks ok for our use case (enable/disable input, configure debounce), except I don't see any way to pass polarity (active low/high) to the driver. -- Marcin Niestroj -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.