public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: OMAP: HDMI: Prevent DSS module from going idle when playing audio
@ 2011-12-16  7:03 Ricardo Neri
  2011-12-16  8:14 ` Paul Walmsley
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Neri @ 2011-12-16  7:03 UTC (permalink / raw)
  To: b-cousson, tomi.valkeinen
  Cc: linux-omap, mythripk, s-guiriec, lrg, peter.ujfalusi,
	Ricardo Neri

When playing audio through HDMI, the module should be put in
no-idle mode. This is to prevent the DSS_L3_ICLK to be shut down.
Once audio playback is stopped, the module is set back to smart-idle
wakeup-capable.

Also, a omap_hwmod structure is added to hdmi_ip_data to have access
to idle-mode configuration.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
---
 drivers/video/omap2/dss/hdmi.c    |   13 +++++++++++++
 drivers/video/omap2/dss/ti_hdmi.h |    4 ++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 5c93041..e177338 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -35,6 +35,7 @@
 #include <video/omapdss.h>
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
 	defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
+#include <plat/omap_hwmod.h>
 #include <sound/soc.h>
 #include <sound/pcm_params.h>
 #include "ti_hdmi_4xxx_ip.h"
@@ -572,12 +573,16 @@ int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+		omap_hwmod_set_slave_idlemode(ip_data->oh,
+			HWMOD_IDLEMODE_NO);
 		ip_data->ops->audio_enable(ip_data, true);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 		ip_data->ops->audio_enable(ip_data, false);
+		omap_hwmod_set_slave_idlemode(ip_data->oh,
+			HWMOD_IDLEMODE_SMART_WKUP);
 		break;
 	default:
 		err = -EINVAL;
@@ -733,8 +738,16 @@ static int hdmi_audio_startup(struct snd_pcm_substream *substream,
 
 static int hdmi_audio_codec_probe(struct snd_soc_codec *codec)
 {
+	struct platform_device *pdev = to_platform_device(codec->dev);
 	struct hdmi_ip_data *priv = &hdmi.ip_data;
 
+	priv->oh = omap_hwmod_lookup("dss_hdmi");
+
+	if (!priv->oh) {
+		dev_err(&pdev->dev, "Cannot find omap_hwmod for hdmi\n");
+		return -ENODEV;
+	}
+
 	snd_soc_codec_set_drvdata(codec, priv);
 	return 0;
 }
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 7503f7f..5ef3cb1 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -126,6 +126,10 @@ struct hdmi_ip_data {
 	const struct ti_hdmi_ip_ops *ops;
 	struct hdmi_config cfg;
 	struct hdmi_pll_info pll_data;
+#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
+	defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
+	struct omap_hwmod *oh;
+#endif
 };
 int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
-- 
1.7.0.4


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

end of thread, other threads:[~2011-12-16 20:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16  7:03 [PATCH] ASoC: OMAP: HDMI: Prevent DSS module from going idle when playing audio Ricardo Neri
2011-12-16  8:14 ` Paul Walmsley
2011-12-16  8:18   ` Tomi Valkeinen
2011-12-16  8:27     ` Paul Walmsley
2011-12-16  8:47       ` Tomi Valkeinen
2011-12-16  9:09         ` Paul Walmsley
2011-12-16  9:11         ` Cousson, Benoit
2011-12-16  9:13         ` Paul Walmsley
2011-12-16 17:19           ` Tony Lindgren
2011-12-16 20:52             ` Paul Walmsley
2011-12-16 20:59               ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox