summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMartin Sperl <kernel@martin.sperl.org>2019-02-23 11:49:49 +0300
committerMark Brown <broonie@kernel.org>2019-05-13 15:11:36 +0300
commit5d7e2b5ed5858fe739d4cb8ad22dcce7bd9dbe7b (patch)
tree6bd17939600e1d69903d15c151b96a68f2b94b5d /drivers/spi/spi.c
parente727d4cbc785e9c1b4d239eef274dc63bc1aff24 (diff)
downloadlinux-5d7e2b5ed5858fe739d4cb8ad22dcce7bd9dbe7b.tar.xz
spi: core: allow reporting the effectivly used speed_hz for a transfer
Provide a means for the spi bus driver to report the effectively used spi clock frequency used for each spi_transfer. Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index cfa3c3decb8a..e9bf0c23da50 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3126,6 +3126,7 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
*/
message->frame_length = 0;
list_for_each_entry(xfer, &message->transfers, transfer_list) {
+ xfer->effective_speed_hz = 0;
message->frame_length += xfer->len;
if (!xfer->bits_per_word)
xfer->bits_per_word = spi->bits_per_word;