Merge tag 'spi-fix-v6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A few final driver specific fixes that have been sitting in -next for
a bit.

The OMAP issue is likely to come up very infrequently since mixed
configuration SPI buses are rare and the Cadence issue is specific to
SoCFPGA systems"

* tag 'spi-fix-v6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: omap2-mcspi: drive SPI_CLK on transfer_setup()
spi: cadence-qspi: defer runtime support on socfpga if reset bit is enabled

Changed files
+37 -17
drivers
+36 -17
drivers/spi/spi-cadence-quadspi.c
··· 46 46 #define CQSPI_DMA_SET_MASK BIT(7) 47 47 #define CQSPI_SUPPORT_DEVICE_RESET BIT(8) 48 48 #define CQSPI_DISABLE_STIG_MODE BIT(9) 49 + #define CQSPI_DISABLE_RUNTIME_PM BIT(10) 49 50 50 51 /* Capabilities */ 51 52 #define CQSPI_SUPPORTS_OCTAL BIT(0) ··· 1469 1468 int ret; 1470 1469 struct cqspi_st *cqspi = spi_controller_get_devdata(mem->spi->controller); 1471 1470 struct device *dev = &cqspi->pdev->dev; 1471 + const struct cqspi_driver_platdata *ddata = of_device_get_match_data(dev); 1472 1472 1473 1473 if (refcount_read(&cqspi->inflight_ops) == 0) 1474 1474 return -ENODEV; 1475 1475 1476 - ret = pm_runtime_resume_and_get(dev); 1477 - if (ret) { 1478 - dev_err(&mem->spi->dev, "resume failed with %d\n", ret); 1479 - return ret; 1476 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 1477 + ret = pm_runtime_resume_and_get(dev); 1478 + if (ret) { 1479 + dev_err(&mem->spi->dev, "resume failed with %d\n", ret); 1480 + return ret; 1481 + } 1480 1482 } 1481 1483 1482 1484 if (!refcount_read(&cqspi->refcount)) ··· 1495 1491 1496 1492 ret = cqspi_mem_process(mem, op); 1497 1493 1498 - pm_runtime_put_autosuspend(dev); 1494 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 1495 + pm_runtime_put_autosuspend(dev); 1499 1496 1500 1497 if (ret) 1501 1498 dev_err(&mem->spi->dev, "operation failed with %d\n", ret); ··· 1990 1985 goto probe_setup_failed; 1991 1986 } 1992 1987 1993 - pm_runtime_enable(dev); 1994 - 1995 - pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT); 1996 - pm_runtime_use_autosuspend(dev); 1997 - pm_runtime_get_noresume(dev); 1988 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 1989 + pm_runtime_enable(dev); 1990 + pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT); 1991 + pm_runtime_use_autosuspend(dev); 1992 + pm_runtime_get_noresume(dev); 1993 + } 1998 1994 1999 1995 ret = spi_register_controller(host); 2000 1996 if (ret) { ··· 2003 1997 goto probe_setup_failed; 2004 1998 } 2005 1999 2006 - pm_runtime_put_autosuspend(dev); 2000 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 2001 + pm_runtime_put_autosuspend(dev); 2002 + pm_runtime_mark_last_busy(dev); 2003 + pm_runtime_put_autosuspend(dev); 2004 + } 2007 2005 2008 2006 return 0; 2009 2007 probe_setup_failed: 2010 2008 cqspi_controller_enable(cqspi, 0); 2011 - pm_runtime_disable(dev); 2009 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2010 + pm_runtime_disable(dev); 2012 2011 probe_reset_failed: 2013 2012 if (cqspi->is_jh7110) 2014 2013 cqspi_jh7110_disable_clk(pdev, cqspi); ··· 2024 2013 2025 2014 static void cqspi_remove(struct platform_device *pdev) 2026 2015 { 2016 + const struct cqspi_driver_platdata *ddata; 2027 2017 struct cqspi_st *cqspi = platform_get_drvdata(pdev); 2018 + struct device *dev = &pdev->dev; 2019 + 2020 + ddata = of_device_get_match_data(dev); 2028 2021 2029 2022 refcount_set(&cqspi->refcount, 0); 2030 2023 ··· 2041 2026 if (cqspi->rx_chan) 2042 2027 dma_release_channel(cqspi->rx_chan); 2043 2028 2044 - if (pm_runtime_get_sync(&pdev->dev) >= 0) 2045 - clk_disable(cqspi->clk); 2029 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) 2030 + if (pm_runtime_get_sync(&pdev->dev) >= 0) 2031 + clk_disable(cqspi->clk); 2046 2032 2047 2033 if (cqspi->is_jh7110) 2048 2034 cqspi_jh7110_disable_clk(pdev, cqspi); 2049 2035 2050 - pm_runtime_put_sync(&pdev->dev); 2051 - pm_runtime_disable(&pdev->dev); 2036 + if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) { 2037 + pm_runtime_put_sync(&pdev->dev); 2038 + pm_runtime_disable(&pdev->dev); 2039 + } 2052 2040 } 2053 2041 2054 2042 static int cqspi_runtime_suspend(struct device *dev) ··· 2130 2112 .quirks = CQSPI_DISABLE_DAC_MODE 2131 2113 | CQSPI_NO_SUPPORT_WR_COMPLETION 2132 2114 | CQSPI_SLOW_SRAM 2133 - | CQSPI_DISABLE_STIG_MODE, 2115 + | CQSPI_DISABLE_STIG_MODE 2116 + | CQSPI_DISABLE_RUNTIME_PM, 2134 2117 }; 2135 2118 2136 2119 static const struct cqspi_driver_platdata versal_ospi = {
+1
drivers/spi/spi-omap2-mcspi.c
··· 988 988 else 989 989 l &= ~OMAP2_MCSPI_CHCONF_PHA; 990 990 991 + mcspi_write_chconf0(spi, l | OMAP2_MCSPI_CHCONF_FORCE); 991 992 mcspi_write_chconf0(spi, l); 992 993 993 994 cs->mode = spi->mode;