8 #include <linux/module.h>
9 #include <linux/device.h>
11 #include <linux/string.h>
15 #include <linux/list.h>
19 #include <linux/sched.h>
23 #ifndef CONFIG_CAIF_SPI_SYNC
24 #define SPI_DATA_POS 0
25 static inline int forward_to_spi_cmd(
struct cfspi *
cfspi)
30 #define SPI_DATA_POS SPI_CMD_SZ
31 static inline int forward_to_spi_cmd(
struct cfspi *
cfspi)
48 #ifdef CONFIG_DEBUG_FS
49 static inline void debugfs_store_prev(
struct cfspi *
cfspi)
52 cfspi->pcmd = cfspi->
cmd;
58 static inline void debugfs_store_prev(
struct cfspi *
cfspi)
101 ptr = (
u8 *) cfspi->
xfer.va_tx;
118 ptr = (
u8 *) cfspi->
xfer.va_tx;
147 ret = cfspi->
dev->init_xfer(&cfspi->
xfer, cfspi->
dev);
161 cfspi->
dev->sig_xfer(
true, cfspi->
dev);
182 cfspi->
dev->clk_mhz) <
187 (cfspi->
xfer.tx_dma_len, cfspi->
dev->clk_mhz));
193 cfspi->
dev->sig_xfer(
false, cfspi->
dev);
209 ptr = (
u8 *) cfspi->
xfer.va_rx;
211 ptr += forward_to_spi_cmd(cfspi);
214 cfspi->
cmd |= ((*ptr++) << 8) & 0xFF00;
221 debugfs_store_prev(cfspi);
245 spin_unlock_irqrestore(&cfspi->
lock, flags);
253 .name =
"cfspi_sspi",