X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fspi-mem.h;h=32ffdc2e0f963c239e3e6a70c5ba1880823ad78a;hb=859703251251d9567f29ab10c0a29f98eb0aff5c;hp=8bd44596747924c2c2433971774f1f95216b2478;hpb=a1eb40b70b40d208a72765c0f56cffed4e22ff30;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/spi-mem.h b/include/spi-mem.h index 8bd4459..32ffdc2 100644 --- a/include/spi-mem.h +++ b/include/spi-mem.h @@ -17,6 +17,7 @@ struct udevice; { \ .buswidth = __buswidth, \ .opcode = __opcode, \ + .nbytes = 1, \ } #define SPI_MEM_OP_ADDR(__nbytes, __val, __buswidth) \ @@ -69,6 +70,8 @@ enum spi_mem_data_dir { /** * struct spi_mem_op - describes a SPI memory operation + * @cmd.nbytes: number of opcode bytes (only 1 or 2 are valid). The opcode is + * sent MSB-first. * @cmd.buswidth: number of IO lines used to transmit the command * @cmd.opcode: operation opcode * @cmd.dtr: whether the command opcode should be sent in DTR mode or not @@ -92,9 +95,10 @@ enum spi_mem_data_dir { */ struct spi_mem_op { struct { + u8 nbytes; u8 buswidth; - u8 opcode; u8 dtr : 1; + u16 opcode; } cmd; struct { @@ -245,6 +249,11 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, int spi_mem_adjust_op_size(struct spi_slave *slave, struct spi_mem_op *op); bool spi_mem_supports_op(struct spi_slave *slave, const struct spi_mem_op *op); +bool spi_mem_dtr_supports_op(struct spi_slave *slave, + const struct spi_mem_op *op); + +bool spi_mem_default_supports_op(struct spi_slave *slave, + const struct spi_mem_op *op); int spi_mem_exec_op(struct spi_slave *slave, const struct spi_mem_op *op);