aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorAxel Castaneda Gonzalez <x0055901@ti.com>2012-01-22 18:02:48 -0600
committerDan Murphy <dmurphy@ti.com>2012-02-20 07:14:20 -0600
commit6fc9902a318e3ee95b01c98b8476d8b1b07a76cc (patch)
treee532fbf3cee846b2068f7d94dc1ceb8da4975abe /sound/soc
parent96b5f74060e61d484d5fe4bc40765d4a4f9280e7 (diff)
downloadkernel_samsung_espresso10-6fc9902a318e3ee95b01c98b8476d8b1b07a76cc.zip
kernel_samsung_espresso10-6fc9902a318e3ee95b01c98b8476d8b1b07a76cc.tar.gz
kernel_samsung_espresso10-6fc9902a318e3ee95b01c98b8476d8b1b07a76cc.tar.bz2
ASoC: OMAP: HDMI: Defer audio transfer start
Defer audio transfer after HDMI AUDIO wrapper is enabled. If audio transmit was started along with audio wrapper enabling, spurious data (zeros) was sent at the beginning of the transfer as part of the of audio sample packets, due an AUDIO FIFO UNDERFLOW, which was shifting audio channels. Change-Id: I48d8c02c0467dd3158ac748eb0720173d3b209ca Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/omap-hdmi-codec.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/sound/soc/codecs/omap-hdmi-codec.c b/sound/soc/codecs/omap-hdmi-codec.c
index 50f05b4..181676c 100644
--- a/sound/soc/codecs/omap-hdmi-codec.c
+++ b/sound/soc/codecs/omap-hdmi-codec.c
@@ -67,6 +67,8 @@ struct hdmi_codec_data {
struct omap_dss_device *dssdev;
struct notifier_block notifier;
struct hdmi_params params;
+ struct delayed_work delayed_work;
+ struct workqueue_struct *workqueue;
int active;
} hdmi_data;
@@ -259,19 +261,26 @@ int hdmi_audio_notifier_callback(struct notifier_block *nb,
if (state == OMAP_DSS_DISPLAY_ACTIVE) {
/* this happens just after hdmi_power_on */
- if (hdmi_data.active)
- hdmi_ti_4xxx_audio_enable(&hdmi_data.ip_data, 0);
hdmi_audio_set_configuration(&hdmi_data);
if (hdmi_data.active) {
omap_hwmod_set_slave_idlemode(hdmi_data.oh,
HWMOD_IDLEMODE_NO);
- hdmi_ti_4xxx_audio_enable(&hdmi_data.ip_data, 1);
-
+ hdmi_ti_4xxx_wp_audio_enable(&hdmi_data.ip_data, 1);
+ queue_delayed_work(hdmi_data.workqueue,
+ &hdmi_data.delayed_work,
+ msecs_to_jiffies(1));
}
+ } else {
+ cancel_delayed_work(&hdmi_data.delayed_work);
}
return 0;
}
+static void hdmi_audio_work(struct work_struct *work)
+{
+ hdmi_ti_4xxx_audio_transfer_en(&hdmi_data.ip_data, 1);
+}
+
int hdmi_audio_match(struct omap_dss_device *dssdev, void *arg)
{
return sysfs_streq(dssdev->name , "hdmi");
@@ -309,14 +318,19 @@ static int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
*/
omap_hwmod_set_slave_idlemode(priv->oh,
HWMOD_IDLEMODE_NO);
- hdmi_ti_4xxx_audio_enable(&priv->ip_data, 1);
+ hdmi_ti_4xxx_wp_audio_enable(&priv->ip_data, 1);
+ queue_delayed_work(priv->workqueue, &priv->delayed_work,
+ msecs_to_jiffies(1));
+
priv->active = 1;
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ cancel_delayed_work(&hdmi_data.delayed_work);
priv->active = 0;
- hdmi_ti_4xxx_audio_enable(&priv->ip_data, 0);
+ hdmi_ti_4xxx_audio_transfer_en(&priv->ip_data, 0);
+ hdmi_ti_4xxx_wp_audio_enable(&priv->ip_data, 0);
/*
* switch back to smart-idle & wakeup capable
* after audio activity stops
@@ -391,6 +405,10 @@ static int hdmi_probe(struct snd_soc_codec *codec)
blocking_notifier_chain_register(&hdmi_data.dssdev->state_notifiers,
&hdmi_data.notifier);
+ hdmi_data.workqueue = create_singlethread_workqueue("hdmi-codec");
+
+ INIT_DELAYED_WORK(&hdmi_data.delayed_work, hdmi_audio_work);
+
return 0;
dssdev_err: