[PATCH next 1/1] spi: sifive: add PM callbacks to support suspend/resume

Mark Brown broonie at kernel.org
Fri Jun 10 05:04:39 PDT 2022


On Fri, Jun 10, 2022 at 03:44:59PM +0800, Andy Chiu wrote:

> +static int sifive_spi_suspend(struct device *dev)
> +{
> +	struct spi_master *master = dev_get_drvdata(dev);
> +	struct sifive_spi *spi = spi_master_get_devdata(master);
> +	int ret;
> +
> +	ret = spi_master_suspend(master);
> +	if (ret)
> +		return ret;
> +
> +	/* Disable all the interrupts just in case */
> +	sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0);
> +
> +	clk_disable_unprepare(spi->clk);

Seems like the clock managemnet could usefully be done as runtime PM
too?  In any case, that can be done as an incremental change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20220610/776de169/attachment.sig>


More information about the linux-riscv mailing list