netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] smsc911x: add irq_flags in smsc911x_platform_config.
@ 2009-01-14  5:21 Stanley.Miao
  2009-01-14 17:06 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Stanley.Miao @ 2009-01-14  5:21 UTC (permalink / raw)
  To: netdev; +Cc: steve.glendinning, linux-arm-kernel

When calling request IRQ it is desirable to allow platforms
to specific flags for the call to request_irq. Adding irq_flags
to smsc911x_platform_config allows these flags to be passed.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 drivers/net/smsc911x.c   |    6 ++++--
 include/linux/smsc911x.h |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index f513bdf..1092517 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1896,6 +1896,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	unsigned int intcfg = 0;
 	int res_size;
 	int retval;
+	irq_flags;
 	DECLARE_MAC_BUF(mac);
 
 	pr_info("%s: Driver version %s.\n", SMSC_CHIPNAME, SMSC_DRV_VERSION);
@@ -1968,8 +1969,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	smsc911x_reg_write(pdata, INT_EN, 0);
 	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
 
-	retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED,
-			     dev->name, dev);
+	irq_flags = IRQF_DISABLED | pdata->config.irq_flags;
+	retval = request_irq(dev->irq, smsc911x_irqhandler, irq_flags,
+				dev->name, dev);
 	if (retval) {
 		SMSC_WARNING(PROBE,
 			"Unable to claim requested irq: %d", dev->irq);
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 1cbf031..0330f57 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -28,6 +28,7 @@
 struct smsc911x_platform_config {
 	unsigned int irq_polarity;
 	unsigned int irq_type;
+	unsigned int irq_flags;
 	unsigned int flags;
 	phy_interface_t phy_interface;
 };
-- 
1.5.6.3


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

* Re: [PATCH] smsc911x: add irq_flags in smsc911x_platform_config.
  2009-01-14  5:21 [PATCH] smsc911x: add irq_flags in smsc911x_platform_config Stanley.Miao
@ 2009-01-14 17:06 ` Russell King - ARM Linux
  2009-01-15  2:16   ` stanley.miao
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2009-01-14 17:06 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: netdev, steve.glendinning, linux-arm-kernel

On Wed, Jan 14, 2009 at 01:21:52PM +0800, Stanley.Miao wrote:
> When calling request IRQ it is desirable to allow platforms
> to specific flags for the call to request_irq. Adding irq_flags
> to smsc911x_platform_config allows these flags to be passed.
> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  drivers/net/smsc911x.c   |    6 ++++--
>  include/linux/smsc911x.h |    1 +
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> index f513bdf..1092517 100644
> --- a/drivers/net/smsc911x.c
> +++ b/drivers/net/smsc911x.c
> @@ -1896,6 +1896,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  	unsigned int intcfg = 0;
>  	int res_size;
>  	int retval;
> +	irq_flags;

This looks wrong.

>  	DECLARE_MAC_BUF(mac);
>  
>  	pr_info("%s: Driver version %s.\n", SMSC_CHIPNAME, SMSC_DRV_VERSION);
> @@ -1968,8 +1969,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  	smsc911x_reg_write(pdata, INT_EN, 0);
>  	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
>  
> -	retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED,
> -			     dev->name, dev);
> +	irq_flags = IRQF_DISABLED | pdata->config.irq_flags;
> +	retval = request_irq(dev->irq, smsc911x_irqhandler, irq_flags,
> +				dev->name, dev);

If you need shared interrupt support, pass always pass IRQF_SHARED.
IRQF_SHARED and IRQF_DISABLED are a property of the driver.

Edge/level configuration should come from the struct resource.

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

* Re: [PATCH] smsc911x: add irq_flags in smsc911x_platform_config.
  2009-01-14 17:06 ` Russell King - ARM Linux
@ 2009-01-15  2:16   ` stanley.miao
  0 siblings, 0 replies; 3+ messages in thread
From: stanley.miao @ 2009-01-15  2:16 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: netdev, steve.glendinning, linux-arm-kernel

On Wed, 2009-01-14 at 17:06 +0000, Russell King - ARM Linux wrote:
> On Wed, Jan 14, 2009 at 01:21:52PM +0800, Stanley.Miao wrote:
> > When calling request IRQ it is desirable to allow platforms
> > to specific flags for the call to request_irq. Adding irq_flags
> > to smsc911x_platform_config allows these flags to be passed.
> > 
> > Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> > ---
> >  drivers/net/smsc911x.c   |    6 ++++--
> >  include/linux/smsc911x.h |    1 +
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> > index f513bdf..1092517 100644
> > --- a/drivers/net/smsc911x.c
> > +++ b/drivers/net/smsc911x.c
> > @@ -1896,6 +1896,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
> >  	unsigned int intcfg = 0;
> >  	int res_size;
> >  	int retval;
> > +	irq_flags;
> 
> This looks wrong.

Sorry, I have send the V2 version. I should send a notice to ignore this
email.

Stanley


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

end of thread, other threads:[~2009-01-15  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14  5:21 [PATCH] smsc911x: add irq_flags in smsc911x_platform_config Stanley.Miao
2009-01-14 17:06 ` Russell King - ARM Linux
2009-01-15  2:16   ` stanley.miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).