* [PATCH] spi: imx: Implement support for CS_WORD
@ 2021-07-27 12:42 Uwe Kleine-König
2021-08-03 22:35 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2021-07-27 12:42 UTC (permalink / raw)
To: Mark Brown
Cc: Shawn Guo, Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
linux-spi
This only works when the native chipselect is in use. On a board with a
Ti ADS7950 8 channel ADC. This patch reduces the time to read out all
channels once from 280 us to 20 us.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-imx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index e5ba99d87eb3..ff6051fe25f6 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1209,6 +1209,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
* dynamic_burst in that case.
*/
if (spi_imx->devtype_data->dynamic_burst && !spi_imx->slave_mode &&
+ !(spi->mode & SPI_CS_WORD) &&
(spi_imx->bits_per_word == 8 ||
spi_imx->bits_per_word == 16 ||
spi_imx->bits_per_word == 32)) {
@@ -1640,6 +1641,15 @@ static int spi_imx_probe(struct platform_device *pdev)
is_imx53_ecspi(spi_imx))
spi_imx->bitbang.master->mode_bits |= SPI_LOOP | SPI_READY;
+ if (is_imx51_ecspi(spi_imx) &&
+ device_property_read_u32(&pdev->dev, "cs-gpios", NULL))
+ /*
+ * When using HW-CS implementing SPI_CS_WORD can be done by just
+ * setting the burst length to the word size. This is
+ * considerably faster than manually controlling the CS.
+ */
+ spi_imx->bitbang.master->mode_bits |= SPI_CS_WORD;
+
spi_imx->spi_drctl = spi_drctl;
init_completion(&spi_imx->xfer_done);
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] spi: imx: Implement support for CS_WORD
2021-07-27 12:42 [PATCH] spi: imx: Implement support for CS_WORD Uwe Kleine-König
@ 2021-08-03 22:35 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-08-03 22:35 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, Pengutronix Kernel Team, NXP Linux Team,
Fabio Estevam, Shawn Guo, linux-spi
On Tue, 27 Jul 2021 14:42:26 +0200, Uwe Kleine-König wrote:
> This only works when the native chipselect is in use. On a board with a
> Ti ADS7950 8 channel ADC. This patch reduces the time to read out all
> channels once from 280 us to 20 us.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: imx: Implement support for CS_WORD
commit: 6e95b23a5b2d1fcbe5a84a362170a4871a3d5731
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-03 22:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 12:42 [PATCH] spi: imx: Implement support for CS_WORD Uwe Kleine-König
2021-08-03 22:35 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).