All of lore.kernel.org
 help / color / mirror / Atom feed
From: libin.yang@intel.com
To: alsa-devel@alsa-project.org
Cc: Libin Yang <libin.yang@intel.com>,
	tiwai@suse.de, pierre-louis.bossart@linux.intel.com,
	hui.wang@canonical.com, broonie@kernel.org
Subject: [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params
Date: Tue,  7 May 2019 14:33:11 +0800	[thread overview]
Message-ID: <1557210791-20332-1-git-send-email-libin.yang@intel.com> (raw)

From: Libin Yang <libin.yang@intel.com>

Some userspace apps, like pulseaudio, may call open, hw_params,
prepare to judge whether the pcm is ready or not. Current hdac_hdmi
will return -ENODEV if monitor is not connected, which will cause
the apps believe the pcm is not ready. Actually PCM for hdmi is ready,
even the monitor is not connected.

This patch removes the check of monitor presence in hw_params, just like
what the legacy HD-Audio driver does.

Signed-off-by: Libin Yang <libin.yang@intel.com>
---
 sound/soc/codecs/hdac_hdmi.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 4de1fbf..660e058 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -455,24 +455,11 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *hparams, struct snd_soc_dai *dai)
 {
 	struct hdac_hdmi_priv *hdmi = snd_soc_dai_get_drvdata(dai);
-	struct hdac_device *hdev = hdmi->hdev;
 	struct hdac_hdmi_dai_port_map *dai_map;
-	struct hdac_hdmi_port *port;
 	struct hdac_hdmi_pcm *pcm;
 	int format;
 
 	dai_map = &hdmi->dai_map[dai->id];
-	port = dai_map->port;
-
-	if (!port)
-		return -ENODEV;
-
-	if ((!port->eld.monitor_present) || (!port->eld.eld_valid)) {
-		dev_err(&hdev->dev,
-			"device is not configured for this pin:port%d:%d\n",
-					port->pin->nid, port->id);
-		return -ENODEV;
-	}
 
 	format = snd_hdac_calc_stream_format(params_rate(hparams),
 			params_channels(hparams), params_format(hparams),
-- 
2.7.4

             reply	other threads:[~2019-05-07  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  6:33 libin.yang [this message]
2019-05-07  8:42 ` [PATCH] ASoC: codec: hdac_hdmi: no checking monitor in hw_params Takashi Iwai
2019-05-07 13:39   ` Pierre-Louis Bossart
2019-05-08  9:01 ` Applied "ASoC: codec: hdac_hdmi: no checking monitor in hw_params" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557210791-20332-1-git-send-email-libin.yang@intel.com \
    --to=libin.yang@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hui.wang@canonical.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.