Re: [PATCH] of_mmc_spi: add card detect irq support
From: Grant Likely <hidden>
Date: 2010-08-30 17:46:39
Also in:
linux-mmc
On Mon, Aug 30, 2010 at 10:04 AM, Esben Haabendal [off-list ref] wrote:
On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov [off-list ref]=
wrote:
quoted
quoted
@@ -121,8 +136,14 @@ struct mmc_spi_platform_data*mmc_spi_get_pdata(struct spi_device *spi) =A0 =A0 =A0 =A0 if (gpio_is_valid(oms->gpios[WP_GPIO])) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 oms->pdata.get_ro =3D of_mmc_spi_get_ro=
;
quoted
quoted
- =A0 =A0 =A0 /* We don't support interrupts yet, let's poll. */ - =A0 =A0 =A0 oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL; + =A0 =A0 =A0 oms->detect_irq =3D irq_of_parse_and_map(np, 0); + =A0 =A0 =A0 if (oms->detect_irq !=3D NO_IRQ) {I'd write "if (oms->detect_irq)", which is a bit more natural (and still correct, 0 is the only invalid VIRQ number).Most other architectures has NO_IRQ defined to -1, so I will stick with the NO_IRQ comparsion.
Not true. NO_IRQ is only defined as -1 on ARM, microblaze, mn10300 and parisc, and I've got a patch pending to remove microblaze from that list. ARM just happens to be a really big user. $ git grep NO_IRQ arch/*/include (I've trimmed the irrelevant matches) arch/arm/include/asm/irq.h:#ifndef NO_IRQ arch/arm/include/asm/irq.h:#define NO_IRQ ((unsigned int)(-1)) arch/microblaze/include/asm/irq.h:#define NO_IRQ (-1) arch/mn10300/include/asm/irq.h:#define NO_IRQ INT_MAX arch/parisc/include/asm/irq.h:#define NO_IRQ (-1) arch/powerpc/include/asm/irq.h:#define NO_IRQ (0)
Hopefully, arm users will soon enjoy this driver/wrapper soon also.
My hope is that even on ARM when the device tree is used I'll be able eliminate IRQs mapped to 0 (but I need to do a lot more research on how best to do that though). Are you actually using this on ARM? I'm okay with you keeping the NO_IRQ test for the short term though. g.