diff options
author | Mark Brown <broonie@kernel.org> | 2021-06-25 14:08:26 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-25 14:08:26 +0100 |
commit | 1bee1ecf232cd90ad112d78ab5124850b4e5ea09 (patch) | |
tree | 850cf42ea49ec040c2042fdd8bc61d332461e948 /include/linux/spi/spi-mem.h | |
parent | edf978a5a17dc9e38625b33821dc71f10c46f694 (diff) | |
parent | b470e10eb43f19e08245cd87dd3192a8141cfbb5 (diff) |
Merge remote-tracking branch 'spi/for-5.14' into spi-next
Diffstat (limited to 'include/linux/spi/spi-mem.h')
-rw-r--r-- | include/linux/spi/spi-mem.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index 2b65c9edc34e..85e2ff7b840d 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -250,6 +250,9 @@ static inline void *spi_mem_get_drvdata(struct spi_mem *mem) * the currently mapped area), and the caller of * spi_mem_dirmap_write() is responsible for calling it again in * this case. + * @poll_status: poll memory device status until (status & mask) == match or + * when the timeout has expired. It fills the data buffer with + * the last status value. * * This interface should be implemented by SPI controllers providing an * high-level interface to execute SPI memory operation, which is usually the @@ -274,6 +277,12 @@ struct spi_controller_mem_ops { u64 offs, size_t len, void *buf); ssize_t (*dirmap_write)(struct spi_mem_dirmap_desc *desc, u64 offs, size_t len, const void *buf); + int (*poll_status)(struct spi_mem *mem, + const struct spi_mem_op *op, + u16 mask, u16 match, + unsigned long initial_delay_us, + unsigned long polling_rate_us, + unsigned long timeout_ms); }; /** @@ -369,6 +378,13 @@ devm_spi_mem_dirmap_create(struct device *dev, struct spi_mem *mem, void devm_spi_mem_dirmap_destroy(struct device *dev, struct spi_mem_dirmap_desc *desc); +int spi_mem_poll_status(struct spi_mem *mem, + const struct spi_mem_op *op, + u16 mask, u16 match, + unsigned long initial_delay_us, + unsigned long polling_delay_us, + u16 timeout_ms); + int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv, struct module *owner); |