Skip to content

Commit 5cf7ebe

Browse files
committed
Merge tag 'spi-fix-v6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "There's two things here - the big one is a batch of fixes for the power management in the Cadence QuadSPI driver which had some serious issues with runtime PM and there's also a revert of one of the last batch of fixes for ppc4xx which has a dependency on -next but was in between two mainline fixes so the -next dependency got missed. The ppc4xx driver is not currently included in any defconfig and has dependencies that exclude it from allmodconfigs so none of the CI systems catch issues with it, hence the need for the earlier fixes series. There's some updates to the PowerPC configs to address this" * tag 'spi-fix-v6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: Drop mismerged fix spi: cadence-qspi: add system-wide suspend and resume callbacks spi: cadence-qspi: put runtime in runtime PM hooks names spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks spi: cadence-qspi: fix pointer reference in runtime PM hooks
2 parents 628e059 + 6415c7f commit 5cf7ebe

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,37 +1927,46 @@ static void cqspi_remove(struct platform_device *pdev)
19271927
pm_runtime_disable(&pdev->dev);
19281928
}
19291929

1930-
static int cqspi_suspend(struct device *dev)
1930+
static int cqspi_runtime_suspend(struct device *dev)
19311931
{
19321932
struct cqspi_st *cqspi = dev_get_drvdata(dev);
1933-
struct spi_controller *host = dev_get_drvdata(dev);
1934-
int ret;
19351933

1936-
ret = spi_controller_suspend(host);
19371934
cqspi_controller_enable(cqspi, 0);
1938-
19391935
clk_disable_unprepare(cqspi->clk);
1940-
1941-
return ret;
1936+
return 0;
19421937
}
19431938

1944-
static int cqspi_resume(struct device *dev)
1939+
static int cqspi_runtime_resume(struct device *dev)
19451940
{
19461941
struct cqspi_st *cqspi = dev_get_drvdata(dev);
1947-
struct spi_controller *host = dev_get_drvdata(dev);
19481942

19491943
clk_prepare_enable(cqspi->clk);
19501944
cqspi_wait_idle(cqspi);
19511945
cqspi_controller_init(cqspi);
19521946

19531947
cqspi->current_cs = -1;
19541948
cqspi->sclk = 0;
1949+
return 0;
1950+
}
1951+
1952+
static int cqspi_suspend(struct device *dev)
1953+
{
1954+
struct cqspi_st *cqspi = dev_get_drvdata(dev);
1955+
1956+
return spi_controller_suspend(cqspi->host);
1957+
}
19551958

1956-
return spi_controller_resume(host);
1959+
static int cqspi_resume(struct device *dev)
1960+
{
1961+
struct cqspi_st *cqspi = dev_get_drvdata(dev);
1962+
1963+
return spi_controller_resume(cqspi->host);
19571964
}
19581965

1959-
static DEFINE_RUNTIME_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend,
1960-
cqspi_resume, NULL);
1966+
static const struct dev_pm_ops cqspi_dev_pm_ops = {
1967+
RUNTIME_PM_OPS(cqspi_runtime_suspend, cqspi_runtime_resume, NULL)
1968+
SYSTEM_SLEEP_PM_OPS(cqspi_suspend, cqspi_resume)
1969+
};
19611970

19621971
static const struct cqspi_driver_platdata cdns_qspi = {
19631972
.quirks = CQSPI_DISABLE_DAC_MODE,

drivers/spi/spi-ppc4xx.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,22 +359,22 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
359359

360360
/* Setup the state for the bitbang driver */
361361
bbp = &hw->bitbang;
362-
bbp->ctlr = hw->host;
362+
bbp->master = hw->host;
363363
bbp->setup_transfer = spi_ppc4xx_setupxfer;
364364
bbp->txrx_bufs = spi_ppc4xx_txrx;
365365
bbp->use_dma = 0;
366-
bbp->ctlr->setup = spi_ppc4xx_setup;
367-
bbp->ctlr->cleanup = spi_ppc4xx_cleanup;
368-
bbp->ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
369-
bbp->ctlr->use_gpio_descriptors = true;
366+
bbp->master->setup = spi_ppc4xx_setup;
367+
bbp->master->cleanup = spi_ppc4xx_cleanup;
368+
bbp->master->bits_per_word_mask = SPI_BPW_MASK(8);
369+
bbp->master->use_gpio_descriptors = true;
370370
/*
371371
* The SPI core will count the number of GPIO descriptors to figure
372372
* out the number of chip selects available on the platform.
373373
*/
374-
bbp->ctlr->num_chipselect = 0;
374+
bbp->master->num_chipselect = 0;
375375

376376
/* the spi->mode bits understood by this driver: */
377-
bbp->ctlr->mode_bits =
377+
bbp->master->mode_bits =
378378
SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LSB_FIRST;
379379

380380
/* Get the clock for the OPB */

0 commit comments

Comments
 (0)