[PATCH] of_mmc_spi: add card detect irq support
Esben Haabendal
esbenhaabendal at gmail.com
Tue Aug 31 02:04:51 EST 2010
Hi
Comments below, and updated patch attached.
On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru at gmail.com> wrote:
>>> +static int of_mmc_spi_init(struct device *dev,
>> + irqreturn_t (*irqhandler)(int, void *), void *mmc)
>> +{
>> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Please add an empty line here.
Ok.
>> + return request_threaded_irq(
>> + oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
>
> I'd write it this way:
>
> return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
> 0, dev_name(dev), mmc);
>
> But that's a matter of taste.
Fine with me.
>> +}
>> +
>> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
>> +{
>> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Empty line.
Ok.
>> + free_irq(oms->detect_irq, mmc);
>> +}
>> +
>> struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>> {
>> struct device *dev = &spi->dev;
>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>> *mmc_spi_get_pdata(struct spi_device *spi)
>> if (gpio_is_valid(oms->gpios[WP_GPIO]))
>> oms->pdata.get_ro = of_mmc_spi_get_ro;
>>
>> - /* We don't support interrupts yet, let's poll. */
>> - oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
>> + oms->detect_irq = irq_of_parse_and_map(np, 0);
>> + if (oms->detect_irq != 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.
Hopefully, arm users will soon enjoy this driver/wrapper soon also.
>> + oms->pdata.init = of_mmc_spi_init;
>> + oms->pdata.exit = of_mmc_spi_exit;
>> + }
>> + else {
>
> } else {
Done.
> Plus, please add an appropriate interrupts = <> bindings into
> Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.
Done.
> And on the next resend, be sure to add Andrew Morton
> <akpm at linux-foundation.org>, David Brownell
> <dbrownell at users.sourceforge.net>, and linux-mmc at vger.kernel.org
> the Cc list.
Should be there now.
/Esben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-of_mmc_spi-add-card-detect-irq-support.patch
Type: text/x-patch
Size: 2868 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20100830/7a202237/attachment.bin>
More information about the Linuxppc-dev
mailing list