[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLCcoh6rp11sMsZh@lizhi-Precision-Tower-5810>
Date: Thu, 28 Aug 2025 14:14:58 -0400
From: Frank Li <Frank.li@....com>
To: James Clark <james.clark@...aro.org>
Cc: Mark Brown <broonie@...nel.org>, Clark Wang <xiaoning.wang@....com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Larisa Grigore <larisa.grigore@....nxp.com>,
Larisa Grigore <larisa.grigore@....com>,
Ghennadi Procopciuc <ghennadi.procopciuc@....com>,
Ciprianmarian Costea <ciprianmarian.costea@....com>, s32@....com,
linux-spi@...r.kernel.org, imx@...ts.linux.dev,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v2 8/9] spi: spi-fsl-lpspi: Parameterize reading num-cs
from hardware
On Thu, Aug 28, 2025 at 11:14:47AM +0100, James Clark wrote:
> Add query_hw_for_num_cs in devtype to avoid directly checking compatible
> string "fsl,imx93-spi".
>
> No functionality change.
>
> Signed-off-by: James Clark <james.clark@...aro.org>
Reviewed-by: Frank Li <Frank.Li@....com>
> ---
> drivers/spi/spi-fsl-lpspi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
> index ea25e8dab0a4..ce347cdbb009 100644
> --- a/drivers/spi/spi-fsl-lpspi.c
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -87,6 +87,7 @@
>
> struct fsl_lpspi_devtype_data {
> u8 prescale_max : 3; /* 0 == no limit */
> + bool query_hw_for_num_cs : 1;
> };
>
> struct lpspi_config {
> @@ -137,6 +138,7 @@ struct fsl_lpspi_data {
> */
> static const struct fsl_lpspi_devtype_data imx93_lpspi_devtype_data = {
> .prescale_max = 1,
> + .query_hw_for_num_cs = true,
> };
>
> static const struct fsl_lpspi_devtype_data imx7ulp_lpspi_devtype_data = {
> @@ -932,7 +934,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
> fsl_lpspi->rxfifosize = 1 << ((temp >> 8) & 0x0f);
> if (of_property_read_u32((&pdev->dev)->of_node, "num-cs",
> &num_cs)) {
> - if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx93-spi"))
> + if (devtype_data->query_hw_for_num_cs)
> num_cs = ((temp >> 16) & 0xf);
> else
> num_cs = 1;
>
> --
> 2.34.1
>
Powered by blists - more mailing lists