Thread (44 messages) 44 messages, 10 authors, 2026-03-31

Re: [PATCH v8 08/10] pinctrl: s32cc: implement GPIO functionality

From: Vincent Guittot <vincent.guittot@linaro.org>
Date: 2026-01-23 13:56:22
Also in: imx, linux-devicetree, linux-gpio, lkml

On Tue, 20 Jan 2026 at 12:59, Khristine Andreea Barbulescu
[off-list ref] wrote:
From: Andrei Stefanescu <redacted>

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 <redacted>
[..]
quoted hunk ↗ jump to hunk
@@ -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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help