Commit de90cc61 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull spi fixes from Mark Brown:
 "A few standard fixes here, plus one more interesting one from Hans
  which addresses an issue where a move in when we requested GPIOs on
  ACPI systems caused us to stop doing pinmuxing and leave things
  floating that we'd really rather not have floating"

* tag 'spi-fix-v6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: Add TODO comment about ACPI GPIO setup
  spi: xilinx: increase number of retries before declaring stall
  spi: imx: keep dma request disabled before dma transfer setup
  spi: Try to get ACPI GPIO IRQ earlier
parents 809bd274 66e9feb0
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -519,10 +519,16 @@ static void mx51_ecspi_trigger(struct spi_imx_data *spi_imx)
{
	u32 reg;

	if (spi_imx->usedma) {
		reg = readl(spi_imx->base + MX51_ECSPI_DMA);
		reg |= MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN;
		writel(reg, spi_imx->base + MX51_ECSPI_DMA);
	} else {
		reg = readl(spi_imx->base + MX51_ECSPI_CTRL);
		reg |= MX51_ECSPI_CTRL_XCH;
		writel(reg, spi_imx->base + MX51_ECSPI_CTRL);
	}
}

static void mx51_ecspi_disable(struct spi_imx_data *spi_imx)
{
@@ -759,7 +765,6 @@ static void mx51_setup_wml(struct spi_imx_data *spi_imx)
	writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) |
		MX51_ECSPI_DMA_TX_WML(tx_wml) |
		MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) |
		MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN |
		MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA);
}

@@ -1520,6 +1525,8 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
	reinit_completion(&spi_imx->dma_tx_completion);
	dma_async_issue_pending(controller->dma_tx);

	spi_imx->devtype_data->trigger(spi_imx);

	transfer_timeout = spi_imx_calculate_timeout(spi_imx, transfer->len);

	/* Wait SDMA to finish the data transfer.*/
+1 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)

		/* Read out all the data from the Rx FIFO */
		rx_words = n_words;
		stalled = 10;
		stalled = 32;
		while (rx_words) {
			if (rx_words == n_words && !(stalled--) &&
			    !(sr & XSPI_SR_TX_EMPTY_MASK) &&
+12 −0
Original line number Diff line number Diff line
@@ -2851,6 +2851,18 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr,
	acpi_set_modalias(adev, acpi_device_hid(adev), spi->modalias,
			  sizeof(spi->modalias));

	/*
	 * This gets re-tried in spi_probe() for -EPROBE_DEFER handling in case
	 * the GPIO controller does not have a driver yet. This needs to be done
	 * here too, because this call sets the GPIO direction and/or bias.
	 * Setting these needs to be done even if there is no driver, in which
	 * case spi_probe() will never get called.
	 * TODO: ideally the setup of the GPIO should be handled in a generic
	 * manner in the ACPI/gpiolib core code.
	 */
	if (spi->irq < 0)
		spi->irq = acpi_dev_gpio_irq_get(adev, 0);

	acpi_device_set_enumerated(adev);

	adev->power.flags.ignore_parent = true;