Skip to contentSkip to conversation

spi/pxa2xx-pci: correct the return value check of pcim_iomap_regions()

PATCH Applied Mika Westerberg 2 participants 3 messages Mar 5, 2013 – Mar 12, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 spi/pxa2xx-pci: correct the return value check of pcim_iomap_regions()

The function returns 0 on success and negative errno in case of failure. Fix this.

---
 drivers/spi/spi-pxa2xx-pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-pxa2xx-pci.c +1 -1
index 364964d..48abae5 100644
@@ -22,7 +22,7 @@ static int ce4100_spi_probe(struct pci_dev *dev,
 		return ret;
 
 	ret = pcim_iomap_regions(dev, 1 << 0, "PXA2xx SPI");
-	if (!ret)
+	if (ret)
 		return ret;
 
 	memset(&spi_pdata, 0, sizeof(spi_pdata));
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 spi/pxa2xx: enable multiblock DMA transfers for LPSS devices

Intel LPSS SPI controllers need to have bit 0 (disable_ssp_dma_finish) set in SSP_REG in order to properly perform DMA transfers spanning over multiple blocks.

---
 drivers/spi/spi-pxa2xx.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/spi/spi-pxa2xx.c +5 -0
index 90b27a3..c6d5b97 100644
@@ -68,6 +68,7 @@ MODULE_ALIAS("platform:pxa2xx-spi");
 #define LPSS_TX_HITHRESH_DFLT	224
 
 /* Offset from drv_data->lpss_base */
+#define SSP_REG			0x0c
 #define SPI_CS_CONTROL		0x18
 #define SPI_CS_CONTROL_SW_MODE	BIT(0)
 #define SPI_CS_CONTROL_CS_HIGH	BIT(1)
@@ -138,6 +139,10 @@ detection_done:
 	/* Enable software chip select control */
 	value = SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH;
 	__lpss_ssp_write_priv(drv_data, SPI_CS_CONTROL, value);
+
+	/* Enable multiblock DMA transfers */
+	if (drv_data->master_info->enable_dma)
+		__lpss_ssp_write_priv(drv_data, SSP_REG, 1);
 }
 
 static void lpss_ssp_cs_control(struct driver_data *drv_data, bool enable)
Signature · 1 line
1.7.10.4