Re: [PATCH 2/4] pinctrl: intel: expose software nodes for baytrail GPIO devices

From: Andy Shevchenko

Date: Fri Mar 20 2026 - 06:40:49 EST


On Thu, Mar 19, 2026 at 05:10:55PM +0100, Bartosz Golaszewski wrote:
> Use the new automatic secondary fwnode API to ensure that when the
> baytrail pinctrl device is added to the platform bus, the static
> software node provided for drivers not able to use ACPI will get
> automatically assigned as the secondary fwnode of the primary ACPI node.
>
> Create a new header under linux/pinctrl/ containing intel-specific
> symbols and declare the new variables there.

As I read the code, this doesn't need to be part of drivers/pinctrl/intel/.
I.o.w. I am unable to see why we need to penetrate the certain pinctrl
driver for this.

...

> static int __init byt_gpio_init(void)
> {
> - return platform_driver_register(&byt_gpio_driver);
> + int ret;
> +
> + ret = software_node_register_auto_secondary(&byt_auto_secondary);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&byt_gpio_driver);
> + if (ret)
> + software_node_unregister_auto_secondary(&byt_auto_secondary);
> +
> + return ret;
> }

This hack can be done in similar way on how we do ACPI LPSS for those
platforms, i.e. in drivers/acpi/x86/lpss.c. No?

--
With Best Regards,
Andy Shevchenko