Merge series "spi: pxa2xx: Set of cleanups" from Andy Shevchenko <andriy.shevchenko...
authorMark Brown <broonie@kernel.org>
Tue, 11 May 2021 08:06:06 +0000 (09:06 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 11 May 2021 08:06:06 +0000 (09:06 +0100)
Set of cleanups here and there related to the SPI PXA2xx driver.
On top of them, adding the special type for Intel Merrifield.

In v2:
- cover letter (Mark)
- drop moving the header in patch 5 (Mark)

Andy Shevchenko (14):
  spi: pxa2xx: Use one point of return when ->probe() fails
  spi: pxa2xx: Utilize MMIO and physical base from struct ssp_device
  spi: pxa2xx: Utilize struct device from struct ssp_device
  spi: pxa2xx: Replace header inclusions by forward declarations
  spi: pxa2xx: Unify ifdeffery used in the headers
  spi: pxa2xx: Group Intel Quark specific definitions
  spi: pxa2xx: Introduce int_stop_and_reset() helper
  spi: pxa2xx: Reuse int_error_stop() in pxa2xx_spi_slave_abort()
  spi: pxa2xx: Use pxa_ssp_enable()/pxa_ssp_disable() in the driver
  spi: pxa2xx: Extract pxa2xx_spi_update() helper
  spi: pxa2xx: Extract clear_SSCR1_bits() helper
  spi: pxa2xx: Extract read_SSSR_bits() helper
  spi: pxa2xx: Constify struct driver_data parameter
  spi: pxa2xx: Introduce special type for Merrifield SPIs

 drivers/spi/spi-pxa2xx-dma.c   |  37 +++----
 drivers/spi/spi-pxa2xx-pci.c   |   4 +-
 drivers/spi/spi-pxa2xx.c       | 190 +++++++++++++++++----------------
 drivers/spi/spi-pxa2xx.h       |  52 ++++-----
 include/linux/pxa2xx_ssp.h     |  42 +++++++-
 include/linux/spi/pxa2xx_spi.h |   9 +-
 sound/soc/pxa/pxa-ssp.c        |  16 ---
 7 files changed, 185 insertions(+), 165 deletions(-)

--
2.30.2

Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt [deleted file]
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
drivers/spi/spi-omap-100k.c
drivers/spi/spi-tegra114.c
drivers/spi/spi-tegra210-quad.c
drivers/spi/spi-topcliff-pch.c

diff --git a/Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt b/Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt
deleted file mode 100644 (file)
index fb1a672..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Renesas RZ/N1 SPI Controller
-
-This controller is based on the Synopsys DW Synchronous Serial Interface and
-inherits all properties defined in snps,dw-apb-ssi.txt except for the
-compatible property.
-
-Required properties:
-- compatible : The device specific string followed by the generic RZ/N1 string.
-   Therefore it must be one of:
-   "renesas,r9a06g032-spi", "renesas,rzn1-spi"
-   "renesas,r9a06g033-spi", "renesas,rzn1-spi"
index 4825157..ca91201 100644 (file)
@@ -67,6 +67,12 @@ properties:
         const: baikal,bt1-sys-ssi
       - description: Canaan Kendryte K210 SoS SPI Controller
         const: canaan,k210-spi
+      - description: Renesas RZ/N1 SPI Controller
+        items:
+          - enum:
+              - renesas,r9a06g032-spi # RZ/N1D
+              - renesas,r9a06g033-spi # RZ/N1S
+          - const: renesas,rzn1-spi   # RZ/N1
 
   reg:
     minItems: 1
index 7062f29..f104470 100644 (file)
@@ -241,7 +241,7 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi,
        else
                word_len = spi->bits_per_word;
 
-       if (spi->bits_per_word > 32)
+       if (word_len > 32)
                return -EINVAL;
        cs->word_len = word_len;
 
index a2e5907..5131141 100644 (file)
@@ -1071,8 +1071,7 @@ static int tegra_spi_transfer_one_message(struct spi_master *master,
                ret = wait_for_completion_timeout(&tspi->xfer_completion,
                                                SPI_DMA_TIMEOUT);
                if (WARN_ON(ret == 0)) {
-                       dev_err(tspi->dev,
-                               "spi transfer timeout, err %d\n", ret);
+                       dev_err(tspi->dev, "spi transfer timeout\n");
                        if (tspi->is_curr_dma_xfer &&
                            (tspi->cur_direction & DATA_DIR_TX))
                                dmaengine_terminate_all(tspi->tx_dma_chan);
index 2f806f4..2354ca1 100644 (file)
@@ -1028,7 +1028,7 @@ static int tegra_qspi_transfer_one_message(struct spi_master *master, struct spi
                ret = wait_for_completion_timeout(&tqspi->xfer_completion,
                                                  QSPI_DMA_TIMEOUT);
                if (WARN_ON(ret == 0)) {
-                       dev_err(tqspi->dev, "transfer timeout: %d\n", ret);
+                       dev_err(tqspi->dev, "transfer timeout\n");
                        if (tqspi->is_curr_dma_xfer && (tqspi->cur_direction & DATA_DIR_TX))
                                dmaengine_terminate_all(tqspi->tx_dma_chan);
                        if (tqspi->is_curr_dma_xfer && (tqspi->cur_direction & DATA_DIR_RX))
index b887078..8c4615b 100644 (file)
@@ -580,8 +580,10 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw)
        data->pkt_tx_buff = kzalloc(size, GFP_KERNEL);
        if (data->pkt_tx_buff != NULL) {
                data->pkt_rx_buff = kzalloc(size, GFP_KERNEL);
-               if (!data->pkt_rx_buff)
+               if (!data->pkt_rx_buff) {
                        kfree(data->pkt_tx_buff);
+                       data->pkt_tx_buff = NULL;
+               }
        }
 
        if (!data->pkt_rx_buff) {