Skip to content
  1. May 23, 2024
  2. May 09, 2024
    • Geert Uytterhoeven's avatar
      spi: dw: Bail out early on unsupported target mode · d6e7ffd4
      Geert Uytterhoeven authored
      Currently, the DesignWare SPI controller driver supports only host mode.
      However, spi2 on the Kendryte K210 SoC supports only target mode,
      triggering an error message on e.g. SiPEED MAiXBiT since commit
      98d75b9e
      
       ("spi: dw: Drop default number of CS setting"):
      
          dw_spi_mmio 50240000.spi: error -22: problem registering spi host
          dw_spi_mmio 50240000.spi: probe with driver dw_spi_mmio failed with error -22
      
      As spi2 rightfully has no "num-cs" property, num_chipselect is now zero,
      causing spi_alloc_host() to fail to register the controller.  Before,
      the driver silently registered an SPI host controller with 4 chip
      selects.
      
      Reject target mode early on and warn the user, getting rid of the
      error message.
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Link: https://lore.kernel.org/r/7ae28d83bff7351f34782658ae1bb69cc731693e.1715163113.git.geert+renesas@glider.be
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d6e7ffd4
  3. May 08, 2024
  4. May 07, 2024
  5. May 06, 2024
    • Mark Brown's avatar
      spi: pxa2xx: Drop linux/spi/pxa2xx_spi.h · 21ae190e
      Mark Brown authored
      Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      
      As Arnd suggested we may drop linux/spi/pxa2xx_spi.h as most of
      its content is being used solely internally to SPI subsystem
      (PXA2xx drivers). Hence this refactoring series with the additional
      win of getting rid of legacy documentation.
      
      Note, that we have the only user of a single plain integer field
      in the entire kernel for that. Switching to software nodes does not
      diminish any of type checking as we only pass an integer.
      21ae190e
    • Mark Brown's avatar
      spi: dw: Auto-detect number of native CS · aa9db105
      Mark Brown authored
      Merge series from Serge Semin <fancer.lancer@gmail.com>:
      
      The main goal of the short series is to provide a procedure implementing
      the auto-detection of the number of native Chip-Select signals supported
      by the controller. The suggested algorithm is straightforward. It relies
      on the fact that the SER register writable flags reflects the actual
      number of available native chip-select signals. So the DW APB/AHB SSI
      driver now tests the SER register for having the writable bits,
      calculates the number of CS signals based on the number of set flags and
      then initializes the num_cs private data field based on that, which then
      will be passed to the SPI-core subsystem indicating the number of
      supported hardware chip-selects. The implemented procedure will be useful
      for the DW SSI device nodes not having the explicitly set "num-cs"
      property. In case if the property is specified it will be utilized instead
      of the auto-detection procedure.
      
      Besides of that a small cleanup patch is introduced in the head of the
      series. It converts the driver to using the BITS_TO_BYTES() macro instead
      of the hard-coded DIV_ROUND_UP()-based calculation of the number of
      bytes-per-transfer-word.
      aa9db105
  6. May 03, 2024
  7. May 01, 2024
    • Mark Brown's avatar
      spi: use 'time_left' instead of 'timeout' with · 6be871d5
      Mark Brown authored
      Merge series from Wolfram Sang <wsa+renesas@sang-engineering.com>:
      
      There is a confusing pattern in the kernel to use a variable named 'timeout' to
      store the result of wait_for_*() functions causing patterns like:
      
              timeout = wait_for_completion_timeout(...)
              if (!timeout) return -ETIMEDOUT;
      
      with all kinds of permutations. Use 'time_left' as a variable to make the code
      obvious and self explaining.
      
      This is part of a tree-wide series. The rest of the patches can be found here
      (some parts may still be WIP):
      
      git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/time_left
      
      Because these patches are generated, I audit them before sending. This is why I
      will send series step by step. Build bot is happy with these patches, though.
      No functional changes intended.
      6be871d5
    • Mark Brown's avatar
      Add add SPI-NAND Flash controller driver for EN7581 · 78d94353
      Mark Brown authored
      Merge series from Lorenzo Bianconi <lorenzo@kernel.org>:
      
      Introduce support for SPI-NAND driver of the Airoha NAND Flash Interface
      found on Airoha ARM EN7581 SoCs.
      78d94353
    • David Lechner's avatar
      spi: use spi_valid_{tx,rx}buf() in stats function · 52267fe8
      David Lechner authored
      
      
      There are macros spi_valid_txbuf() and spi_valid_rxbuf() for determining
      if an xfer actually intended to send or receive data.
      
      These checks were hard-coded in spi_statistics_add_transfer_stats(). We
      can make use of the macros instead to make the code more readable and
      more robust against potential future changes in case the definition of
      what valid means changes.
      
      The macro takes the spi_message as an argument, so we need to change
      spi_statistics_add_transfer_stats() to take the spi_message as an
      argument instead of the controller.
      
      Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
      Link: https://lore.kernel.org/r/20240430201530.2138095-3-dlechner@baylibre.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      52267fe8
  8. Apr 30, 2024
  9. Apr 26, 2024