netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jürgen Schindele" <linux@schindele.name>
To: netdev@vger.kernel.org
Subject: [PATCH] DM9000 interrupt is hardware dependant
Date: Mon, 4 Sep 2006 22:17:08 +0200	[thread overview]
Message-ID: <200609042217.09004.linux@schindele.name> (raw)

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

             reply	other threads:[~2006-09-04 20:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04 20:17 Jürgen Schindele [this message]
2006-09-04 20:46 ` [PATCH] DM9000 interrupt is hardware dependant Lennert Buytenhek
2006-09-04 22:40   ` Ben Dooks
2006-09-04 21:11 ` Francois Romieu
  -- strict thread matches above, loose matches on Subject: below --
2006-09-04 21:07 Jürgen Schindele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609042217.09004.linux@schindele.name \
    --to=linux@schindele.name \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).