[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230207065826.285013-9-william.zhang@broadcom.com>
Date: Mon, 6 Feb 2023 22:58:19 -0800
From: William Zhang <william.zhang@...adcom.com>
To: Linux SPI List <linux-spi@...r.kernel.org>,
Broadcom Kernel List <bcm-kernel-feedback-list@...adcom.com>
Cc: kursad.oney@...adcom.com, anand.gore@...adcom.com,
dan.beygelman@...adcom.com, dregan@...l.com, f.fainelli@...il.com,
joel.peshkin@...adcom.com, jonas.gorski@...il.com,
tomer.yacoby@...adcom.com,
William Zhang <william.zhang@...adcom.com>,
Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org
Subject: [PATCH v3 08/15] spi: export spi_transfer_cs_change_delay_exec function
For SPI controller that implements transfer_one_message, it needs to
insert the delay that required by cs change event between the transfers.
Add a wrapper for the local function _spi_transfer_cs_change_delay_exec
and export it for SPI controller driver to use.
Signed-off-by: William Zhang <william.zhang@...adcom.com>
---
(no changes since v1)
drivers/spi/spi.c | 7 +++++++
include/linux/spi/spi.h | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3cc7bb4d03de..00a176804378 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1484,6 +1484,13 @@ static void _spi_transfer_cs_change_delay(struct spi_message *msg,
}
}
+void spi_transfer_cs_change_delay_exec(struct spi_message *msg,
+ struct spi_transfer *xfer)
+{
+ _spi_transfer_cs_change_delay(msg, xfer);
+}
+EXPORT_SYMBOL_GPL(spi_transfer_cs_change_delay_exec);
+
/*
* spi_transfer_one_message - Default implementation of transfer_one_message()
*
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 9a32495fbb1f..19857ebb1d95 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -26,6 +26,7 @@ struct spi_controller;
struct spi_transfer;
struct spi_controller_mem_ops;
struct spi_controller_mem_caps;
+struct spi_message;
/*
* INTERFACES between SPI master-side drivers and SPI slave protocol handlers,
@@ -119,6 +120,8 @@ struct spi_delay {
extern int spi_delay_to_ns(struct spi_delay *_delay, struct spi_transfer *xfer);
extern int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer);
+extern void spi_transfer_cs_change_delay_exec(struct spi_message *msg,
+ struct spi_transfer *xfer);
/**
* struct spi_device - Controller side proxy for an SPI slave device
@@ -263,8 +266,6 @@ static inline void *spi_get_drvdata(struct spi_device *spi)
return dev_get_drvdata(&spi->dev);
}
-struct spi_message;
-
/**
* struct spi_driver - Host side "protocol" driver
* @id_table: List of SPI devices supported by this driver
--
2.37.3
Powered by blists - more mailing lists