DM9000 interrupt is hardware dependant
Subsystems (2)
PATCH 1/1 DM9000 interrupt is hardware dependant
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
drivers/net/dm9000.c +2 -1
@@ -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 */
include/linux/ioport.h +6 -0
@@ -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)
Quoted 6 lines · Jürgen Schindele
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
Jürgen Schindele <[email protected]> :
[...]
Quoted 1 line
Please comment an review my patch which is attached here
drivers/net/dm9000.c +2 -1
@@ -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.
Signature · 1 line
Ueimor
Quoted 6 lines · Lennert Buytenhek
Quoted 4 lines · J?rgen Schindele
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.
Quoted 7 lines
Quoted 2 lines
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.
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/) 'a smiley only costs 4 bytes'