On 24/10/2021 19.18, Joey Gouly wrote:
This driver adds support for the pinctrl / GPIO hardware found on some Apple SoCs. Co-developed-by: Stan Skowronek <stan@xxxxxxxxxxxxx> Signed-off-by: Stan Skowronek <stan@xxxxxxxxxxxxx> Signed-off-by: Joey Gouly <joey.gouly@xxxxxxx> ---
[snip]
+/* GPIO chip functions */ + +static int apple_gpio_gpio_get_direction(struct gpio_chip *chip, + unsigned int offset)
Nit: do we really need to gpio_gpio all the things? I think maz already mentioned this one.
+ for (i = 0; i < npins; i++) { + res = pinctrl_generic_add_group(pctl->pctldev, pins[i].name, + pin_nums + i, 1, pctl); + if (res < 0) + return dev_err_probe(pctl->dev, res, + "Failed to register group"); + } + + res = pinmux_generic_add_function(pctl->pctldev, "gpio", pin_names, + npins, pctl); + if (res < 0) + return dev_err_probe(pctl->dev, res, + "Failed to register function."); + + res = pinmux_generic_add_function(pctl->pctldev, "periph", pin_names, + npins, pctl);
Since we have up to 3 peripheral functions I guess this should be done thrice, as "periph0" - "periph2" (or maybe 1-3 if you prefer the 1-indexed version, as it matches the selector).
AFAICT this doesn't have DT impact though, so it's not a big deal since right now I don't think we use any functions > 1.
-- Hector Martin (marcan@xxxxxxxxx) Public Key: https://mrcn.st/pub