All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Kopp <thomas.kopp@microchip.com>
To: <linux-spi@vger.kernel.org>
Cc: <thomas.kopp@microchip.com>, <tudor.ambarus@microchip.com>
Subject: [PATCH] spi: atmel: Exposing effective spi speed
Date: Fri, 18 Sep 2020 12:37:37 +0200	[thread overview]
Message-ID: <20200918103737.400-1-thomas.kopp@microchip.com> (raw)

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

Signed-off-by: Thomas Kopp <thomas.kopp@microchip.com>
---
 drivers/spi/spi-atmel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 2cfe6253a784..86857c8408b1 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -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;
 }
-- 
2.25.1


             reply	other threads:[~2020-09-18 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 10:37 Thomas Kopp [this message]
2020-09-21  6:02 ` [PATCH] spi: atmel: Exposing effective spi speed Tudor.Ambarus
2020-09-21  6:03   ` Tudor.Ambarus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200918103737.400-1-thomas.kopp@microchip.com \
    --to=thomas.kopp@microchip.com \
    --cc=linux-spi@vger.kernel.org \
    --cc=tudor.ambarus@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.