History

Merge tag 'spi-mem-dtr' into spi-nor/next

spi: Support for DTR ops Merge the SPIMEM DTR bits in spi-nor/next so that we can continue the development on top of them.

Tudor Ambarus committed 6 years ago

Commit fb249e12 parents cc59e6b 4728f076 files · +45 −15Browse files

Showing the changes to include/linux (1 of 6 files). Show all

Unified · Split

include/linux/spi/spi-mem.h+13−1
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 { \
1818 .buswidth = __buswidth, \
1919 .opcode = __opcode, \
20+ .nbytes = 1, \
2021 }
2122
2223 #define SPI_MEM_OP_ADDR(__nbytes, __val, __buswidth) \
@@ -69,11 +70,15 @@ enum spi_mem_data_dir { · 46 unmodified lines
6970
7071 /**
7172 * struct spi_mem_op - describes a SPI memory operation
73+ * @cmd.nbytes: number of opcode bytes (only 1 or 2 are valid). The opcode is
74+ * sent MSB-first.
7275 * @cmd.buswidth: number of IO lines used to transmit the command
7376 * @cmd.opcode: operation opcode
77+ * @cmd.dtr: whether the command opcode should be sent in DTR mode or not
7478 * @addr.nbytes: number of address bytes to send. Can be zero if the operation
7579 * does not need to send an address
7680 * @addr.buswidth: number of IO lines used to transmit the address cycles
81+ * @addr.dtr: whether the address should be sent in DTR mode or not
7782 * @addr.val: address value. This value is always sent MSB first on the bus.
7883 * Note that only @addr.nbytes are taken into account in this
7984 * address value, so users should make sure the value fits in the
@@ -81,7 +86,9 @@ enum spi_mem_data_dir { · 1 unmodified line
8186 * @dummy.nbytes: number of dummy bytes to send after an opcode or address. Can
8287 * be zero if the operation does not require dummy bytes
8388 * @dummy.buswidth: number of IO lanes used to transmit the dummy bytes
89+ * @dummy.dtr: whether the dummy bytes should be sent in DTR mode or not
8490 * @data.buswidth: number of IO lanes used to send/receive the data
91+ * @data.dtr: whether the data should be sent in DTR mode or not
8592 * @data.dir: direction of the transfer
8693 * @data.nbytes: number of data bytes to send/receive. Can be zero if the
8794 * operation does not involve transferring data
@@ -90,23 +97,28 @@ enum spi_mem_data_dir { · 2 unmodified lines
9097 */
9198 struct spi_mem_op {
9299 struct {
100+ u8 nbytes;
93101 u8 buswidth;
94− u8 opcode;
102+ u8 dtr : 1;
103+ u16 opcode;
95104 } cmd;
96105
97106 struct {
98107 u8 nbytes;
99108 u8 buswidth;
109+ u8 dtr : 1;
100110 u64 val;
101111 } addr;
102112
103113 struct {
104114 u8 nbytes;
105115 u8 buswidth;
116+ u8 dtr : 1;
106117 } dummy;
107118
108119 struct {
109120 u8 buswidth;
121+ u8 dtr : 1;
110122 enum spi_mem_data_dir dir;
111123 unsigned int nbytes;
112124 union {