summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-rza1.c
AgeCommit message (Collapse)Author
2017-10-09pinctrl: rza1: Add support for RZ/A1LChris Brandt
Aspects like the number of ports and the location where peripherals are brought out differ between the RZ/A1H and RZ/A1L. Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2017-08-31pinctrl: rza1: Remove suffix from gpiochip labelJacopo Mondi
The OF node name already contains the gpio chip identifier, no need to append it when creating the label. The following debug message clearly shows the suffix is not required "pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-0-0 with 6 pins" Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-31pinctrl: rza1: off by one in rza1_parse_gpiochip()Dan Carpenter
The rza1_pctl->ports[] array has RZA1_NPORTS (12) elements. The > here should be >= to prevent an out of bounds access. Fixes: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-22pinctrl: rza1: constify pinconf_ops, pinctrl_ops, and pinmux_ops structuresJulia Lawall
This pinmux_ops structure is only stored in the const pmxops field of a pinctrl_desc structure. Make the pinmux_ops structure const as well. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-14pinctrl: rza1: constify gpio_chip structureGustavo A. R. Silva
This structure is only used to copy into other structure, so declare it as const. This issue was detected using Coccinelle and the following semantic patch: @r disable optional_qualifier@ identifier i; position p; @@ static struct gpio_chip i@p = { ... }; @ok@ identifier r.i; expression e; position p; @@ e = i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct gpio_chip e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct gpio_chip i = { ... }; In the following log you can see a significant difference in the code size and data segment, hence in the dec segment. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 11866 3520 128 15514 3c9a drivers/pinctrl/pinctrl-rza1.o after: text data bss dec hex filename 11539 3464 128 15131 3b1b drivers/pinctrl/pinctrl-rza1.o Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-06-30pinctrl: rza1: make structures rza1_gpiochip_template and rza1_pinmux_ops staticColin Ian King
structures rza1_gpiochip_template and rza1_pinmux_ops do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'rza1_gpiochip_template' was not declared. Should it be static? symbol 'rza1_pinmux_ops' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-06-30pinctrl: rza1: Remove unneeded wrong check for wrong variableGeert Uytterhoeven
Depending on compiler version: drivers/pinctrl/pinctrl-rza1.c: In function ‘rza1_pinctrl_probe’: drivers/pinctrl/pinctrl-rza1.c:1260:5: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret) ^ Indeed, the result returned by platform_get_resource() was stored in "res", not "ret". In addition, the correct error check would be "if (!res)", as platform_get_resource() does not return an error code, but returns NULL on failure. However, as devm_ioremap_resource() verifies the validity of the passed resource pointer anyway, the check can just be removed. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 5a49b644b3075f88 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-06-23pinctrl: Renesas RZ/A1 pin and gpio controllerJacopo Mondi
Add combined gpio and pin controller driver for Renesas RZ/A1 r7s72100 SoC. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>