alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Asoc: Samsung: Add support for I2S runtime S2R
@ 2013-01-24 12:35 R. Chandrasekar
  2013-01-24 12:35 ` [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function R. Chandrasekar
  2013-01-26  7:27 ` [PATCH] Asoc: Samsung: Add support for I2S runtime S2R Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: R. Chandrasekar @ 2013-01-24 12:35 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc, alsa-devel
  Cc: sbkim73, broonie, ben-linux, kgene.kim, jassisinghbrar,
	R. Chandrasekar

From: "R. Chandrasekar" <rcsekar@samsung.com>

This patch adds runtime suspend to resume support for I2S.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: R. Chandrasekar <rcsekar@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 d2d124f..27a5ab1 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -993,6 +993,26 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
 	return i2s;
 }
 
+#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)
 {
 	u32 dma_pl_chan, dma_cp_chan, dma_pl_sec_chan;
@@ -1143,12 +1163,18 @@ static int samsung_i2s_remove(struct platform_device *pdev)
 	return 0;
 }
 
+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,
 	.driver = {
 		.name = "samsung-i2s",
 		.owner = THIS_MODULE,
+		.pm = &samsung_i2s_pm,
 	},
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function
  2013-01-24 12:35 [PATCH] Asoc: Samsung: Add support for I2S runtime S2R R. Chandrasekar
@ 2013-01-24 12:35 ` R. Chandrasekar
  2013-01-26  7:25   ` Mark Brown
  2013-01-26  7:27 ` [PATCH] Asoc: Samsung: Add support for I2S runtime S2R Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: R. Chandrasekar @ 2013-01-24 12:35 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc, alsa-devel
  Cc: sbkim73, broonie, ben-linux, kgene.kim, jassisinghbrar,
	Padmavathi Venna

From: Padmavathi Venna <padma.v@samsung.com>

I2S module need to be reset after S2R. Keeping the S/W rst
control part in resume didn't help in playing audio after resume.
So this patch adds S/W RST control part in startup function which
gets triggered for every new audio stream playback.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
---
 sound/soc/samsung/i2s.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 27a5ab1..9f098cd 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -651,6 +651,9 @@ static int i2s_startup(struct snd_pcm_substream *substream,
 	/* Enforce set_sysclk in Master mode */
 	i2s->rclk_srcrate = 0;
 
+	if (!any_active(i2s) && (i2s->quirks & QUIRK_NEED_RSTCLR))
+		writel(CON_RSTCLR, i2s->addr + I2SCON);
+
 	spin_unlock_irqrestore(&lock, flags);
 
 	return 0;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function
  2013-01-24 12:35 ` [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function R. Chandrasekar
@ 2013-01-26  7:25   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-01-26  7:25 UTC (permalink / raw)
  To: R. Chandrasekar
  Cc: linux-arm-kernel, linux-samsung-soc, alsa-devel, sbkim73,
	ben-linux, kgene.kim, jassisinghbrar, Padmavathi Venna

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

On Thu, Jan 24, 2013 at 06:05:31PM +0530, R. Chandrasekar wrote:
> From: Padmavathi Venna <padma.v@samsung.com>
> 
> I2S module need to be reset after S2R. Keeping the S/W rst
> control part in resume didn't help in playing audio after resume.
> So this patch adds S/W RST control part in startup function which
> gets triggered for every new audio stream playback.

Applied, thanks.  Please use subject lines matching the subsystem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Asoc: Samsung: Add support for I2S runtime S2R
  2013-01-24 12:35 [PATCH] Asoc: Samsung: Add support for I2S runtime S2R R. Chandrasekar
  2013-01-24 12:35 ` [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function R. Chandrasekar
@ 2013-01-26  7:27 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-01-26  7:27 UTC (permalink / raw)
  To: R. Chandrasekar
  Cc: linux-arm-kernel, linux-samsung-soc, alsa-devel, sbkim73,
	ben-linux, kgene.kim, jassisinghbrar

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

On Thu, Jan 24, 2013 at 06:05:30PM +0530, R. Chandrasekar wrote:
> From: "R. Chandrasekar" <rcsekar@samsung.com>
> 
> This patch adds runtime suspend to resume support for I2S.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>

This is good but doesn't apply against topic/samsung, please check and
resend.  Note that the signoffs should be in author order - the author
should be first, then people forwarding on the patch.  Other people
should have other tags like Acked-by or Reviewed-by.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-26  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24 12:35 [PATCH] Asoc: Samsung: Add support for I2S runtime S2R R. Chandrasekar
2013-01-24 12:35 ` [PATCH] Asoc: Samsung: Add I2S S/W RST in startup function R. Chandrasekar
2013-01-26  7:25   ` Mark Brown
2013-01-26  7:27 ` [PATCH] Asoc: Samsung: Add support for I2S runtime S2R 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).