mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 13:41:48 -04:00
spi: spi-fsl-lpspi: fsl_lpspi_set_cmd(): use mode from struct fsl_lpspi_data::config::mode
Commit 7ae4d097b7 ("spi: spi-fsl-lpspi: Handle clock polarity and phase")
enhances the driver with clock polarity and phase handling. That commit
adds a 2nd argument ("struct spi_device *spi") to the fsl_lpspi_set_cmd()
function.
The "spi" pointer is used to access the "mode" of the current transfer.
However the mode is already available via "fsl_lpspi->config.mode".
To simplify the driver remove the 2nd argument and use
"fsl_lpspi->config.mode" to access the mode.
Cc: Marek Vasut <marex@nabladev.com>
Reviewed-by: Marek Vasut <marex@nabladev.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20260319-spi-fsl-lpspi-cleanups-v2-4-02b56c5d44a8@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
732b903ea3
commit
b191fbf446
@@ -284,8 +284,7 @@ static void fsl_lpspi_read_rx_fifo(struct fsl_lpspi_data *fsl_lpspi)
|
||||
fsl_lpspi->rx(fsl_lpspi);
|
||||
}
|
||||
|
||||
static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi,
|
||||
struct spi_device *spi)
|
||||
static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi)
|
||||
{
|
||||
u32 temp = 0;
|
||||
|
||||
@@ -308,10 +307,10 @@ static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi,
|
||||
}
|
||||
}
|
||||
|
||||
if (spi->mode & SPI_CPOL)
|
||||
if (fsl_lpspi->config.mode & SPI_CPOL)
|
||||
temp |= TCR_CPOL;
|
||||
|
||||
if (spi->mode & SPI_CPHA)
|
||||
if (fsl_lpspi->config.mode & SPI_CPHA)
|
||||
temp |= TCR_CPHA;
|
||||
|
||||
writel(temp, fsl_lpspi->base + IMX7ULP_TCR);
|
||||
@@ -528,7 +527,7 @@ static int fsl_lpspi_prepare_message(struct spi_controller *controller,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
fsl_lpspi_set_cmd(fsl_lpspi, spi);
|
||||
fsl_lpspi_set_cmd(fsl_lpspi);
|
||||
|
||||
/* No IRQs */
|
||||
writel(0, fsl_lpspi->base + IMX7ULP_IER);
|
||||
@@ -808,7 +807,7 @@ static int fsl_lpspi_transfer_one(struct spi_controller *controller,
|
||||
|
||||
t->effective_speed_hz = fsl_lpspi->config.effective_speed_hz;
|
||||
|
||||
fsl_lpspi_set_cmd(fsl_lpspi, spi);
|
||||
fsl_lpspi_set_cmd(fsl_lpspi);
|
||||
fsl_lpspi->is_first_byte = false;
|
||||
|
||||
if (fsl_lpspi->usedma)
|
||||
|
||||
Reference in New Issue
Block a user