X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/84296b55ed91435826d4c305d1f87c9e06566743..89e81be43317f8b2cd6da87a36d345f1c2955a9c:/package/broadcom-diag/src/gpio.h diff --git a/package/broadcom-diag/src/gpio.h b/package/broadcom-diag/src/gpio.h index 2284e9801..6b1b2ada4 100644 --- a/package/broadcom-diag/src/gpio.h +++ b/package/broadcom-diag/src/gpio.h @@ -5,6 +5,10 @@ #ifndef BCMDRIVER #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +#include +#define ssb ssb_bcm47xx +#endif extern struct ssb_bus ssb; @@ -51,11 +55,16 @@ static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *)) { int irq; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) + irq = gpio_to_irq(0); + if (irq == -EINVAL) return; +#else if (ssb.chipco.dev) irq = ssb_mips_irq(ssb.chipco.dev) + 2; else if (ssb.extif.dev) irq = ssb_mips_irq(ssb.extif.dev) + 2; else return; +#endif if (enabled) { if (request_irq(irq, handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, "gpio", handler))