* [PATCH] Asoc: Samsung: I2S: Add support for runtime S2R
@ 2013-01-30 12:11 R. Chandrasekar
2013-01-31 7:36 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: R. Chandrasekar @ 2013-01-30 12:11 UTC (permalink / raw)
To: linux-arm-kernel
From: "R. Chandrasekar" <rcsekar@samsung.com>
This patch adds runtime suspend to resume support for I2S.
I2S clk is disabled at suspend and enabled at resume.
Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
sound/soc/samsung/i2s.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 2fc42f9..d7231e3 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1071,6 +1071,26 @@ static inline int samsung_i2s_get_driver_data(struct platform_device *pdev)
return platform_get_device_id(pdev)->driver_data;
}
+#ifdef CONFIG_PM_RUNTIME
+static int i2s_runtime_suspend(struct device *dev)
+{
+ struct i2s_dai *i2s = dev_get_drvdata(dev);
+
+ clk_disable_unprepare(i2s->clk);
+
+ return 0;
+}
+
+static int i2s_runtime_resume(struct device *dev)
+{
+ struct i2s_dai *i2s = dev_get_drvdata(dev);
+
+ clk_prepare_enable(i2s->clk);
+
+ return 0;
+}
+#endif /* CONFIG_PM_RUNTIME */
+
static int samsung_i2s_probe(struct platform_device *pdev)
{
struct i2s_dai *pri_dai, *sec_dai = NULL;
@@ -1288,6 +1308,11 @@ static const struct of_device_id exynos_i2s_match[] = {
MODULE_DEVICE_TABLE(of, exynos_i2s_match);
#endif
+static const struct dev_pm_ops samsung_i2s_pm = {
+ SET_RUNTIME_PM_OPS(i2s_runtime_suspend,
+ i2s_runtime_resume, NULL)
+};
+
static struct platform_driver samsung_i2s_driver = {
.probe = samsung_i2s_probe,
.remove = samsung_i2s_remove,
@@ -1296,6 +1321,7 @@ static struct platform_driver samsung_i2s_driver = {
.name = "samsung-i2s",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(exynos_i2s_match),
+ .pm = &samsung_i2s_pm,
},
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] Asoc: Samsung: I2S: Add support for runtime S2R
2013-01-30 12:11 [PATCH] Asoc: Samsung: I2S: Add support for runtime S2R R. Chandrasekar
@ 2013-01-31 7:36 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-01-31 7:36 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jan 30, 2013 at 05:41:04PM +0530, R. Chandrasekar wrote:
> From: "R. Chandrasekar" <rcsekar@samsung.com>
>
> This patch adds runtime suspend to resume support for I2S.
> I2S clk is disabled at suspend and enabled at resume.
Applied, thanks. Please use subject lines appropriate to the subsystem
and keep your signoffs in order:
> Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130131/9c0eda64/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-31 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 12:11 [PATCH] Asoc: Samsung: I2S: Add support for runtime S2R R. Chandrasekar
2013-01-31 7:36 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).