From: Frank Li <Frank.li@nxp.com>
To: Jonas Rebmann <jre@pengutronix.de>
Cc: Mark Brown <broonie@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
kernel@pengutronix.de, linux-spi@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] spi: imx: pass struct spi_transfer to prepare_transfer()
Date: Wed, 13 Nov 2024 10:27:44 -0500 [thread overview]
Message-ID: <ZzTFcD+GQ9a443G0@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20241113-imx-spi-word-delay-v2-1-2b65b737bf29@pengutronix.de>
On Wed, Nov 13, 2024 at 01:18:31PM +0100, Jonas Rebmann wrote:
> In an upcoming patch, mx51_ecspi_prepare_transfer() needs access to the
> word_delay parameter. To enable controller-specific handling of such
> per-transfer parameters, extend the prepare_transfer() function of the
> spi_imx_devtype_data interface to take a struct spi_transfer argument,
> update all controller-specific implementations accordingly.
>
> Signed-off-by: Jonas Rebmann <jre@pengutronix.dei
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/spi/spi-imx.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> index 85bd1a82a34eb4bc76a4b4528e087fc2ebfa8b85..65a8303b80b1191cd2c19d61f88836e7fd3c7ae9 100644
> --- a/drivers/spi/spi-imx.c
> +++ b/drivers/spi/spi-imx.c
> @@ -71,7 +71,8 @@ struct spi_imx_data;
> struct spi_imx_devtype_data {
> void (*intctrl)(struct spi_imx_data *spi_imx, int enable);
> int (*prepare_message)(struct spi_imx_data *spi_imx, struct spi_message *msg);
> - int (*prepare_transfer)(struct spi_imx_data *spi_imx, struct spi_device *spi);
> + int (*prepare_transfer)(struct spi_imx_data *spi_imx, struct spi_device *spi,
> + struct spi_transfer *t);
> void (*trigger)(struct spi_imx_data *spi_imx);
> int (*rx_available)(struct spi_imx_data *spi_imx);
> void (*reset)(struct spi_imx_data *spi_imx);
> @@ -649,7 +650,7 @@ static void mx51_configure_cpha(struct spi_imx_data *spi_imx,
> }
>
> static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
> - struct spi_device *spi)
> + struct spi_device *spi, struct spi_transfer *t)
> {
> u32 ctrl = readl(spi_imx->base + MX51_ECSPI_CTRL);
> u32 clk;
> @@ -774,7 +775,7 @@ static int mx31_prepare_message(struct spi_imx_data *spi_imx,
> }
>
> static int mx31_prepare_transfer(struct spi_imx_data *spi_imx,
> - struct spi_device *spi)
> + struct spi_device *spi, struct spi_transfer *t)
> {
> unsigned int reg = MX31_CSPICTRL_ENABLE | MX31_CSPICTRL_HOST;
> unsigned int clk;
> @@ -878,7 +879,7 @@ static int mx21_prepare_message(struct spi_imx_data *spi_imx,
> }
>
> static int mx21_prepare_transfer(struct spi_imx_data *spi_imx,
> - struct spi_device *spi)
> + struct spi_device *spi, struct spi_transfer *t)
> {
> unsigned int reg = MX21_CSPICTRL_ENABLE | MX21_CSPICTRL_HOST;
> unsigned int max = is_imx27_cspi(spi_imx) ? 16 : 18;
> @@ -953,7 +954,7 @@ static int mx1_prepare_message(struct spi_imx_data *spi_imx,
> }
>
> static int mx1_prepare_transfer(struct spi_imx_data *spi_imx,
> - struct spi_device *spi)
> + struct spi_device *spi, struct spi_transfer *t)
> {
> unsigned int reg = MX1_CSPICTRL_ENABLE | MX1_CSPICTRL_HOST;
> unsigned int clk;
> @@ -1304,7 +1305,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
> spi_imx->target_burst = t->len;
> }
>
> - spi_imx->devtype_data->prepare_transfer(spi_imx, spi);
> + spi_imx->devtype_data->prepare_transfer(spi_imx, spi, t);
>
> return 0;
> }
>
> --
> 2.39.5
>
next prev parent reply other threads:[~2024-11-13 15:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 12:18 [PATCH v2 0/2] spi: imx: support word delay in ecspi Jonas Rebmann
2024-11-13 12:18 ` [PATCH v2 1/2] spi: imx: pass struct spi_transfer to prepare_transfer() Jonas Rebmann
2024-11-13 15:27 ` Frank Li [this message]
2024-11-13 12:18 ` [PATCH v2 2/2] spi: imx: support word delay Jonas Rebmann
2024-11-13 15:35 ` Frank Li
2024-11-15 21:53 ` Kees Bakker
2024-11-14 13:01 ` [PATCH v2 0/2] spi: imx: support word delay in ecspi Mark Brown
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=ZzTFcD+GQ9a443G0@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jre@pengutronix.de \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox