Skip to content

Commit

Permalink
spi: sh-msiof: Add runtime PM lock in initializing
Browse files Browse the repository at this point in the history
commit 0157605 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: e2a0ba5 (spi: sh-msiof: Convert to spi core auto_runtime_pm framework)
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Hisashi Nakamura authored and Greg Kroah-Hartman committed Jan 16, 2015
1 parent e8ff149 commit f34d67f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/spi/spi-sh-msiof.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,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),
Expand All @@ -498,6 +500,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;
}

Expand Down

0 comments on commit f34d67f

Please sign in to comment.