From edc96c8584dd55ccb360241e20c9051828199970 Mon Sep 17 00:00:00 2001 From: Ricardo Neri Date: Fri, 18 May 2012 01:42:39 -0500 Subject: [PATCH] --- yaml --- r: 308007 b: refs/heads/master c: a0534e3bb68537b749423efe60db7b38872b00a1 h: refs/heads/master i: 308005: deb21c7f032aec58b87fceec23e326c2f8bcab6e 308003: c0519420bfe2f3723c324652322cba45a2659bf4 307999: 2bb68a610edd0224947d899ed6039256d212fb49 v: v3 --- [refs] | 2 +- trunk/sound/soc/omap/omap-hdmi.c | 9 ++++++- trunk/sound/soc/omap/omap4-hdmi-card.c | 34 -------------------------- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/[refs] b/[refs] index 938458fbb2a7..98c2b61f2d07 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7e6aa220798efd5cd95737b7493b904dddbf413d +refs/heads/master: a0534e3bb68537b749423efe60db7b38872b00a1 diff --git a/trunk/sound/soc/omap/omap-hdmi.c b/trunk/sound/soc/omap/omap-hdmi.c index fc4815a6efb1..ec7c7e62b012 100644 --- a/trunk/sound/soc/omap/omap-hdmi.c +++ b/trunk/sound/soc/omap/omap-hdmi.c @@ -51,6 +51,7 @@ struct hdmi_priv { static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai); int err; /* * Make sure that the period bytes are multiple of the DMA packet size. @@ -58,9 +59,15 @@ static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream, */ err = snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128); - if (err < 0) + if (err < 0) { + dev_err(dai->dev, "could not apply constraint\n"); return err; + } + if (!priv->dssdev->driver->audio_supported(priv->dssdev)) { + dev_err(dai->dev, "audio not supported\n"); + return -ENODEV; + } return 0; } diff --git a/trunk/sound/soc/omap/omap4-hdmi-card.c b/trunk/sound/soc/omap/omap4-hdmi-card.c index 99e96c6221a8..6c3255fed2ef 100644 --- a/trunk/sound/soc/omap/omap4-hdmi-card.c +++ b/trunk/sound/soc/omap/omap4-hdmi-card.c @@ -29,39 +29,6 @@ #define DRV_NAME "omap-hdmi-audio" -static int omap4_hdmi_dai_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - int i; - struct omap_overlay_manager *mgr = NULL; - struct device *dev = substream->pcm->card->dev; - - /* Find DSS HDMI device */ - for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) { - mgr = omap_dss_get_overlay_manager(i); - if (mgr && mgr->device - && mgr->device->type == OMAP_DISPLAY_TYPE_HDMI) - break; - } - - if (i == omap_dss_get_num_overlay_managers()) { - dev_err(dev, "HDMI display device not found!\n"); - return -ENODEV; - } - - /* Make sure HDMI is power-on to avoid L3 interconnect errors */ - if (mgr->device->state != OMAP_DSS_DISPLAY_ACTIVE) { - dev_err(dev, "HDMI display is not active!\n"); - return -EIO; - } - - return 0; -} - -static struct snd_soc_ops omap4_hdmi_dai_ops = { - .hw_params = omap4_hdmi_dai_hw_params, -}; - static struct snd_soc_dai_link omap4_hdmi_dai = { .name = "HDMI", .stream_name = "HDMI", @@ -69,7 +36,6 @@ static struct snd_soc_dai_link omap4_hdmi_dai = { .platform_name = "omap-pcm-audio", .codec_name = "hdmi-audio-codec", .codec_dai_name = "omap-hdmi-hifi", - .ops = &omap4_hdmi_dai_ops, }; static struct snd_soc_card snd_soc_omap4_hdmi = {