diff options
Diffstat (limited to 'drivers/spi/spi-geni-qcom.c')
-rw-r--r-- | drivers/spi/spi-geni-qcom.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index bb4cdda2dec8..cbc1ff3203e6 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -78,6 +78,7 @@ struct spi_geni_master { u32 fifo_width_bits; u32 tx_wm; unsigned long cur_speed_hz; + unsigned long cur_sclk_hz; unsigned int cur_bits_per_word; unsigned int tx_rem_bytes; unsigned int rx_rem_bytes; @@ -115,6 +116,9 @@ static int get_spi_clk_cfg(unsigned int speed_hz, ret = dev_pm_opp_set_rate(mas->dev, sclk_freq); if (ret) dev_err(mas->dev, "dev_pm_opp_set_rate failed %d\n", ret); + else + mas->cur_sclk_hz = sclk_freq; + return ret; } @@ -674,7 +678,11 @@ static int __maybe_unused spi_geni_runtime_resume(struct device *dev) if (ret) return ret; - return geni_se_resources_on(&mas->se); + ret = geni_se_resources_on(&mas->se); + if (ret) + return ret; + + return dev_pm_opp_set_rate(mas->dev, mas->cur_sclk_hz); } static int __maybe_unused spi_geni_suspend(struct device *dev) |