aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r--drivers/video/omap2/dss/hdmi.c59
1 files changed, 54 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index c56378c555b0..b4c270edb915 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -333,7 +333,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
333 if (r) 333 if (r)
334 return r; 334 return r;
335 335
336 dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, 0); 336 dss_mgr_disable(dssdev->manager);
337 337
338 p = &dssdev->panel.timings; 338 p = &dssdev->panel.timings;
339 339
@@ -387,9 +387,16 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
387 387
388 hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1); 388 hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1);
389 389
390 dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, 1); 390 r = dss_mgr_enable(dssdev->manager);
391 if (r)
392 goto err_mgr_enable;
391 393
392 return 0; 394 return 0;
395
396err_mgr_enable:
397 hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
398 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
399 hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
393err: 400err:
394 hdmi_runtime_put(); 401 hdmi_runtime_put();
395 return -EIO; 402 return -EIO;
@@ -397,7 +404,7 @@ err:
397 404
398static void hdmi_power_off(struct omap_dss_device *dssdev) 405static void hdmi_power_off(struct omap_dss_device *dssdev)
399{ 406{
400 dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, 0); 407 dss_mgr_disable(dssdev->manager);
401 408
402 hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0); 409 hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
403 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data); 410 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
@@ -554,11 +561,44 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
554#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ 561#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
555 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) 562 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
556 563
557static int hdmi_audio_hw_params(struct hdmi_ip_data *ip_data, 564static int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
558 struct snd_pcm_substream *substream, 565 struct snd_soc_dai *dai)
566{
567 struct snd_soc_pcm_runtime *rtd = substream->private_data;
568 struct snd_soc_codec *codec = rtd->codec;
569 struct platform_device *pdev = to_platform_device(codec->dev);
570 struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec);
571 int err = 0;
572
573 if (!(ip_data->ops) && !(ip_data->ops->audio_enable)) {
574 dev_err(&pdev->dev, "Cannot enable/disable audio\n");
575 return -ENODEV;
576 }
577
578 switch (cmd) {
579 case SNDRV_PCM_TRIGGER_START:
580 case SNDRV_PCM_TRIGGER_RESUME:
581 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
582 ip_data->ops->audio_enable(ip_data, true);
583 break;
584 case SNDRV_PCM_TRIGGER_STOP:
585 case SNDRV_PCM_TRIGGER_SUSPEND:
586 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
587 ip_data->ops->audio_enable(ip_data, false);
588 break;
589 default:
590 err = -EINVAL;
591 }
592 return err;
593}
594
595static int hdmi_audio_hw_params(struct snd_pcm_substream *substream,
559 struct snd_pcm_hw_params *params, 596 struct snd_pcm_hw_params *params,
560 struct snd_soc_dai *dai) 597 struct snd_soc_dai *dai)
561{ 598{
599 struct snd_soc_pcm_runtime *rtd = substream->private_data;
600 struct snd_soc_codec *codec = rtd->codec;
601 struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec);
562 struct hdmi_audio_format audio_format; 602 struct hdmi_audio_format audio_format;
563 struct hdmi_audio_dma audio_dma; 603 struct hdmi_audio_dma audio_dma;
564 struct hdmi_core_audio_config core_cfg; 604 struct hdmi_core_audio_config core_cfg;
@@ -698,7 +738,16 @@ static int hdmi_audio_startup(struct snd_pcm_substream *substream,
698 return 0; 738 return 0;
699} 739}
700 740
741static int hdmi_audio_codec_probe(struct snd_soc_codec *codec)
742{
743 struct hdmi_ip_data *priv = &hdmi.ip_data;
744
745 snd_soc_codec_set_drvdata(codec, priv);
746 return 0;
747}
748
701static struct snd_soc_codec_driver hdmi_audio_codec_drv = { 749static struct snd_soc_codec_driver hdmi_audio_codec_drv = {
750 .probe = hdmi_audio_codec_probe,
702}; 751};
703 752
704static struct snd_soc_dai_ops hdmi_audio_codec_ops = { 753static struct snd_soc_dai_ops hdmi_audio_codec_ops = {