From: jeeja.kp@intel.com
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, patches.audio@intel.com, broonie@kernel.org,
liam.r.girdwood@intel.com, Jeeja KP <jeeja.kp@intel.com>
Subject: [RFC 08/16] ASoC: hdac_hdmi: Add support to handle MST capable pin
Date: Tue, 20 Sep 2016 19:16:12 +0530 [thread overview]
Message-ID: <1474379180-7132-9-git-send-email-jeeja.kp@intel.com> (raw)
In-Reply-To: <1474379180-7132-1-git-send-email-jeeja.kp@intel.com>
From: Jeeja KP <jeeja.kp@intel.com>
To handle Jack event and Configure the Pin widget for MST capable pin,
this patch adds:
1. Flag to identify the pin is MST capable.
2. In notify callback(), based on the pipe and port information marks
if the port is mst_capable. In case of Non MST, port is defaulted to
zero.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
---
sound/soc/codecs/hdac_hdmi.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 88d6dae..c9f4d4a 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -81,6 +81,7 @@ struct hdac_hdmi_eld {
struct hdac_hdmi_pin {
struct list_head head;
hda_nid_t nid;
+ bool is_mst_capable;
struct hdac_hdmi_port *ports;
int num_ports;
struct hdac_ext_device *edev;
@@ -1057,6 +1058,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin,
struct hdac_hdmi_priv *hdmi = edev->private_data;
struct hdac_hdmi_pcm *pcm;
int size = 0;
+ int port_id;
if (!hdmi)
return;
@@ -1064,7 +1066,9 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin,
mutex_lock(&hdmi->pin_mutex);
port->eld.monitor_present = false;
- size = snd_hdac_acomp_get_eld(&edev->hdac, pin->nid, -1,
+ port_id = (pin->is_mst_capable)? port->id: -1;
+
+ size = snd_hdac_acomp_get_eld(&edev->hdac, pin->nid, port_id,
&port->eld.monitor_present, port->eld.eld_buffer,
ELD_MAX_SIZE);
@@ -1154,6 +1158,7 @@ static int hdac_hdmi_add_pin(struct hdac_ext_device *edev, hda_nid_t nid)
return -ENOMEM;
pin->nid = nid;
+ pin->is_mst_capable = false;
pin->edev = edev;
ret = hdac_hdmi_add_ports(hdmi, pin);
if (ret < 0)
@@ -1352,6 +1357,7 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int dport, int pipe)
struct hdac_hdmi_pin *pin = NULL;
struct hdac_hdmi_port *port = NULL;
struct snd_soc_codec *codec = edev->scodec;
+ int i;
/* Don't know how this mapping is derived */
hda_nid_t pin_nid = dport + 0x04;
@@ -1377,13 +1383,23 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int dport, int pipe)
continue;
if (pipe == -1) {
+ pin->is_mst_capable = false;
/* if not MST, default is port[0] */
port = &pin->ports[0];
- break;
+ goto out;
+ } else {
+ for (i=0; i < pin->num_ports; i++) {
+ pin->is_mst_capable = true;
+ if (pin->ports[i].id == pipe) {
+ port = &pin->ports[i];
+ goto out;
+ }
+ }
}
}
- if (port)
+out:
+ if (pin && port)
hdac_hdmi_present_sense(pin, port);
}
--
2.5.0
next prev parent reply other threads:[~2016-09-20 13:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 13:46 [RFC 00/16] ASoC: hdac_hdmi: Add Support to Enable MST Audio jeeja.kp
2016-09-20 13:46 ` [RFC 01/16] ASoC: hdac_hdmi: use audio component framework to read ELD jeeja.kp
2016-09-25 5:58 ` Applied "ASoC: hdac_hdmi: use audio component framework to read ELD" to the asoc tree Mark Brown
2016-09-20 13:46 ` [RFC 02/16] ASoC: hdac_hdmi: Begin to add support for DP Multi-stream Audio jeeja.kp
2016-09-20 13:46 ` [RFC 03/16] ASoC: Intel: Skylake: Add route change to rt286 machine jeeja.kp
2017-02-04 12:12 ` Applied "ASoC: Intel: Skylake: Add route change to rt286 machine" to the asoc tree Mark Brown
2016-09-20 13:46 ` [RFC 04/16] ASoC: Intel: Skylake: Add route change to nau88l25_max98357a machine jeeja.kp
2017-02-08 18:34 ` Applied "ASoC: Intel: Skylake: Add route change to nau88l25_max98357a machine" to the asoc tree Mark Brown
2016-09-20 13:46 ` [RFC 05/16] ASoC: Intel: Skylake: Add route change to nau88l25_ssm4567 machine jeeja.kp
2017-02-08 18:34 ` Applied "ASoC: Intel: Skylake: Add route change to nau88l25_ssm4567 machine" to the asoc tree Mark Brown
2016-09-20 13:46 ` [RFC 06/16] ASoC: Intel: Skylake: Add route change to rt298 machine jeeja.kp
2017-02-08 18:34 ` Applied "ASoC: Intel: bxt: Add route change to rt298 machine" to the asoc tree Mark Brown
2016-09-20 13:46 ` [RFC 07/16] ASoC: Intel: Skylake: Add route change to da7219_max98357a machine jeeja.kp
2017-02-04 12:12 ` Applied "ASoC: Intel: bxt: Add route change to da7219_max98357a machine" to the asoc tree Mark Brown
2016-09-20 13:46 ` jeeja.kp [this message]
2016-09-20 13:46 ` [RFC 09/16] ASoC: hdac_hdmi: Add MST verb support jeeja.kp
2016-09-20 13:46 ` [RFC 10/16] ASoc: hdac_hdmi: Configure pin verbs for MST jeeja.kp
2016-09-20 13:46 ` [RFC 11/16] ASoC: hdac_hdmi: Add support to handle Multiple Port to same PCM jeeja.kp
2016-09-20 13:46 ` [RFC 12/16] ASoC: Intel: Skylake: To support MST, add HDMI routes rt286 machine jeeja.kp
2016-09-20 13:46 ` [RFC 13/16] ASoC: Intel: Skylake: To support MST, add HDMI routes nau_max machine jeeja.kp
2016-09-20 13:46 ` [RFC 14/16] ASoC: Intel: Skylake: To support MST, add HDMI routes nau_ssm machine jeeja.kp
2016-09-20 13:46 ` [RFC 15/16] ASoC: Intel: Skylake: To support MST, add HDMI routes rt298 machine jeeja.kp
2016-09-20 13:46 ` [RFC 16/16] ASoC: Intel: Skylake: To support MST, add HDMI routes da7219_max machine jeeja.kp
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=1474379180-7132-9-git-send-email-jeeja.kp@intel.com \
--to=jeeja.kp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@intel.com \
--cc=patches.audio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).