From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Ni Subject: Re: How to get the irq flags from the dts file Date: Fri, 10 Aug 2012 17:14:58 +0800 Message-ID: <1344590098.21467.4.camel@tegra-chromium-2> References: <1344509006.2295.148.camel@tegra-chromium-2> <5023A88F.8040402@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5023A88F.8040402-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arend van Spriel Cc: "grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org" , "rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org" , "frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org" , "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org" , "brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org" , "linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: devicetree@vger.kernel.org On Thu, 2012-08-09 at 20:09 +0800, Arend van Spriel wrote: > On 08/09/2012 12:43 PM, Wei Ni wrote: > > Hi, all > > I'm working on tegra wlan upstream issue. > > The tegra board use the Broadcom 4329 as wlan device, and the driver is > > the brcmfmac. > > > > This wlan driver support out-band-interrupt (OOB), I want to add DT > > support to use this OOB. > > I can add following lines in the dts file to create platform device and > > pass the interrupt resource to the driver. > > > > wlan { > > compatible = "broadcome, brcmf_sdio_pd"; > > I don't know the DT syntax, but I assume broadcome should be broadcom, > right? ;-) Sorry, it's my typo, it should be broadcom. > > > interrupt-parten = <&gpio>; > > interrupts = <144, 0x04>; /* IRQF_TRIGGER_HIGH */ > > }; > > > > In the wlan driver, it will use platform_get_resource() to get the > > res->irq, res->flags, the irq number is right, but the flags will be > > IORESOURCE_IRQ, not the 0x04 (IRQF_TRIGGER_HIGH). > > The wlan driver wish this flags include the IRQF_TRGGER_* information, > > and it will use this flags to configure other hw settings. If it is > > wrong, the wlan can't work. > > > > I checked drivers/of/irq.c, in function of_irq_to_resource(), it will > > set r->flags = IORESOURCE_IRQ directly, not read the flags from the dtb > > file. And I didn't find any of_xx api to get this flags. > > > > How can I get this flags, does anyone has suggestion? > > I did a quick search in the kernel and there are a number of platform > drivers that seem to expect the IRQF_TRIGGER_* info by using (res->flags > & IRQF_TRIGGER_MASK) and to determine IRQF_SHARED as well. > > Gr. AvS >