diff options
author | William Zhang <william.zhang@broadcom.com> | 2023-02-07 07:58:17 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-02-09 16:00:47 +0100 |
commit | 85a84a61699990db6a025b5073f337f49933a875 (patch) | |
tree | 7395bbfae18a5b96ca60d188f27f4a93bfd53fb4 /drivers/spi | |
parent | spi: bcm63xx-hsspi: Add new compatible string support (diff) | |
download | linux-85a84a61699990db6a025b5073f337f49933a875.tar.xz linux-85a84a61699990db6a025b5073f337f49933a875.zip |
spi: bcm63xx-hsspi: Endianness fix for ARM based SoC
HSSPI controller uses big endian for the opcode in the message to the
controller ping pong buffer. Use cpu_to_be16 to properly handle the
endianness for both big and little endian host.
Fixes: 142168eba9dc ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver")
Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230207065826.285013-7-william.zhang@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-bcm63xx-hsspi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index 01d5acad4a1b..a65a0ec67641 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -194,7 +194,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t) tx += curr_step; } - __raw_writew(opcode | curr_step, bs->fifo); + __raw_writew((u16)cpu_to_be16(opcode | curr_step), bs->fifo); /* enable interrupt */ __raw_writel(HSSPI_PINGx_CMD_DONE(0), |