linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [resend] [PATCH 5/5] spi: bcm2835aux: support effective_speed_hz
@ 2019-02-23 15:07 kernel
  2019-05-13 15:12 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: kernel @ 2019-02-23 15:07 UTC (permalink / raw)
  To: Mark Brown, Eric Anholt, Stefan Wahren, linux-spi,
	linux-rpi-kernel, linux-arm-kernel
  Cc: Martin Sperl

From: Martin Sperl <kernel@martin.sperl.org>

Setting spi_transfer->effective_speed_hz in transfer_one so that
it can get used in cs_change_delay configured with delay as a muliple
of SPI clock cycles.

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
---
 drivers/spi/spi-bcm2835aux.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index 671e374e1b01..51ce76706073 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -325,7 +325,6 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
 {
 	struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
 	unsigned long spi_hz, clk_hz, speed;
-	unsigned long spi_used_hz;

 	/* calculate the registers to handle
 	 *
@@ -353,7 +352,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
 	/* set the new speed */
 	bs->cntl[0] |= speed << BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT;

-	spi_used_hz = clk_hz / (2 * (speed + 1));
+	tfr->effective_speed_hz = clk_hz / (2 * (speed + 1));

 	/* set transmit buffers and length */
 	bs->tx_buf = tfr->tx_buf;
@@ -371,7 +370,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
 	 */
 #define HZ_PER_BYTE ((9 * 1000000) / BCM2835_AUX_SPI_POLLING_LIMIT_US)
 	/* run in polling mode for short transfers */
-	if (tfr->len < spi_used_hz / HZ_PER_BYTE)
+	if (tfr->len < tfr->effective_speed_hz / HZ_PER_BYTE)
 		return bcm2835aux_spi_transfer_one_poll(master, spi, tfr);

 	/* run in interrupt mode for all others */
--
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [resend] [PATCH 5/5] spi: bcm2835aux: support effective_speed_hz
  2019-02-23 15:07 [resend] [PATCH 5/5] spi: bcm2835aux: support effective_speed_hz kernel
@ 2019-05-13 15:12 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2019-05-13 15:12 UTC (permalink / raw)
  To: kernel
  Cc: Stefan Wahren, Eric Anholt, linux-rpi-kernel, linux-arm-kernel,
	linux-spi


[-- Attachment #1.1: Type: text/plain, Size: 336 bytes --]

On Sat, Feb 23, 2019 at 03:07:05PM +0000, kernel@martin.sperl.org wrote:
> From: Martin Sperl <kernel@martin.sperl.org>
> 
> Setting spi_transfer->effective_speed_hz in transfer_one so that
> it can get used in cs_change_delay configured with delay as a muliple
> of SPI clock cycles.

This needs rebasing against current code.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-13 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23 15:07 [resend] [PATCH 5/5] spi: bcm2835aux: support effective_speed_hz kernel
2019-05-13 15:12 ` 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).