]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] smc91x needs settable IRQ trigger type
authorDavid Brownell <david-b@pacbell.net>
Mon, 16 May 2005 15:53:52 +0000 (08:53 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 28 Jun 2005 03:08:09 +0000 (23:08 -0400)
For boards that invert the SMC91x IRQ line (maybe an FPGA inverts it),
the set_irq_type() call can't assume IRQT_RISING.  These particular
boards currently use OMAP-specific calls to change the trigger type,
but the boards break when set_irq_type() stops being a NOP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
drivers/net/smc91x.c
drivers/net/smc91x.h

index cfb9d3cdb04a593713df0fabcf2f8359bdbc1b4d..1438fdd20826487a0d8d0535143f484b1111a3be 100644 (file)
@@ -1998,7 +1998,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
        if (retval)
                goto err_out;
 
-       set_irq_type(dev->irq, IRQT_RISING);
+       set_irq_type(dev->irq, SMC_IRQ_TRIGGER_TYPE);
 
 #ifdef SMC_USE_PXA_DMA
        {
index 946528e6b742000523f6991cf7925f2c123a3b24..7089d86e857a6d0dbf62ad48742265fea34aa8f5 100644 (file)
@@ -182,6 +182,16 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 #define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
 #define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
 
+#include <asm/mach-types.h>
+#include <asm/arch/cpu.h>
+
+#define        SMC_IRQ_TRIGGER_TYPE (( \
+                  machine_is_omap_h2() \
+               || machine_is_omap_h3() \
+               || (machine_is_omap_innovator() && !cpu_is_omap150()) \
+       ) ? IRQT_FALLING : IRQT_RISING)
+
+
 #elif  defined(CONFIG_SH_SH4202_MICRODEV)
 
 #define SMC_CAN_USE_8BIT       0
@@ -300,6 +310,9 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
 
 #endif
 
+#ifndef        SMC_IRQ_TRIGGER_TYPE
+#define        SMC_IRQ_TRIGGER_TYPE    IRQT_RISING
+#endif
 
 #ifdef SMC_USE_PXA_DMA
 /*