[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190729142504.188336-3-tmaimon77@gmail.com>
Date: Mon, 29 Jul 2019 17:25:03 +0300
From: Tomer Maimon <tmaimon77@...il.com>
To: broonie@...nel.org, dwmw2@...radead.org,
computersforpeace@...il.com, marek.vasut@...il.com,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
bbrezillon@...nel.org, yogeshnarayan.gaur@....com,
tudor.ambarus@...rochip.com, gregkh@...uxfoundation.org,
frieder.schrempf@...eet.de, tglx@...utronix.de
Cc: linux-spi@...r.kernel.org, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org, Tomer Maimon <tmaimon77@...il.com>
Subject: [RFC v1 2/3] spi: spi-mem: add callback function to spi-mem device
Add callback function support to the spi-mem device
for passing an argument from the spi-mem layer
to the spi layer.
Signed-off-by: Tomer Maimon <tmaimon77@...il.com>
---
include/linux/spi/spi-mem.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 5f7d20bd2b09..b9841a9030be 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -13,6 +13,8 @@
#include <linux/spi/spi.h>
+typedef size_t (*spi_mem_callback)(void *spi_mem_param);
+
#define SPI_MEM_OP_CMD(__opcode, __buswidth) \
{ \
.buswidth = __buswidth, \
@@ -172,6 +174,9 @@ struct spi_mem_dirmap_desc {
* @spi: the underlying SPI device
* @drvpriv: spi_mem_driver private data
* @name: name of the SPI memory device
+ * @callback: routine for passing an argument from the
+ * spi-mem layer to the spi layer.
+ * @callback_param: general parameter to pass to the callback routine
*
* Extra information that describe the SPI memory device and may be needed by
* the controller to properly handle this device should be placed here.
@@ -183,6 +188,8 @@ struct spi_mem {
struct spi_device *spi;
void *drvpriv;
const char *name;
+ spi_mem_callback callback;
+ void *callback_param;
};
/**
--
2.18.0
Powered by blists - more mailing lists