Thread (1 message) 1 message, 1 author, 2016-10-23

Re: [PATCH 2/5] drivers: gpio: Add support for multiple IPs

From: Linus Walleij <hidden>
Date: 2016-10-23 10:32:21
Also in: linux-gpio, linux-omap

On Wed, Oct 19, 2016 at 7:33 AM, Keerthy [off-list ref] wrote:
From: Lokesh Vutla <redacted>

Update GPIO driver to support Multiple GPIO IPs.

Signed-off-by: Lokesh Vutla <redacted>
Signed-off-by: Keerthy <redacted>
This commit message is not at all describing what the patch is doing.

What it does is bumping the GPIO pin offset in the Linux global
GPIO number space with 32 for each new controller.
quoted hunk
+       static int bank_base;

        pdata = davinci_gpio_get_pdata(pdev);
        if (!pdata) {
@@ -226,7 +227,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
                chips[i].chip.direction_output = davinci_direction_out;
                chips[i].chip.set = davinci_gpio_set;

-               chips[i].chip.base = base;
+               chips[i].chip.base = bank_base;
+               bank_base += 32;
Why can you not rewrite the driver to pass -1 as base and
get a dynamic allocation of GPIO numbers instead? Then
you won't have this hairy problem.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help