All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Dong Aisheng <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-gpio@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v4 2/3] pinctrl: scmi: add blocklist
Date: Tue, 7 May 2024 14:14:33 -0500	[thread overview]
Message-ID: <20240507191433.GA908134-robh@kernel.org> (raw)
In-Reply-To: <20240505-pinctrl-scmi-oem-v3-v4-2-7c99f989e9ba@nxp.com>

On Sun, May 05, 2024 at 11:47:18AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX95 will have its own pinctrl scmi driver, so need block
> pinctrl-scmi driver for i.MX95, otherwise there will be two pinctrl
> devices for a single scmi protocol@19.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/pinctrl/pinctrl-scmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c
> index 036bc1e3fc6c..331ca20ac68b 100644
> --- a/drivers/pinctrl/pinctrl-scmi.c
> +++ b/drivers/pinctrl/pinctrl-scmi.c
> @@ -11,6 +11,7 @@
>  #include <linux/errno.h>
>  #include <linux/module.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/of.h>
>  #include <linux/scmi_protocol.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
> @@ -504,6 +505,11 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx,
>  	return 0;
>  }
>  
> +static const struct of_device_id scmi_pinctrl_blocklist[] = {
> +	{ .compatible = "fsl,imx95", },
> +	{ }
> +};
> +
>  static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  {
>  	int ret;
> @@ -511,10 +517,14 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  	struct scmi_pinctrl *pmx;
>  	const struct scmi_handle *handle;
>  	struct scmi_protocol_handle *ph;
> +	struct device_node *np __free(device_node) = of_find_node_by_path("/");
>  
>  	if (!sdev->handle)
>  		return -EINVAL;
>  
> +	if (of_match_node(scmi_pinctrl_blocklist, np))
> +		return -ENODEV;

Use of_machine_compatible_match() instead.

> +
>  	handle = sdev->handle;
>  
>  	pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph);
> 
> -- 
> 2.37.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Dong Aisheng <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-gpio@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v4 2/3] pinctrl: scmi: add blocklist
Date: Tue, 7 May 2024 14:14:33 -0500	[thread overview]
Message-ID: <20240507191433.GA908134-robh@kernel.org> (raw)
In-Reply-To: <20240505-pinctrl-scmi-oem-v3-v4-2-7c99f989e9ba@nxp.com>

On Sun, May 05, 2024 at 11:47:18AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX95 will have its own pinctrl scmi driver, so need block
> pinctrl-scmi driver for i.MX95, otherwise there will be two pinctrl
> devices for a single scmi protocol@19.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/pinctrl/pinctrl-scmi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c
> index 036bc1e3fc6c..331ca20ac68b 100644
> --- a/drivers/pinctrl/pinctrl-scmi.c
> +++ b/drivers/pinctrl/pinctrl-scmi.c
> @@ -11,6 +11,7 @@
>  #include <linux/errno.h>
>  #include <linux/module.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/of.h>
>  #include <linux/scmi_protocol.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
> @@ -504,6 +505,11 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx,
>  	return 0;
>  }
>  
> +static const struct of_device_id scmi_pinctrl_blocklist[] = {
> +	{ .compatible = "fsl,imx95", },
> +	{ }
> +};
> +
>  static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  {
>  	int ret;
> @@ -511,10 +517,14 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  	struct scmi_pinctrl *pmx;
>  	const struct scmi_handle *handle;
>  	struct scmi_protocol_handle *ph;
> +	struct device_node *np __free(device_node) = of_find_node_by_path("/");
>  
>  	if (!sdev->handle)
>  		return -EINVAL;
>  
> +	if (of_match_node(scmi_pinctrl_blocklist, np))
> +		return -ENODEV;

Use of_machine_compatible_match() instead.

> +
>  	handle = sdev->handle;
>  
>  	pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph);
> 
> -- 
> 2.37.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-05-07 19:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-05  3:47 [PATCH v4 0/3] pinctrl: scmi: support i.MX95 OEM extensions Peng Fan (OSS)
2024-05-05  3:47 ` Peng Fan (OSS)
2024-05-05  3:47 ` [PATCH v4 1/3] dt-bindings: firmware: arm,scmi: Add properties for i.MX95 Pinctrl " Peng Fan (OSS)
2024-05-05  3:47   ` Peng Fan (OSS)
2024-05-07 19:11   ` Rob Herring
2024-05-07 19:11     ` Rob Herring
2024-05-05  3:47 ` [PATCH v4 2/3] pinctrl: scmi: add blocklist Peng Fan (OSS)
2024-05-05  3:47   ` Peng Fan (OSS)
2024-05-07 19:14   ` Rob Herring [this message]
2024-05-07 19:14     ` Rob Herring
2024-05-05  3:47 ` [PATCH v4 3/3] pinctrl: imx: support SCMI pinctrl protocol for i.MX95 Peng Fan (OSS)
2024-05-05  3:47   ` Peng Fan (OSS)
2024-05-11 19:29   ` Andy Shevchenko
2024-05-11 19:29     ` Andy Shevchenko
2024-05-13  9:09     ` Peng Fan
2024-05-13  9:09       ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240507191433.GA908134-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=aisheng.dong@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.