[PATCH v8 08/10] pinctrl: s32cc: implement GPIO functionality
Vincent Guittot
vincent.guittot at linaro.org
Fri Jan 23 05:56:09 PST 2026
On Tue, 20 Jan 2026 at 12:59, Khristine Andreea Barbulescu
<khristineandreea.barbulescu at oss.nxp.com> wrote:
>
> From: Andrei Stefanescu <andrei.stefanescu at oss.nxp.com>
>
> Add basic GPIO functionality (request, free, get, set) for the existing
> pinctrl SIUL2 driver since the hardware for pinctrl&GPIO is tightly
> coupled.
>
> Also, remove pinmux_ops which are no longer needed.
>
> Signed-off-by: Andrei Stefanescu <andrei.stefanescu at oss.nxp.com>
[..]
> @@ -1068,5 +1318,42 @@ int s32_pinctrl_probe(struct platform_device *pdev,
>
> dev_info(&pdev->dev, "Initialized S32 pinctrl driver\n");
>
> +
> + /* Legacy bindings only cover pinctrl functionality. */
> + if (soc_data->legacy)
> + return 0;
> +
> + mfd = dev_get_drvdata(pdev->dev.parent);
> + if (!mfd)
> + return dev_err_probe(&pdev->dev, -EINVAL, "Invalid parent!\n");
> +
> + gc = &ipctl->gc;
> + gc->parent = &pdev->dev;
> + gc->label = dev_name(&pdev->dev);
> + gc->base = -1;
> + /* In some cases, there is a gap between the SIUL GPIOs. */
> + gc->ngpio = mfd->siul2[mfd->num_siul2 - 1].gpio_base +
> + mfd->siul2[mfd->num_siul2 - 1].gpio_num;
> + ret = s32_gpio_populate_names(&pdev->dev, ipctl);
> + if (ret)
> + return ret;
> +
> + gc->set = s32_gpio_set;
> + gc->get = s32_gpio_get;
> + gc->set_config = gpiochip_generic_config;
> + gc->request = s32_gpio_request;
> + gc->free = s32_gpio_free;
> + gc->direction_output = s32_gpio_dir_out;
> + gc->direction_input = s32_gpio_dir_in;
> + gc->get_direction = s32_gpio_get_dir;
> + gc->init_valid_mask = s32_init_valid_mask;
> +
> + ret = devm_gpiochip_add_data(&pdev->dev, gc, ipctl);
Your mfd child device doesn't have a DT node, only its parent has one.
How do you point to the gpio controller in DT with a phandle ?
You probably need to create a child DT node
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "Unable to add gpiochip\n");
> +
> + dev_info(&pdev->dev, "Initialized s32 GPIO functionality\n");
> +
> return 0;
> }
> --
> 2.50.1
>
More information about the linux-arm-kernel
mailing list