Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5310a1c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull spi fixes from Mark Brown:
 "A small clutch of driver specific fixes.

  The OMAP one is a bit worrying since it seems to be triggered by some
  changes in the runtime PM core code and I suspect there's other
  drivers across that are going to be using the same pattern outside of
  OMAP but nothing seems to be coming up in the testing people are
  doing"

* tag 'spi-fix-v4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: omap2-mcspi: Fix PM regression with deferred probe for pm_runtime_reinit
  spi: bcm2835aux: fix bitmask defines
  spi: atmel: fix gpio chip-select in case of non-DT platform
  spi/fsl-espi: Correct the maximum transaction length
  spi: imx: fix spi resource leak with dma transfer
  spi: fix counting in spi-loopback-test code
parents 2a4be2c5 4dd638f8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1571,6 +1571,7 @@ static int atmel_spi_probe(struct platform_device *pdev)


	as->use_cs_gpios = true;
	as->use_cs_gpios = true;
	if (atmel_spi_is_v2(as) &&
	if (atmel_spi_is_v2(as) &&
	    pdev->dev.of_node &&
	    !of_get_property(pdev->dev.of_node, "cs-gpios", NULL)) {
	    !of_get_property(pdev->dev.of_node, "cs-gpios", NULL)) {
		as->use_cs_gpios = false;
		as->use_cs_gpios = false;
		master->num_chipselect = 4;
		master->num_chipselect = 4;
+2 −2
Original line number Original line Diff line number Diff line
@@ -73,8 +73,8 @@


/* Bitfields in CNTL1 */
/* Bitfields in CNTL1 */
#define BCM2835_AUX_SPI_CNTL1_CSHIGH	0x00000700
#define BCM2835_AUX_SPI_CNTL1_CSHIGH	0x00000700
#define BCM2835_AUX_SPI_CNTL1_IDLE	0x00000080
#define BCM2835_AUX_SPI_CNTL1_TXEMPTY	0x00000080
#define BCM2835_AUX_SPI_CNTL1_TXEMPTY	0x00000040
#define BCM2835_AUX_SPI_CNTL1_IDLE	0x00000040
#define BCM2835_AUX_SPI_CNTL1_MSBF_IN	0x00000002
#define BCM2835_AUX_SPI_CNTL1_MSBF_IN	0x00000002
#define BCM2835_AUX_SPI_CNTL1_KEEP_IN	0x00000001
#define BCM2835_AUX_SPI_CNTL1_KEEP_IN	0x00000001


+2 −2
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ struct fsl_espi_transfer {
/* SPCOM register values */
/* SPCOM register values */
#define SPCOM_CS(x)		((x) << 30)
#define SPCOM_CS(x)		((x) << 30)
#define SPCOM_TRANLEN(x)	((x) << 0)
#define SPCOM_TRANLEN(x)	((x) << 0)
#define	SPCOM_TRANLEN_MAX	0xFFFF	/* Max transaction length */
#define	SPCOM_TRANLEN_MAX	0x10000	/* Max transaction length */


#define AUTOSUSPEND_TIMEOUT 2000
#define AUTOSUSPEND_TIMEOUT 2000


@@ -233,7 +233,7 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
	reinit_completion(&mpc8xxx_spi->done);
	reinit_completion(&mpc8xxx_spi->done);


	/* Set SPCOM[CS] and SPCOM[TRANLEN] field */
	/* Set SPCOM[CS] and SPCOM[TRANLEN] field */
	if ((t->len - 1) > SPCOM_TRANLEN_MAX) {
	if (t->len > SPCOM_TRANLEN_MAX) {
		dev_err(mpc8xxx_spi->dev, "Transaction length (%d)"
		dev_err(mpc8xxx_spi->dev, "Transaction length (%d)"
				" beyond the SPCOM[TRANLEN] field\n", t->len);
				" beyond the SPCOM[TRANLEN] field\n", t->len);
		return -EINVAL;
		return -EINVAL;
+5 −3
Original line number Original line Diff line number Diff line
@@ -929,7 +929,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
					tx->sgl, tx->nents, DMA_MEM_TO_DEV,
					tx->sgl, tx->nents, DMA_MEM_TO_DEV,
					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
		if (!desc_tx)
		if (!desc_tx)
			goto no_dma;
			goto tx_nodma;


		desc_tx->callback = spi_imx_dma_tx_callback;
		desc_tx->callback = spi_imx_dma_tx_callback;
		desc_tx->callback_param = (void *)spi_imx;
		desc_tx->callback_param = (void *)spi_imx;
@@ -941,7 +941,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
					rx->sgl, rx->nents, DMA_DEV_TO_MEM,
					rx->sgl, rx->nents, DMA_DEV_TO_MEM,
					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
		if (!desc_rx)
		if (!desc_rx)
			goto no_dma;
			goto rx_nodma;


		desc_rx->callback = spi_imx_dma_rx_callback;
		desc_rx->callback = spi_imx_dma_rx_callback;
		desc_rx->callback_param = (void *)spi_imx;
		desc_rx->callback_param = (void *)spi_imx;
@@ -1008,7 +1008,9 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,


	return ret;
	return ret;


no_dma:
rx_nodma:
	dmaengine_terminate_all(master->dma_tx);
tx_nodma:
	pr_warn_once("%s %s: DMA not available, falling back to PIO\n",
	pr_warn_once("%s %s: DMA not available, falling back to PIO\n",
		     dev_driver_string(&master->dev),
		     dev_driver_string(&master->dev),
		     dev_name(&master->dev));
		     dev_name(&master->dev));
+1 −0
Original line number Original line Diff line number Diff line
@@ -761,6 +761,7 @@ static int spi_test_run_iter(struct spi_device *spi,
		test.iterate_transfer_mask = 1;
		test.iterate_transfer_mask = 1;


	/* count number of transfers with tx/rx_buf != NULL */
	/* count number of transfers with tx/rx_buf != NULL */
	rx_count = tx_count = 0;
	for (i = 0; i < test.transfer_count; i++) {
	for (i = 0; i < test.transfer_count; i++) {
		if (test.transfers[i].tx_buf)
		if (test.transfers[i].tx_buf)
			tx_count++;
			tx_count++;
Loading