Re: [PATCH v2] gpio: make driver mcp23s08 to support both device tree and platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Fri, Aug 29, 2014 at 8:29 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> On Tue, Aug 26, 2014 at 12:28 PM, Sonic Zhang <sonic.adi@xxxxxxxxx> wrote:
>
>> From: Sonic Zhang <sonic.zhang@xxxxxxxxxx>
>>
>> Device tree is not enabled in some archtecture where gpio driver mcp23s08
>> is still required.
>>
>> Signed-off-by: Sonic Zhang <sonic.zhang@xxxxxxxxxx>
>>
>> v2-changes:
>> - Parse device tree properties into platform data other than individual variables.
>
> (...)
>> +#ifdef CONFIG_OF
>>         mcp->irq_domain = irq_domain_add_linear(chip->of_node, chip->ngpio,
>>                                                 &irq_domain_simple_ops, mcp);
>> +#else
>> +       mcp->irq_domain = irq_domain_add_linear(NULL, chip->ngpio,
>> +                                               &irq_domain_simple_ops, mcp);
>> +#endif
>
> Argh this doesn't look good.
>
> Cut the #ifdef and do this:
>
> mcp->irq_domain = irq_domain_add_linear(chip->dev->of_node, chip->ngpio,
>                                    &irq_domain_simple_ops, mcp);
>
> Because the struct device * always has an of_node which is NULL
> when OF is not used.

OK.

>
>>         /* configure ~100K pullups */
>> -       status = mcp->ops->write(mcp, MCP_GPPU, pullups);
>> +       status = mcp->ops->write(mcp, MCP_GPPU, pdata->chip[cs].pullups);
>
> Extending a non-pincontrol pin control interface, grrr.
>
> Well I just have to live with it.
>
> Now how was it: is this driver impossible to convert to GPIOLIB_IRQCHIP?
>
I guess this should be a different patch from the owner of gpio-mcp23s08?


Thanks,

Sonic Zhang
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux