• Marc Kleine-Budde's avatar
    can: tcan4x5x: rework SPI access · 1c5d0fc4
    Marc Kleine-Budde authored
    This patch reworks the SPI access and fixes several probems:
    - tcan4x5x_regmap_gather_write(), tcan4x5x_regmap_read():
      Do not place variable "addr" on stack and use it as buffer for SPI
      transfer. Buffers for SPI transfers must be allocated from DMA save
      memory.
    - tcan4x5x_regmap_gather_write(), tcan4x5x_regmap_read():
      Halfe number of SPI transfers by using a single buffer + memcpy().
      This improves the performance, especially on SPI controllers, which
      use interrupt based transfers.
    - Use "8" bits per word, not "32". This makes it possible to use this
      driver on SoCs like the Raspberry Pi, which SPI host controller
      drivers only support 8 bits per word.
    
    Note: this breaks half duplex only controllers. Support for them will be
    re-added in the next patch.
    Reviewed-by: default avatarDan Murphy <dmurphy@ti.com>
    Tested-by: default avatarSean Nyekjaer <sean@geanix.com>
    Link: https://lore.kernel.org/r/20201215231746.1132907-16-mkl@pengutronix.deSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    1c5d0fc4
tcan4x5x-core.c 11.3 KB