spi: bcm63xx: fix max prepend length

[ Upstream commit 5158814cbb ]

The command word is defined as following:

    /* Command */
    #define SPI_CMD_COMMAND_SHIFT           0
    #define SPI_CMD_DEVICE_ID_SHIFT         4
    #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT  8
    #define SPI_CMD_ONE_BYTE_SHIFT          11
    #define SPI_CMD_ONE_WIRE_SHIFT          12

If the prepend byte count field starts at bit 8, and the next defined
bit is SPI_CMD_ONE_BYTE at bit 11, it can be at most 3 bits wide, and
thus the max value is 7, not 15.

Fixes: b17de07606 ("spi/bcm63xx: work around inability to keep CS up")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://lore.kernel.org/r/20230629071453.62024-1-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jonas Gorski 2023-06-29 09:14:52 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 2febd5f81e
Коммит 5d19146753
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -126,7 +126,7 @@ enum bcm63xx_regs_spi {
SPI_MSG_DATA_SIZE, SPI_MSG_DATA_SIZE,
}; };
#define BCM63XX_SPI_MAX_PREPEND 15 #define BCM63XX_SPI_MAX_PREPEND 7
#define BCM63XX_SPI_MAX_CS 8 #define BCM63XX_SPI_MAX_CS 8
#define BCM63XX_SPI_BUS_NUM 0 #define BCM63XX_SPI_BUS_NUM 0