Skip to contentSkip to conversation

spi: atmel: Exposing effective spi speed

PATCH Superseded Thomas Kopp 2 participants 3 messages Sep 18, 2020 – Sep 21, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: atmel: Exposing effective spi speed

This patch implements the reporting of the effectively used speed_hz for the transfer by setting xfer->effective_speed_hz.

See the following patch, which adds this feature to the SPI core for more information:

5d7e2b5ed585 spi: core: allow reporting the effectivly used speed_hz for a transfer

---
 drivers/spi/spi-atmel.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-atmel.c +1 -0
index 2cfe6253a784..86857c8408b1 100644
@@ -859,6 +859,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,
 	csr = spi_readl(as, CSR0 + 4 * chip_select);
 	csr = SPI_BFINS(SCBR, scbr, csr);
 	spi_writel(as, CSR0 + 4 * chip_select, csr);
+	xfer->effective_speed_hz = bus_hz/scbr;
 
 	return 0;
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi, Thomas,

Quoted 7 lines · Thomas Kopp

This patch implements the reporting of the effectively used speed_hz for the transfer by setting xfer->effective_speed_hz.

See the following patch, which adds this feature to the SPI core for more information:

5d7e2b5ed585 spi: core: allow reporting the effectivly used speed_hz for a transfer

s/effectivly/effectively

./scripts/checkpatch.pl --strict raises an error here, the commit should be
referred as commit 5d7e2b5ed585 ("spi: core: allow reporting the effectivly used speed_hz for a transfer")

Quoted 11 lines
---
 drivers/spi/spi-atmel.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-atmel.c +0 -0
index 2cfe6253a784..86857c8408b1 100644

drivers/spi/spi-atmel.c static int atmel_spi_set_xfer_speed(struct atmel_spi *as, · line 862

Quoted 4 lines
drivers/spi/spi-atmel.c +1 -0
@@ -859,6 +859,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,
 	csr = spi_readl(as, CSR0 + 4 * chip_select);
 	csr = SPI_BFINS(SCBR, scbr, csr);
 	spi_writel(as, CSR0 + 4 * chip_select, csr);
+	xfer->effective_speed_hz = bus_hz/scbr;

spaces preferred around that '/'

with these addressed one can add:

Cheers,
ta

#2 lore raw
Quoted 6 lines · On 9/21/20 9:02 AM, Tudor Ambarus - M18064 wrote:

Hi, Thomas,

Quoted 3 lines · Thomas Kopp

This patch implements the reporting of the effectively used speed_hz for the transfer by setting xfer->effective_speed_hz.

Quoted 6 lines
Quoted 4 lines

See the following patch, which adds this feature to the SPI core for more information:

5d7e2b5ed585 spi: core: allow reporting the effectivly used speed_hz for a transfer

s/effectivly/effectively

oops, please ignore this, don't change the commit subject.