diff options
author | Brian Norris <briannorris@chromium.org> | 2016-12-16 16:59:16 -0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-12-19 13:29:27 +0000 |
commit | 23e291c2e4c84a40a4b3de8539dec95bfda214f1 (patch) | |
tree | 3416c6120ce48a4df0fbf716eeaee5af056d6faa /drivers/spi | |
parent | fafd67940774733fa97f4b09412aea6981b82e0a (diff) | |
download | linux-next-23e291c2e4c84a40a4b3de8539dec95bfda214f1.tar.gz |
spi: rockchip: support "sleep" pin configuration
In the pattern of many other devices, support a system-sleep pin
configuration.
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-rockchip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 0f89c2169c24..acf31f36b898 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -17,6 +17,7 @@ #include <linux/dmaengine.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> #include <linux/spi/spi.h> #include <linux/pm_runtime.h> @@ -843,6 +844,8 @@ static int rockchip_spi_suspend(struct device *dev) clk_disable_unprepare(rs->apb_pclk); } + pinctrl_pm_select_sleep_state(dev); + return ret; } @@ -852,6 +855,8 @@ static int rockchip_spi_resume(struct device *dev) struct spi_master *master = dev_get_drvdata(dev); struct rockchip_spi *rs = spi_master_get_devdata(master); + pinctrl_pm_select_default_state(dev); + if (!pm_runtime_suspended(dev)) { ret = clk_prepare_enable(rs->apb_pclk); if (ret < 0) |