netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DM9000 interrupt is hardware dependant
@ 2006-09-04 20:17 Jürgen Schindele
  2006-09-04 20:46 ` Lennert Buytenhek
  2006-09-04 21:11 ` Francois Romieu
  0 siblings, 2 replies; 5+ messages in thread
From: Jürgen Schindele @ 2006-09-04 20:17 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

Hi developers,
i made a patch for an PXA270-evalboard with DM9000
ethernet contoller. The Interrupt can be high- or low-
active dependant of the wiring of the MDC-(57)pin.

Because of this hardware dependency you shoud be able
to configure this behaviour in "struct resource dm9000_resources[]"

Please comment an review my patch which is attached here

Thanksalot
Jürgen Schindele

[-- Attachment #2: trizeps4_dm9000.diff --]
[-- Type: text/x-diff, Size: 1209 bytes --]

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 24996da..0a71f7b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -598,10 +598,11 @@ static int
 dm9000_open(struct net_device *dev)
 {
 	board_info_t *db = (board_info_t *) dev->priv;
+	unsigned long sa_flags = resource_sa_flags(db->irq_res);
 
 	PRINTK2("entering dm9000_open\n");
 
-	if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev))
+	if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ | sa_flags, dev->name, dev))
 		return -EAGAIN;
 
 	/* Initialize DM9000 board */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index cd6bd00..2eebd91 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -54,6 +54,12 @@ #define IORESOURCE_IRQ_LOWEDGE		(1<<1)
 #define IORESOURCE_IRQ_HIGHLEVEL	(1<<2)
 #define IORESOURCE_IRQ_LOWLEVEL		(1<<3)
 
+/* this macro gets back SA_TRIGGER_* bits
+ * defined in include/linux/signal.h from
+ * resource->flags which are the same as 
+ * IORESOURCE_IRQ_* bits */
+#define resource_sa_flags(res)		((res)->flags & 0xf)
+
 /* ISA PnP DMA specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_DMA_TYPE_MASK	(3<<0)
 #define IORESOURCE_DMA_8BIT		(0<<0)

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

* Re: [PATCH] DM9000 interrupt is hardware dependant
  2006-09-04 20:17 Jürgen Schindele
@ 2006-09-04 20:46 ` Lennert Buytenhek
  2006-09-04 22:40   ` Ben Dooks
  2006-09-04 21:11 ` Francois Romieu
  1 sibling, 1 reply; 5+ messages in thread
From: Lennert Buytenhek @ 2006-09-04 20:46 UTC (permalink / raw)
  To: Jürgen Schindele; +Cc: netdev

On Mon, Sep 04, 2006 at 10:17:08PM +0200, Jürgen Schindele wrote:

> i made a patch for an PXA270-evalboard with DM9000
> ethernet contoller. The Interrupt can be high- or low-
> active dependant of the wiring of the MDC-(57)pin.
> 
> Because of this hardware dependency you shoud be able
> to configure this behaviour in "struct resource dm9000_resources[]"

Putting it in 'struct dm9000_plat_data' sounds like a much better
idea to me...

Overloading the IRQ number in 'struct resource' is just ugly.


cheers,
Lennert

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

* [PATCH] DM9000 interrupt is hardware dependant
@ 2006-09-04 21:07 Jürgen Schindele
  0 siblings, 0 replies; 5+ messages in thread
From: Jürgen Schindele @ 2006-09-04 21:07 UTC (permalink / raw)
  To: netdev

Hi developers,
i made a patch for an PXA270-evalboard with DM9000
ethernet contoller. The Interrupt can be high- or low-
active dependant of the wiring of the MDC-(57)pin.

Because of this hardware dependency you shoud be able
to configure this behaviour in "struct resource dm9000_resources[]"

Please comment an review my patch which is attached here

Thanksalot
Jürgen Schindele

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 24996da..0a71f7b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -598,10 +598,11 @@ static int
 dm9000_open(struct net_device *dev)
 {
        board_info_t *db = (board_info_t *) dev->priv;
+       unsigned long sa_flags = resource_sa_flags(db->irq_res);

        PRINTK2("entering dm9000_open\n");

-       if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev))
+       if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ | sa_flags, dev->name, dev))
                return -EAGAIN;

        /* Initialize DM9000 board */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index cd6bd00..2eebd91 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -54,6 +54,12 @@ #define IORESOURCE_IRQ_LOWEDGE               (1<<1)
 #define IORESOURCE_IRQ_HIGHLEVEL       (1<<2)
 #define IORESOURCE_IRQ_LOWLEVEL                (1<<3)

+/* this macro gets back SA_TRIGGER_* bits
+ * defined in include/linux/signal.h from
+ * resource->flags which are the same as
+ * IORESOURCE_IRQ_* bits */
+#define resource_sa_flags(res)         ((res)->flags & 0xf)
+
 /* ISA PnP DMA specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_DMA_TYPE_MASK       (3<<0)
 #define IORESOURCE_DMA_8BIT            (0<<0)

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

* Re: [PATCH] DM9000 interrupt is hardware dependant
  2006-09-04 20:17 Jürgen Schindele
  2006-09-04 20:46 ` Lennert Buytenhek
@ 2006-09-04 21:11 ` Francois Romieu
  1 sibling, 0 replies; 5+ messages in thread
From: Francois Romieu @ 2006-09-04 21:11 UTC (permalink / raw)
  To: Jürgen Schindele; +Cc: netdev

Jürgen Schindele <linux@schindele.name> :
[...]
> Please comment an review my patch which is attached here

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 24996da..0a71f7b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -598,10 +598,11 @@ static int
 dm9000_open(struct net_device *dev)
 {
 	board_info_t *db = (board_info_t *) dev->priv;
+	unsigned long sa_flags = resource_sa_flags(db->irq_res);
 
 	PRINTK2("entering dm9000_open\n");
 
-	if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev))
+	if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ | sa_flags, dev->name, dev))

SA_SHIRQ has been replaced by IRQF_SHARED.

Please check include/linux/interrupt.h in a recent kernel 2.6.18-rc kernel.

-- 
Ueimor

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

* Re: [PATCH] DM9000 interrupt is hardware dependant
  2006-09-04 20:46 ` Lennert Buytenhek
@ 2006-09-04 22:40   ` Ben Dooks
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Dooks @ 2006-09-04 22:40 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: J?rgen Schindele, netdev

On Mon, Sep 04, 2006 at 10:46:46PM +0200, Lennert Buytenhek wrote:
> On Mon, Sep 04, 2006 at 10:17:08PM +0200, J?rgen Schindele wrote:
> 
> > i made a patch for an PXA270-evalboard with DM9000
> > ethernet contoller. The Interrupt can be high- or low-
> > active dependant of the wiring of the MDC-(57)pin.
> > 
> > Because of this hardware dependency you shoud be able
> > to configure this behaviour in "struct resource dm9000_resources[]"
> 
> Putting it in 'struct dm9000_plat_data' sounds like a much better
> idea to me...
> 
> Overloading the IRQ number in 'struct resource' is just ugly.

My view is that this would be useful to a number of drivers, and
is a good use of the resource flags for drivers which do not
currently have platform data.

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

end of thread, other threads:[~2006-09-04 22:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-04 21:07 [PATCH] DM9000 interrupt is hardware dependant Jürgen Schindele
  -- strict thread matches above, loose matches on Subject: below --
2006-09-04 20:17 Jürgen Schindele
2006-09-04 20:46 ` Lennert Buytenhek
2006-09-04 22:40   ` Ben Dooks
2006-09-04 21:11 ` Francois Romieu

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