Commit fb5dece0 authored by Hisashi Nakamura's avatar Hisashi Nakamura Committed by Luis Henriques

spi: sh-msiof: Add runtime PM lock in initializing

commit 01576056 upstream.

SH-MSIOF driver is enabled autosuspend API of spi framework.
But autosuspend framework doesn't work during initializing.
So runtime PM lock is added in SH-MSIOF driver initializing.

Fixes: e2a0ba54 (spi: sh-msiof: Convert to spi core auto_runtime_pm framework)
Signed-off-by: default avatarHisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: default avatarYoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 780a61e9
......@@ -421,6 +421,8 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
struct device_node *np = spi->master->dev.of_node;
struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
pm_runtime_get_sync(&p->pdev->dev);
if (!np) {
/*
* Use spi->controller_data for CS (same strategy as spi_gpio),
......@@ -439,6 +441,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
if (spi->cs_gpio >= 0)
gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
pm_runtime_put_sync(&p->pdev->dev);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment