aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch')
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch
new file mode 100644
index 000000000..ad4e4bc03
--- /dev/null
+++ b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch
@@ -0,0 +1,110 @@
+From dfc07c05c50155420e47f85442d099d433db869b Mon Sep 17 00:00:00 2001
+From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
+Date: Fri, 9 Jun 2017 20:11:49 +0900
+Subject: [PATCH 1/3] Add shdmac hibernation code
+
+Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
+---
+ drivers/dma/sh/shdmac.c | 36 ++++++++++++++++++++++++------------
+ 1 file changed, 24 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
+index 1c97cc5..d084437 100644
+--- a/drivers/dma/sh/shdmac.c
++++ b/drivers/dma/sh/shdmac.c
+@@ -743,11 +743,20 @@ static int sh_dmae_resume(struct device *dev)
+ #define sh_dmae_resume NULL
+ #endif
+
++static int sh_dmae_restore(struct device *dev)
++{
++#ifdef CONFIG_PM
++ return sh_dmae_resume(dev);
++#else
++ return 0;
++#endif
++}
++
+ const struct dev_pm_ops sh_dmae_pm = {
+- .suspend = sh_dmae_suspend,
+- .resume = sh_dmae_resume,
+- .runtime_suspend = sh_dmae_runtime_suspend,
+- .runtime_resume = sh_dmae_runtime_resume,
++ SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume)
++ SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume,
++ NULL)
++ .restore_noirq = sh_dmae_restore,
+ };
+
+ static dma_addr_t sh_dmae_slave_addr(struct shdma_chan *schan)
+@@ -798,7 +807,6 @@ static int sh_dmae_probe(struct platform_device *pdev)
+ struct sh_dmae_device *shdev;
+ struct dma_device *dma_dev;
+ struct resource *chan, *dmars, *errirq_res, *chanirq_res;
+- unsigned long flags;
+
+ if (pdev->dev.of_node)
+ pdata = of_match_device(sh_dmae_of_match, &pdev->dev)->data;
+@@ -885,9 +893,9 @@ static int sh_dmae_probe(struct platform_device *pdev)
+ if (err < 0)
+ dev_err(&pdev->dev, "%s(): GET = %d\n", __func__, err);
+
+- spin_lock_irqsave(&sh_dmae_lock, flags);
++ spin_lock_irq(&sh_dmae_lock);
+ list_add_tail_rcu(&shdev->node, &sh_dmae_devices);
+- spin_unlock_irqrestore(&sh_dmae_lock, flags);
++ spin_unlock_irq(&sh_dmae_lock);
+
+ /* reset dma controller - only needed as a test */
+ err = sh_dmae_rst(shdev);
+@@ -981,6 +989,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
+ return err;
+
+ edmadevreg:
++ pm_runtime_get(&pdev->dev);
+ chan_probe_err:
+ sh_dmae_chan_remove(shdev);
+
+@@ -988,9 +997,9 @@ chan_probe_err:
+ eirq_err:
+ #endif
+ rst_err:
+- spin_lock_irqsave(&sh_dmae_lock, flags);
++ spin_lock_irq(&sh_dmae_lock);
+ list_del_rcu(&shdev->node);
+- spin_unlock_irqrestore(&sh_dmae_lock, flags);
++ spin_unlock_irq(&sh_dmae_lock);
+
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+@@ -1007,13 +1016,12 @@ static int sh_dmae_remove(struct platform_device *pdev)
+ {
+ struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
+ struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
+- unsigned long flags;
+
+ dma_async_device_unregister(dma_dev);
+
+- spin_lock_irqsave(&sh_dmae_lock, flags);
++ spin_lock_irq(&sh_dmae_lock);
+ list_del_rcu(&shdev->node);
+- spin_unlock_irqrestore(&sh_dmae_lock, flags);
++ spin_unlock_irq(&sh_dmae_lock);
+
+ pm_runtime_disable(&pdev->dev);
+
+@@ -1047,7 +1055,11 @@ static int __init sh_dmae_init(void)
+
+ return platform_driver_probe(&sh_dmae_driver, sh_dmae_probe);
+ }
++#ifdef MODULE
+ module_init(sh_dmae_init);
++#else
++subsys_initcall(sh_dmae_init);
++#endif
+
+ static void __exit sh_dmae_exit(void)
+ {
+--
+1.8.3.1
+