[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFrSgJ5xZfccEX9x@lizhi-Precision-Tower-5810>
Date: Tue, 24 Jun 2025 12:29:52 -0400
From: Frank Li <Frank.li@....com>
To: James Clark <james.clark@...aro.org>
Cc: Vladimir Oltean <olteanv@...il.com>, Mark Brown <broonie@...nel.org>,
Vladimir Oltean <vladimir.oltean@....com>,
Arnd Bergmann <arnd@...db.de>,
Larisa Grigore <larisa.grigore@....com>,
Christoph Hellwig <hch@....de>, linux-spi@...r.kernel.org,
imx@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/6] spi: spi-fsl-dspi: Stub out DMA functions
On Tue, Jun 24, 2025 at 11:35:33AM +0100, James Clark wrote:
> This will allow the build to succeed with !CONFIG_HAS_DMA, either due to
> a randconfig build test or when the target only uses one of the non-DMA
I supposed you met kbuild error. If yes, can you add kbuild build report
tags.
Frank
> transfer modes which this driver supports.
>
> Signed-off-by: James Clark <james.clark@...aro.org>
> ---
> drivers/spi/spi-fsl-dspi.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index feb29bb92a77..8212c4193536 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -373,6 +373,8 @@ struct fsl_dspi {
> void (*dev_to_host)(struct fsl_dspi *dspi, u32 rxdata);
> };
>
> +static void dspi_setup_accel(struct fsl_dspi *dspi);
> +
> static bool is_s32g_dspi(struct fsl_dspi *data)
> {
> return data->devtype_data == &devtype_data[S32G] ||
> @@ -489,6 +491,7 @@ static void dspi_push_rx(struct fsl_dspi *dspi, u32 rxdata)
> dspi->dev_to_host(dspi, rxdata);
> }
>
> +#if IS_ENABLED(CONFIG_HAS_DMA)
> static void dspi_tx_dma_callback(void *arg)
> {
> struct fsl_dspi *dspi = arg;
> @@ -589,8 +592,6 @@ static int dspi_next_xfer_dma_submit(struct fsl_dspi *dspi)
> return 0;
> }
>
> -static void dspi_setup_accel(struct fsl_dspi *dspi);
> -
> static void dspi_dma_xfer(struct fsl_dspi *dspi)
> {
> struct spi_message *message = dspi->cur_msg;
> @@ -722,6 +723,18 @@ static void dspi_release_dma(struct fsl_dspi *dspi)
> dma_release_channel(dma->chan_rx);
> }
> }
> +#else
> +static void dspi_dma_xfer(struct fsl_dspi *dspi)
> +{
> + sdpi->cur_msg->status = -EINVAL;
> +}
> +static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
> +{
> + dev_err(&dspi->pdev->dev, "DMA support not enabled in kernel\n");
> + return -EINVAL;
> +}
> +static void dspi_release_dma(struct fsl_dspi *dspi) {}
> +#endif
>
> static void hz_to_spi_baud(char *pbr, char *br, int speed_hz,
> unsigned long clkrate, bool mtf_enabled)
>
> --
> 2.34.1
>
Powered by blists - more mailing lists