All of lore.kernel.org
 help / color / mirror / Atom feed
* How to get the irq flags from the dts file
@ 2012-08-09 10:43 ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-09 10:43 UTC (permalink / raw)
  To: grant.likely, rob.herring, frankyl
  Cc: devicetree-discuss, brcm80211-dev-list, linux-wireless,
	linux-tegra, linux-kernel, linux-arm-kernel

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";
        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?

Thanks.
Wei.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-09 10:43 ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-09 10:43 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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";
        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?

Thanks.
Wei.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-09 10:43 ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-09 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

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";
        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?

Thanks.
Wei.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
  2012-08-09 10:43 ` Wei Ni
  (?)
@ 2012-08-09 11:48   ` Arnd Bergmann
  -1 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2012-08-09 11:48 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Wei Ni, grant.likely, rob.herring, frankyl, brcm80211-dev-list,
	devicetree-discuss, linux-wireless, linux-kernel, linux-tegra

On Thursday 09 August 2012, Wei Ni wrote:
> 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?

The driver should not need to know about thie flag. It gets read
by irq_create_of_mapping when calling teh xlate function and
gets set using irq_set_irq_type from there too.

	Arnd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-09 11:48   ` Arnd Bergmann
  0 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2012-08-09 11:48 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Wei Ni, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Thursday 09 August 2012, Wei Ni wrote:
> 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?

The driver should not need to know about thie flag. It gets read
by irq_create_of_mapping when calling teh xlate function and
gets set using irq_set_irq_type from there too.

	Arnd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-09 11:48   ` Arnd Bergmann
  0 siblings, 0 replies; 20+ messages in thread
From: Arnd Bergmann @ 2012-08-09 11:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 09 August 2012, Wei Ni wrote:
> 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?

The driver should not need to know about thie flag. It gets read
by irq_create_of_mapping when calling teh xlate function and
gets set using irq_set_irq_type from there too.

	Arnd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-09 12:05     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2012-08-09 12:05 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Wei Ni, linux-wireless, devicetree-discuss,
	brcm80211-dev-list, linux-kernel, rob.herring, frankyl,
	linux-tegra

On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> On Thursday 09 August 2012, Wei Ni wrote:

> > 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.

You can read the configuration with irqd_get_trigger_type() - see the OF
code in sound/soc/codecs/wm8903.c for an example.

> The driver should not need to know about thie flag. It gets read
> by irq_create_of_mapping when calling teh xlate function and
> gets set using irq_set_irq_type from there too.

That only helps the interrupt controller, it doesn't help the interrupt
source.  A good proportion of embedded devices have a great deal of
flexibility in how they signal interrupts so they need to know what mode
to pick.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-09 12:05     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2012-08-09 12:05 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Wei Ni,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> On Thursday 09 August 2012, Wei Ni wrote:

> > 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.

You can read the configuration with irqd_get_trigger_type() - see the OF
code in sound/soc/codecs/wm8903.c for an example.

> The driver should not need to know about thie flag. It gets read
> by irq_create_of_mapping when calling teh xlate function and
> gets set using irq_set_irq_type from there too.

That only helps the interrupt controller, it doesn't help the interrupt
source.  A good proportion of embedded devices have a great deal of
flexibility in how they signal interrupts so they need to know what mode
to pick.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-09 12:05     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2012-08-09 12:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> On Thursday 09 August 2012, Wei Ni wrote:

> > 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.

You can read the configuration with irqd_get_trigger_type() - see the OF
code in sound/soc/codecs/wm8903.c for an example.

> The driver should not need to know about thie flag. It gets read
> by irq_create_of_mapping when calling teh xlate function and
> gets set using irq_set_irq_type from there too.

That only helps the interrupt controller, it doesn't help the interrupt
source.  A good proportion of embedded devices have a great deal of
flexibility in how they signal interrupts so they need to know what mode
to pick.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
  2012-08-09 10:43 ` Wei Ni
  (?)
@ 2012-08-09 12:09   ` Arend van Spriel
  -1 siblings, 0 replies; 20+ messages in thread
From: Arend van Spriel @ 2012-08-09 12:09 UTC (permalink / raw)
  To: Wei Ni
  Cc: grant.likely, rob.herring, frankyl, devicetree-discuss,
	brcm80211-dev-list, linux-wireless, linux-tegra, linux-kernel,
	linux-arm-kernel

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? ;-)

>         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


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-09 12:09   ` Arend van Spriel
  0 siblings, 0 replies; 20+ messages in thread
From: Arend van Spriel @ 2012-08-09 12:09 UTC (permalink / raw)
  To: Wei Ni
  Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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? ;-)

>         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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-09 12:09   ` Arend van Spriel
  0 siblings, 0 replies; 20+ messages in thread
From: Arend van Spriel @ 2012-08-09 12:09 UTC (permalink / raw)
  To: linux-arm-kernel

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? ;-)

>         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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:11       ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, linux-arm-kernel, linux-wireless,
	devicetree-discuss, brcm80211-dev-list, linux-kernel,
	rob.herring, frankyl, linux-tegra

On Thu, 2012-08-09 at 20:05 +0800, Mark Brown wrote:
> On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> > On Thursday 09 August 2012, Wei Ni wrote:
> 
> > > 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.
> 
> You can read the configuration with irqd_get_trigger_type() - see the OF
> code in sound/soc/codecs/wm8903.c for an example.

I tried it, it worked fine. thanks for your help.

> 
> > The driver should not need to know about thie flag. It gets read
> > by irq_create_of_mapping when calling teh xlate function and
> > gets set using irq_set_irq_type from there too.
> 
> That only helps the interrupt controller, it doesn't help the interrupt
> source.  A good proportion of embedded devices have a great deal of
> flexibility in how they signal interrupts so they need to know what mode
> to pick.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:11       ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Thu, 2012-08-09 at 20:05 +0800, Mark Brown wrote:
> On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> > On Thursday 09 August 2012, Wei Ni wrote:
> 
> > > 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.
> 
> You can read the configuration with irqd_get_trigger_type() - see the OF
> code in sound/soc/codecs/wm8903.c for an example.

I tried it, it worked fine. thanks for your help.

> 
> > The driver should not need to know about thie flag. It gets read
> > by irq_create_of_mapping when calling teh xlate function and
> > gets set using irq_set_irq_type from there too.
> 
> That only helps the interrupt controller, it doesn't help the interrupt
> source.  A good proportion of embedded devices have a great deal of
> flexibility in how they signal interrupts so they need to know what mode
> to pick.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:11       ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, linux-arm-kernel, linux-wireless,
	devicetree-discuss, brcm80211-dev-list, linux-kernel,
	rob.herring, frankyl, linux-tegra

On Thu, 2012-08-09 at 20:05 +0800, Mark Brown wrote:
> On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> > On Thursday 09 August 2012, Wei Ni wrote:
> 
> > > 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.
> 
> You can read the configuration with irqd_get_trigger_type() - see the OF
> code in sound/soc/codecs/wm8903.c for an example.

I tried it, it worked fine. thanks for your help.

> 
> > The driver should not need to know about thie flag. It gets read
> > by irq_create_of_mapping when calling teh xlate function and
> > gets set using irq_set_irq_type from there too.
> 
> That only helps the interrupt controller, it doesn't help the interrupt
> source.  A good proportion of embedded devices have a great deal of
> flexibility in how they signal interrupts so they need to know what mode
> to pick.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-10  9:11       ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2012-08-09 at 20:05 +0800, Mark Brown wrote:
> On Thu, Aug 09, 2012 at 11:48:42AM +0000, Arnd Bergmann wrote:
> > On Thursday 09 August 2012, Wei Ni wrote:
> 
> > > 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.
> 
> You can read the configuration with irqd_get_trigger_type() - see the OF
> code in sound/soc/codecs/wm8903.c for an example.

I tried it, it worked fine. thanks for your help.

> 
> > The driver should not need to know about thie flag. It gets read
> > by irq_create_of_mapping when calling teh xlate function and
> > gets set using irq_set_irq_type from there too.
> 
> That only helps the interrupt controller, it doesn't help the interrupt
> source.  A good proportion of embedded devices have a great deal of
> flexibility in how they signal interrupts so they need to know what mode
> to pick.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:14     ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:14 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: grant.likely, rob.herring, frankyl, devicetree-discuss,
	brcm80211-dev-list, linux-wireless, linux-tegra, linux-kernel,
	linux-arm-kernel

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
> 



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:14     ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:14 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	frankyl-dY08KVG/lbpWk0Htik3J/w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to get the irq flags from the dts file
@ 2012-08-10  9:14     ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:14 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: grant.likely, rob.herring, frankyl, devicetree-discuss,
	brcm80211-dev-list, linux-wireless, linux-tegra, linux-kernel,
	linux-arm-kernel

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
> 



^ permalink raw reply	[flat|nested] 20+ messages in thread

* How to get the irq flags from the dts file
@ 2012-08-10  9:14     ` Wei Ni
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Ni @ 2012-08-10  9:14 UTC (permalink / raw)
  To: linux-arm-kernel

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
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-08-10  9:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-09 10:43 How to get the irq flags from the dts file Wei Ni
2012-08-09 10:43 ` Wei Ni
2012-08-09 10:43 ` Wei Ni
2012-08-09 11:48 ` Arnd Bergmann
2012-08-09 11:48   ` Arnd Bergmann
2012-08-09 11:48   ` Arnd Bergmann
2012-08-09 12:05   ` Mark Brown
2012-08-09 12:05     ` Mark Brown
2012-08-09 12:05     ` Mark Brown
2012-08-10  9:11     ` Wei Ni
2012-08-10  9:11       ` Wei Ni
2012-08-10  9:11       ` Wei Ni
2012-08-10  9:11       ` Wei Ni
2012-08-09 12:09 ` Arend van Spriel
2012-08-09 12:09   ` Arend van Spriel
2012-08-09 12:09   ` Arend van Spriel
2012-08-10  9:14   ` Wei Ni
2012-08-10  9:14     ` Wei Ni
2012-08-10  9:14     ` Wei Ni
2012-08-10  9:14     ` Wei Ni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.