diff options
| author | Geert Uytterhoeven <geert+renesas@linux-m68k.org> | 2014-02-25 05:40:17 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-02-26 23:51:29 -0500 |
| commit | dc64d39b54c1e9db97a6fb1ca52598c981728157 (patch) | |
| tree | 4e68275a6ecd75f7ea65bd9d7d66c4007e1b1754 /include/uapi/linux/spi | |
| parent | e6456186cae76f80446ba911f77eb2f85d3d927e (diff) | |
spi: spidev: Add support for Dual/Quad SPI Transfers
Add support for Dual/Quad SPI Transfers to the spidev API.
As this uses SPI mode bits that don't fit in a single byte, two new
ioctls (SPI_IOC_RD_MODE32 and SPI_IOC_WR_MODE32) are introduced.
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/uapi/linux/spi')
| -rw-r--r-- | include/uapi/linux/spi/spidev.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/uapi/linux/spi/spidev.h b/include/uapi/linux/spi/spidev.h index 52d9ed01855f..dd5f21e75805 100644 --- a/include/uapi/linux/spi/spidev.h +++ b/include/uapi/linux/spi/spidev.h | |||
| @@ -42,6 +42,10 @@ | |||
| 42 | #define SPI_LOOP 0x20 | 42 | #define SPI_LOOP 0x20 |
| 43 | #define SPI_NO_CS 0x40 | 43 | #define SPI_NO_CS 0x40 |
| 44 | #define SPI_READY 0x80 | 44 | #define SPI_READY 0x80 |
| 45 | #define SPI_TX_DUAL 0x100 | ||
| 46 | #define SPI_TX_QUAD 0x200 | ||
| 47 | #define SPI_RX_DUAL 0x400 | ||
| 48 | #define SPI_RX_QUAD 0x800 | ||
| 45 | 49 | ||
| 46 | /*---------------------------------------------------------------------------*/ | 50 | /*---------------------------------------------------------------------------*/ |
| 47 | 51 | ||
| @@ -92,7 +96,9 @@ struct spi_ioc_transfer { | |||
| 92 | __u16 delay_usecs; | 96 | __u16 delay_usecs; |
| 93 | __u8 bits_per_word; | 97 | __u8 bits_per_word; |
| 94 | __u8 cs_change; | 98 | __u8 cs_change; |
| 95 | __u32 pad; | 99 | __u8 tx_nbits; |
| 100 | __u8 rx_nbits; | ||
| 101 | __u16 pad; | ||
| 96 | 102 | ||
| 97 | /* If the contents of 'struct spi_ioc_transfer' ever change | 103 | /* If the contents of 'struct spi_ioc_transfer' ever change |
| 98 | * incompatibly, then the ioctl number (currently 0) must change; | 104 | * incompatibly, then the ioctl number (currently 0) must change; |
| @@ -110,7 +116,7 @@ struct spi_ioc_transfer { | |||
| 110 | #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) | 116 | #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) |
| 111 | 117 | ||
| 112 | 118 | ||
| 113 | /* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */ | 119 | /* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) (limited to 8 bits) */ |
| 114 | #define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8) | 120 | #define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8) |
| 115 | #define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8) | 121 | #define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8) |
| 116 | 122 | ||
| @@ -126,6 +132,10 @@ struct spi_ioc_transfer { | |||
| 126 | #define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32) | 132 | #define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32) |
| 127 | #define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32) | 133 | #define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32) |
| 128 | 134 | ||
| 135 | /* Read / Write of the SPI mode field */ | ||
| 136 | #define SPI_IOC_RD_MODE32 _IOR(SPI_IOC_MAGIC, 5, __u32) | ||
| 137 | #define SPI_IOC_WR_MODE32 _IOW(SPI_IOC_MAGIC, 5, __u32) | ||
| 138 | |||
| 129 | 139 | ||
| 130 | 140 | ||
| 131 | #endif /* SPIDEV_H */ | 141 | #endif /* SPIDEV_H */ |
