linux/include
Pratyush Yadav caf72df48b
spi: spi-mem: allow specifying a command's extension
In xSPI mode, flashes expect 2-byte opcodes. The second byte is called
the "command extension". There can be 3 types of extensions in xSPI:
repeat, invert, and hex. When the extension type is "repeat", the same
opcode is sent twice. When it is "invert", the second byte is the
inverse of the opcode. When it is "hex" an additional opcode byte based
is sent with the command whose value can be anything.

So, make opcode a 16-bit value and add a 'nbytes', similar to how
multiple address widths are handled.

Some places use sizeof(op->cmd.opcode). Replace them with op->cmd.nbytes

The spi-mxic and spi-zynq-qspi drivers directly use op->cmd.opcode as a
buffer. Now that opcode is a 2-byte field, this can result in different
behaviour depending on if the machine is little endian or big endian.
Extract the opcode in a local 1-byte variable and use that as the buffer
instead. Both these drivers would reject multi-byte opcodes in their
supports_op() hook anyway, so we only need to worry about single-byte
opcodes for now.

The above two changes are put in this commit to keep the series
bisectable.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20200623183030.26591-3-p.yadav@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 17:29:38 +01:00
..
acpi Merge branch 'acpica' 2020-06-10 17:27:28 +02:00
asm-generic The X86 entry, exception and interrupt code rework 2020-06-13 10:05:47 -07:00
clocksource
crypto
drm drm: remove drm specific kmap_atomic code 2020-06-04 19:06:22 -07:00
dt-bindings - qcom : 2020-06-11 12:42:14 -07:00
keys keys: Implement update for the big_key type 2020-06-02 17:22:31 +01:00
kunit
kvm
linux spi: spi-mem: allow specifying a command's extension 2020-07-14 17:29:38 +01:00
math-emu
media media updates for v5.8-rc1 2020-06-13 13:09:38 -07:00
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-06-13 16:27:13 -07:00
pcmcia
ras
rdma dynamic_debug: add an option to enable dynamic debug for modules only 2020-06-08 11:05:56 -07:00
scsi SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
soc pci-v5.8-changes 2020-06-06 11:01:58 -07:00
sound ASoC: Updates for v5.8 2020-06-01 20:26:07 +02:00
target scsi: target: Rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb() 2020-06-09 21:57:26 -04:00
trace block-5.8-2020-06-11 2020-06-11 16:07:33 -07:00
uapi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-06-13 16:27:13 -07:00
vdso
video
xen xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h 2020-06-11 15:15:19 +02:00