Commit 96364527 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'spi-fix-v6.15-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A small collection of fixes that came in during the merge window,
  everything is driver specific with nothing standing out particularly"

* tag 'spi-fix-v6.15-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: bcm2835: Restore native CS probing when pinctrl-bcm2835 is absent
  spi: bcm2835: Do not call gpiod_put() on invalid descriptor
  spi: cadence-qspi: revert "Improve spi memory performance"
  spi: cadence: Fix out-of-bounds array access in cdns_mrvl_xspi_setup_clock()
  spi: fsl-qspi: use devm function instead of driver remove
  spi: SPI_QPIC_SNAND should be tristate and depend on MTD
  spi-rockchip: Fix register out of bounds access
parents a05c6e66 e19c1272
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -937,9 +937,9 @@ config SPI_QCOM_QSPI
	  QSPI(Quad SPI) driver for Qualcomm QSPI controller.

config SPI_QPIC_SNAND
	bool "QPIC SNAND controller"
	tristate "QPIC SNAND controller"
	depends on ARCH_QCOM || COMPILE_TEST
	select MTD
	depends on MTD
	help
	  QPIC_SNAND (QPIC SPI NAND) driver for Qualcomm QPIC controller.
	  QPIC controller supports both parallel nand and serial nand.
+16 −2
Original line number Diff line number Diff line
@@ -1162,6 +1162,7 @@ static void bcm2835_spi_cleanup(struct spi_device *spi)
				 sizeof(u32),
				 DMA_TO_DEVICE);

	if (!IS_ERR(bs->cs_gpio))
		gpiod_put(bs->cs_gpio);
	spi_set_csgpiod(spi, 0, NULL);

@@ -1225,7 +1226,12 @@ static int bcm2835_spi_setup(struct spi_device *spi)
	struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
	struct bcm2835_spidev *target = spi_get_ctldata(spi);
	struct gpiod_lookup_table *lookup __free(kfree) = NULL;
	int ret;
	const char *pinctrl_compats[] = {
		"brcm,bcm2835-gpio",
		"brcm,bcm2711-gpio",
		"brcm,bcm7211-gpio",
	};
	int ret, i;
	u32 cs;

	if (!target) {
@@ -1290,6 +1296,14 @@ static int bcm2835_spi_setup(struct spi_device *spi)
		goto err_cleanup;
	}

	for (i = 0; i < ARRAY_SIZE(pinctrl_compats); i++) {
		if (of_find_compatible_node(NULL, NULL, pinctrl_compats[i]))
			break;
	}

	if (i == ARRAY_SIZE(pinctrl_compats))
		return 0;

	/*
	 * TODO: The code below is a slightly better alternative to the utter
	 * abuse of the GPIO API that I found here before. It creates a
+1 −1
Original line number Diff line number Diff line
@@ -2073,7 +2073,7 @@ static const struct cqspi_driver_platdata k2g_qspi = {

static const struct cqspi_driver_platdata am654_ospi = {
	.hwcaps_mask = CQSPI_SUPPORTS_OCTAL | CQSPI_SUPPORTS_QUAD,
	.quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_NEEDS_WR_DELAY,
	.quirks = CQSPI_NEEDS_WR_DELAY,
};

static const struct cqspi_driver_platdata intel_lgm_qspi = {
+1 −1
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ static bool cdns_mrvl_xspi_setup_clock(struct cdns_xspi_dev *cdns_xspi,
	u32 clk_reg;
	bool update_clk = false;

	while (i < ARRAY_SIZE(cdns_mrvl_xspi_clk_div_list)) {
	while (i < (ARRAY_SIZE(cdns_mrvl_xspi_clk_div_list) - 1)) {
		clk_val = MRVL_XSPI_CLOCK_DIVIDED(
				cdns_mrvl_xspi_clk_div_list[i]);
		if (clk_val <= requested_clk)
+17 −14
Original line number Diff line number Diff line
@@ -844,6 +844,19 @@ static const struct spi_controller_mem_caps fsl_qspi_mem_caps = {
	.per_op_freq = true,
};

static void fsl_qspi_cleanup(void *data)
{
	struct fsl_qspi *q = data;

	/* disable the hardware */
	qspi_writel(q, QUADSPI_MCR_MDIS_MASK, q->iobase + QUADSPI_MCR);
	qspi_writel(q, 0x0, q->iobase + QUADSPI_RSER);

	fsl_qspi_clk_disable_unprep(q);

	mutex_destroy(&q->lock);
}

static int fsl_qspi_probe(struct platform_device *pdev)
{
	struct spi_controller *ctlr;
@@ -934,6 +947,10 @@ static int fsl_qspi_probe(struct platform_device *pdev)

	ctlr->dev.of_node = np;

	ret = devm_add_action_or_reset(dev, fsl_qspi_cleanup, q);
	if (ret)
		goto err_destroy_mutex;

	ret = devm_spi_register_controller(dev, ctlr);
	if (ret)
		goto err_destroy_mutex;
@@ -953,19 +970,6 @@ static int fsl_qspi_probe(struct platform_device *pdev)
	return ret;
}

static void fsl_qspi_remove(struct platform_device *pdev)
{
	struct fsl_qspi *q = platform_get_drvdata(pdev);

	/* disable the hardware */
	qspi_writel(q, QUADSPI_MCR_MDIS_MASK, q->iobase + QUADSPI_MCR);
	qspi_writel(q, 0x0, q->iobase + QUADSPI_RSER);

	fsl_qspi_clk_disable_unprep(q);

	mutex_destroy(&q->lock);
}

static int fsl_qspi_suspend(struct device *dev)
{
	return 0;
@@ -1003,7 +1007,6 @@ static struct platform_driver fsl_qspi_driver = {
		.pm =   &fsl_qspi_pm_ops,
	},
	.probe          = fsl_qspi_probe,
	.remove		= fsl_qspi_remove,
};
module_platform_driver(fsl_qspi_driver);

Loading