@@ -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;
};
/**
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@gmail.com> --- include/linux/spi/spi-mem.h | 7 +++++++ 1 file changed, 7 insertions(+)