From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v3 14/15] ASoC: hdac_hdmi: Add jack reporting for user space Date: Mon, 07 Dec 2015 17:18:06 +0100 Message-ID: References: <1449523078-4311-1-git-send-email-subhransu.s.prusty@intel.com> <1449523469-4395-1-git-send-email-subhransu.s.prusty@intel.com> <1449523469-4395-14-git-send-email-subhransu.s.prusty@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id BB75126070C for ; Mon, 7 Dec 2015 17:18:07 +0100 (CET) In-Reply-To: <1449523469-4395-14-git-send-email-subhransu.s.prusty@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Subhransu S. Prusty" Cc: patches.audio@intel.com, Vinod Koul , alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org On Mon, 07 Dec 2015 22:24:28 +0100, Subhransu S. Prusty wrote: > > User space also need be notified of HDMI hotplug notification so > that it can select the appropriate device to route audio. > > Signed-off-by: Subhransu S. Prusty > Signed-off-by: Vinod Koul > --- > sound/soc/codecs/hdac_hdmi.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c > index 008a29f..cce2af0 100644 > --- a/sound/soc/codecs/hdac_hdmi.c > +++ b/sound/soc/codecs/hdac_hdmi.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -73,6 +74,7 @@ struct hdac_hdmi_pin { > struct hdac_ext_device *edev; > int repoll_count; > struct delayed_work work; > + struct snd_jack *jack; > }; > > struct hdac_hdmi_dai_pin_map { > @@ -905,6 +907,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll) > pin->eld.eld_valid = !!(val & AC_PINSENSE_ELDV); > > if (!pin->eld.monitor_present || !pin->eld.eld_valid) { > + snd_jack_report(pin->jack, 0); > dev_info(&edev->hdac.dev, "%s: disconnect or eld_invalid\n", > __func__); > goto put_hdac_device; > @@ -915,6 +918,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll) > if (hdac_hdmi_get_eld(&edev->hdac, pin->nid, > pin->eld.eld_buffer, > &pin->eld.eld_size) == 0) { > + snd_jack_report(pin->jack, SND_JACK_AVOUT); > print_hex_dump_bytes("Eld: ", DUMP_PREFIX_OFFSET, > pin->eld.eld_buffer, pin->eld.eld_size); > } else { > @@ -1173,6 +1177,7 @@ static int hdmi_codec_probe(struct snd_soc_codec *codec) > struct snd_soc_dapm_context *dapm = > snd_soc_component_get_dapm(&codec->component); > struct hdac_hdmi_pin *pin; > + char jack_name[NAME_SIZE]; > int ret; > > edev->scodec = codec; > @@ -1189,8 +1194,12 @@ static int hdmi_codec_probe(struct snd_soc_codec *codec) > return ret; > } > > - list_for_each_entry(pin, &hdmi->pin_list, head) > + list_for_each_entry(pin, &hdmi->pin_list, head) { > + sprintf(jack_name, "HDMI/DP, Pin=%d Jack", pin->nid); Such a name makes sense only to be compatible for PA, and then this string isn't compatible. Note that it's not about pin but for PCM stream. You may wonder why it matters -- see the whole discussion on MST support. Takashi