[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3Q0XGA9li-nVcum@pluto>
Date: Tue, 31 Dec 2024 18:13:48 +0000
From: Cristian Marussi <cristian.marussi@....com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: Sudeep Holla <sudeep.holla@....com>,
Cristian Marussi <cristian.marussi@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Saravana Kannan <saravanak@...gle.com>,
Linus Walleij <linus.walleij@...aro.org>,
Dong Aisheng <aisheng.dong@....com>,
Fabio Estevam <festevam@...il.com>, Shawn Guo <shawnguo@...nel.org>,
Jacky Bai <ping.bai@....com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Sascha Hauer <s.hauer@...gutronix.de>, arm-scmi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, imx@...ts.linux.dev,
Peng Fan <peng.fan@....com>
Subject: Re: [PATCH 2/4] firmware: arm_scmi: bus: Bypass setting fwnode for
pinctrl
On Wed, Dec 25, 2024 at 04:20:45PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
>
> pinctrl-scmi.c and pinctrl-imx-scmi.c, both use SCMI_PROTOCOL_PINCTRL.
> If both drivers are built in, and the scmi device with name "pinctrl-imx"
> is created earlier, and the fwnode device points to the scmi device,
> non-i.MX platforms will never have the pinctrl supplier ready.
>
> So bypass setting fwnode for scmi pinctrl devices that non
> compatible with socs.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
> drivers/firmware/arm_scmi/bus.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index 12190d4dabb65484543044b4424fbe3b67245466..87665b09c8ff492953c8300f80ed73eab6cce4fd 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -345,6 +345,11 @@ static void __scmi_device_destroy(struct scmi_device *scmi_dev)
> device_unregister(&scmi_dev->dev);
> }
>
> +static const char * const scmi_pinctrl_imx_lists[] = {
> + "fsl,imx95",
> + NULL
> +};
> +
> static int
> __scmi_device_set_node(struct scmi_device *scmi_dev, struct device_node *np,
> int protocol, const char *name)
> @@ -353,6 +358,15 @@ __scmi_device_set_node(struct scmi_device *scmi_dev, struct device_node *np,
> if ((protocol == SCMI_PROTOCOL_PERF) && !strcmp(name, "cpufreq"))
> return 0;
>
> + if (protocol == SCMI_PROTOCOL_PINCTRL) {
> + if (!strcmp(name, "pinctrl") &&
> + of_machine_compatible_match(scmi_pinctrl_imx_lists))
> + return 0;
> + if (!strcmp(name, "pinctrl-imx") &&
> + !of_machine_compatible_match(scmi_pinctrl_imx_lists))
> + return 0;
> + }
...and same here, you could set a flag scmi_dev->avoid_devlink and
just avoid calling device_link_add instead of killing the device_node...
Thanks,
Cristian
Powered by blists - more mailing lists