[PATCH] spi: loongson: pm: add .freeze .poweroff .thaw .restore

Li Jun <[email protected]>
Newsgroups org.kernel.vger.linux-spi
Message-ID <[email protected]>
after execute s4, the spi error,
[ 1104.754246][ 4] [    T1] tpm_tis_spi spi-SMO0768:00: SPI transfer failed: -110
[ 1104.761503][ 4] [    T1] spi_master spi1: failed to transfer one message from queue
[ 1104.769201][ 4] [    T1] spi_master spi1: noqueue transfer failed
[ 1104.776344][ 4] [    T1] tpm_tis_spi spi-SMO0768:00: SPI transfer failed: -110
[ 1104.783609][ 4] [    T1] spi_master spi1: failed to transfer one message from queue
[ 1104.791308][ 4] [    T1] spi_master spi1: noqueue transfer failed
[ 1104.797446][ 4] [    T1] gttadd tpm_chip_start1 ret = -110
and in s4 the loongson_spi_resume&suspend are
not called at all.
add .freeze .poweroff .thaw .restore, after s4 the spi
communication is normal.

Signed-off-by: Li Jun <[email protected]>
---
 drivers/spi/spi-loongson-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-loongson-core.c b/drivers/spi/spi-loongson-core.c
index 30b6a7176ce9..28962c01c7e4 100644
--- a/drivers/spi/spi-loongson-core.c
+++ b/drivers/spi/spi-loongson-core.c
@@ -271,7 +271,11 @@ static int loongson_spi_resume(struct device *dev)
 
 const struct dev_pm_ops loongson_spi_dev_pm_ops = {
 	.suspend = loongson_spi_suspend,
+	.freeze = loongson_spi_suspend,
+	.poweroff = loongson_spi_suspend,
 	.resume = loongson_spi_resume,
+	.thaw = loongson_spi_resume,
+	.restore = loongson_spi_resume,
 };
 EXPORT_SYMBOL_NS_GPL(loongson_spi_dev_pm_ops, "SPI_LOONGSON_CORE");
 
-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.