lkml.org 
[lkml]   [2023]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/16] spi: bcm63xx-hsspi: Endianness fix for ARM based SoC
    Date
    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>
    ---

    drivers/spi/spi-bcm63xx-hsspi.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
    index b871fd810d80..63682c8ff955 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(cpu_to_be16(opcode | curr_step), bs->fifo);

    /* enable interrupt */
    __raw_writel(HSSPI_PINGx_CMD_DONE(0),
    --
    2.37.3
    \
     
     \ /
      Last update: 2023-03-26 23:31    [W:2.475 / U:0.556 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site