* [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
@ 2016-01-14 7:49 libin.yang
2016-01-14 9:08 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: libin.yang @ 2016-01-14 7:49 UTC (permalink / raw)
To: alsa-devel, tiwai; +Cc: libin.yang, mengdong.lin, Libin Yang
From: Libin Yang <libin.yang@linux.intel.com>
SPDIF ctl should be based on pcm. Each spdif ctl controls
one pcm state.
This patch creates spdif based on pcm and no longer
based on pin.
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
---
sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index dfb7c26..2f949fb 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
hinfo->nid = 0;
mutex_lock(&spec->pcm_lock);
+ snd_hda_spdif_ctls_unassign(codec, pcm_idx);
clear_bit(pcm_idx, &spec->pcm_in_use);
pin_idx = hinfo_to_pin_index(codec, hinfo);
if (spec->dyn_pcm_assign && pin_idx < 0) {
@@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
pinctl & ~PIN_OUT);
}
- snd_hda_spdif_ctls_unassign(codec, pcm_idx);
-
mutex_lock(&per_pin->lock);
per_pin->chmap_set = false;
memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
@@ -2560,19 +2559,29 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
err = generic_hdmi_build_jack(codec, pcm_idx);
if (err < 0)
return err;
- }
- for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
- struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
-
- err = snd_hda_create_dig_out_ctls(codec,
+ /* create the spdif for each pcm
+ * pin will be bound when monitor is connected
+ */
+ if (spec->dyn_pcm_assign)
+ err = snd_hda_create_dig_out_ctls(codec,
+ 0, spec->cvt_nids[0],
+ HDA_PCM_TYPE_HDMI);
+ else {
+ struct hdmi_spec_per_pin *per_pin =
+ get_pin(spec, pcm_idx);
+ err = snd_hda_create_dig_out_ctls(codec,
per_pin->pin_nid,
per_pin->mux_nids[0],
HDA_PCM_TYPE_HDMI);
+ }
if (err < 0)
return err;
- /* pin number is the same with pcm number so far */
- snd_hda_spdif_ctls_unassign(codec, pin_idx);
+ snd_hda_spdif_ctls_unassign(codec, pcm_idx);
+ }
+
+ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
+ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
/* add control for ELD Bytes */
err = hdmi_create_eld_ctl(codec, pin_idx,
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
2016-01-14 7:49 libin.yang
@ 2016-01-14 9:08 ` Takashi Iwai
2016-01-15 0:46 ` Yang, Libin
0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2016-01-14 9:08 UTC (permalink / raw)
To: libin.yang; +Cc: libin.yang, mengdong.lin, alsa-devel
On Thu, 14 Jan 2016 08:49:46 +0100,
libin.yang@linux.intel.com wrote:
>
> From: Libin Yang <libin.yang@linux.intel.com>
>
> SPDIF ctl should be based on pcm. Each spdif ctl controls
> one pcm state.
>
> This patch creates spdif based on pcm and no longer
> based on pin.
Which branch is this supposed to be applied to? I thought it's for
MST, then this isn't for 4.5.
If it's for MST, please postpone it until the merge window is closed.
If this isn't for 4.5, please clarify why this has to be applied.
thanks,
Takashi
>
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> ---
> sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index dfb7c26..2f949fb 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
> hinfo->nid = 0;
>
> mutex_lock(&spec->pcm_lock);
> + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> clear_bit(pcm_idx, &spec->pcm_in_use);
> pin_idx = hinfo_to_pin_index(codec, hinfo);
> if (spec->dyn_pcm_assign && pin_idx < 0) {
> @@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
> pinctl & ~PIN_OUT);
> }
>
> - snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> -
> mutex_lock(&per_pin->lock);
> per_pin->chmap_set = false;
> memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
> @@ -2560,19 +2559,29 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
> err = generic_hdmi_build_jack(codec, pcm_idx);
> if (err < 0)
> return err;
> - }
>
> - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> - struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
> -
> - err = snd_hda_create_dig_out_ctls(codec,
> + /* create the spdif for each pcm
> + * pin will be bound when monitor is connected
> + */
> + if (spec->dyn_pcm_assign)
> + err = snd_hda_create_dig_out_ctls(codec,
> + 0, spec->cvt_nids[0],
> + HDA_PCM_TYPE_HDMI);
> + else {
> + struct hdmi_spec_per_pin *per_pin =
> + get_pin(spec, pcm_idx);
> + err = snd_hda_create_dig_out_ctls(codec,
> per_pin->pin_nid,
> per_pin->mux_nids[0],
> HDA_PCM_TYPE_HDMI);
> + }
> if (err < 0)
> return err;
> - /* pin number is the same with pcm number so far */
> - snd_hda_spdif_ctls_unassign(codec, pin_idx);
> + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> + }
> +
> + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> + struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
>
> /* add control for ELD Bytes */
> err = hdmi_create_eld_ctl(codec, pin_idx,
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
2016-01-14 9:08 ` Takashi Iwai
@ 2016-01-15 0:46 ` Yang, Libin
2016-01-15 5:51 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: Yang, Libin @ 2016-01-15 0:46 UTC (permalink / raw)
To: Takashi Iwai, libin.yang@linux.intel.com
Cc: Lin, Mengdong, alsa-devel@alsa-project.org
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Thursday, January 14, 2016 5:09 PM
> To: libin.yang@linux.intel.com
> Cc: alsa-devel@alsa-project.org; Lin, Mengdong; Yang, Libin
> Subject: Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
>
> On Thu, 14 Jan 2016 08:49:46 +0100,
> libin.yang@linux.intel.com wrote:
> >
> > From: Libin Yang <libin.yang@linux.intel.com>
> >
> > SPDIF ctl should be based on pcm. Each spdif ctl controls
> > one pcm state.
> >
> > This patch creates spdif based on pcm and no longer
> > based on pin.
>
> Which branch is this supposed to be applied to? I thought it's for
> MST, then this isn't for 4.5.
>
> If it's for MST, please postpone it until the merge window is closed.
> If this isn't for 4.5, please clarify why this has to be applied.
It's for MST. I will submit it later. When should I submit the patch?
Regards,
Libin
>
>
> thanks,
>
> Takashi
>
> >
> > Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> > ---
> > sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
> > 1 file changed, 18 insertions(+), 9 deletions(-)
> >
> > diff --git a/sound/pci/hda/patch_hdmi.c
> b/sound/pci/hda/patch_hdmi.c
> > index dfb7c26..2f949fb 100644
> > --- a/sound/pci/hda/patch_hdmi.c
> > +++ b/sound/pci/hda/patch_hdmi.c
> > @@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct
> hda_pcm_stream *hinfo,
> > hinfo->nid = 0;
> >
> > mutex_lock(&spec->pcm_lock);
> > + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > clear_bit(pcm_idx, &spec->pcm_in_use);
> > pin_idx = hinfo_to_pin_index(codec, hinfo);
> > if (spec->dyn_pcm_assign && pin_idx < 0) {
> > @@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct
> hda_pcm_stream *hinfo,
> > pinctl & ~PIN_OUT);
> > }
> >
> > - snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > -
> > mutex_lock(&per_pin->lock);
> > per_pin->chmap_set = false;
> > memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
> > @@ -2560,19 +2559,29 @@ static int
> generic_hdmi_build_controls(struct hda_codec *codec)
> > err = generic_hdmi_build_jack(codec, pcm_idx);
> > if (err < 0)
> > return err;
> > - }
> >
> > - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> > - struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> pin_idx);
> > -
> > - err = snd_hda_create_dig_out_ctls(codec,
> > + /* create the spdif for each pcm
> > + * pin will be bound when monitor is connected
> > + */
> > + if (spec->dyn_pcm_assign)
> > + err = snd_hda_create_dig_out_ctls(codec,
> > + 0, spec->cvt_nids[0],
> > + HDA_PCM_TYPE_HDMI);
> > + else {
> > + struct hdmi_spec_per_pin *per_pin =
> > + get_pin(spec, pcm_idx);
> > + err = snd_hda_create_dig_out_ctls(codec,
> > per_pin->pin_nid,
> > per_pin->mux_nids[0],
> >
> HDA_PCM_TYPE_HDMI);
> > + }
> > if (err < 0)
> > return err;
> > - /* pin number is the same with pcm number so far */
> > - snd_hda_spdif_ctls_unassign(codec, pin_idx);
> > + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > + }
> > +
> > + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> > + struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> pin_idx);
> >
> > /* add control for ELD Bytes */
> > err = hdmi_create_eld_ctl(codec, pin_idx,
> > --
> > 1.9.1
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
2016-01-15 0:46 ` Yang, Libin
@ 2016-01-15 5:51 ` Takashi Iwai
0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2016-01-15 5:51 UTC (permalink / raw)
To: Yang, Libin
Cc: Lin, Mengdong, libin.yang@linux.intel.com,
alsa-devel@alsa-project.org
On Fri, 15 Jan 2016 01:46:37 +0100,
Yang, Libin wrote:
>
>
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai@suse.de]
> > Sent: Thursday, January 14, 2016 5:09 PM
> > To: libin.yang@linux.intel.com
> > Cc: alsa-devel@alsa-project.org; Lin, Mengdong; Yang, Libin
> > Subject: Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
> >
> > On Thu, 14 Jan 2016 08:49:46 +0100,
> > libin.yang@linux.intel.com wrote:
> > >
> > > From: Libin Yang <libin.yang@linux.intel.com>
> > >
> > > SPDIF ctl should be based on pcm. Each spdif ctl controls
> > > one pcm state.
> > >
> > > This patch creates spdif based on pcm and no longer
> > > based on pin.
> >
> > Which branch is this supposed to be applied to? I thought it's for
> > MST, then this isn't for 4.5.
> >
> > If it's for MST, please postpone it until the merge window is closed.
> > If this isn't for 4.5, please clarify why this has to be applied.
>
> It's for MST. I will submit it later. When should I submit the patch?
After the merge window is closed.
Takashi
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
@ 2016-01-29 5:53 libin.yang
2016-01-29 5:59 ` Yang, Libin
0 siblings, 1 reply; 7+ messages in thread
From: libin.yang @ 2016-01-29 5:53 UTC (permalink / raw)
To: alsa-devel, tiwai; +Cc: libin.yang, mengdong.lin, Libin Yang
From: Libin Yang <libin.yang@linux.intel.com>
SPDIF ctl should be based on pcm. Each spdif ctl controls
one pcm state.
This patch creates spdif based on pcm and no longer
based on pin.
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
---
sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index dfb7c26..2f949fb 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
hinfo->nid = 0;
mutex_lock(&spec->pcm_lock);
+ snd_hda_spdif_ctls_unassign(codec, pcm_idx);
clear_bit(pcm_idx, &spec->pcm_in_use);
pin_idx = hinfo_to_pin_index(codec, hinfo);
if (spec->dyn_pcm_assign && pin_idx < 0) {
@@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
pinctl & ~PIN_OUT);
}
- snd_hda_spdif_ctls_unassign(codec, pcm_idx);
-
mutex_lock(&per_pin->lock);
per_pin->chmap_set = false;
memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
@@ -2560,19 +2559,29 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
err = generic_hdmi_build_jack(codec, pcm_idx);
if (err < 0)
return err;
- }
- for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
- struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
-
- err = snd_hda_create_dig_out_ctls(codec,
+ /* create the spdif for each pcm
+ * pin will be bound when monitor is connected
+ */
+ if (spec->dyn_pcm_assign)
+ err = snd_hda_create_dig_out_ctls(codec,
+ 0, spec->cvt_nids[0],
+ HDA_PCM_TYPE_HDMI);
+ else {
+ struct hdmi_spec_per_pin *per_pin =
+ get_pin(spec, pcm_idx);
+ err = snd_hda_create_dig_out_ctls(codec,
per_pin->pin_nid,
per_pin->mux_nids[0],
HDA_PCM_TYPE_HDMI);
+ }
if (err < 0)
return err;
- /* pin number is the same with pcm number so far */
- snd_hda_spdif_ctls_unassign(codec, pin_idx);
+ snd_hda_spdif_ctls_unassign(codec, pcm_idx);
+ }
+
+ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
+ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
/* add control for ELD Bytes */
err = hdmi_create_eld_ctl(codec, pin_idx,
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
2016-01-29 5:53 [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm libin.yang
@ 2016-01-29 5:59 ` Yang, Libin
2016-01-29 6:38 ` Takashi Iwai
0 siblings, 1 reply; 7+ messages in thread
From: Yang, Libin @ 2016-01-29 5:59 UTC (permalink / raw)
To: libin.yang@linux.intel.com, alsa-devel@alsa-project.org,
tiwai@suse.de
Cc: Lin, Mengdong
Hi Takashi,
This patch is for DP MST audio, and for hda-mst branch.
Regards,
Libin
> -----Original Message-----
> From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
> Sent: Friday, January 29, 2016 1:53 PM
> To: alsa-devel@alsa-project.org; tiwai@suse.de
> Cc: Lin, Mengdong; Yang, Libin; Libin Yang
> Subject: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
>
> From: Libin Yang <libin.yang@linux.intel.com>
>
> SPDIF ctl should be based on pcm. Each spdif ctl controls
> one pcm state.
>
> This patch creates spdif based on pcm and no longer
> based on pin.
>
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> ---
> sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index dfb7c26..2f949fb 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct
> hda_pcm_stream *hinfo,
> hinfo->nid = 0;
>
> mutex_lock(&spec->pcm_lock);
> + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> clear_bit(pcm_idx, &spec->pcm_in_use);
> pin_idx = hinfo_to_pin_index(codec, hinfo);
> if (spec->dyn_pcm_assign && pin_idx < 0) {
> @@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct
> hda_pcm_stream *hinfo,
> pinctl & ~PIN_OUT);
> }
>
> - snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> -
> mutex_lock(&per_pin->lock);
> per_pin->chmap_set = false;
> memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
> @@ -2560,19 +2559,29 @@ static int
> generic_hdmi_build_controls(struct hda_codec *codec)
> err = generic_hdmi_build_jack(codec, pcm_idx);
> if (err < 0)
> return err;
> - }
>
> - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> - struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> pin_idx);
> -
> - err = snd_hda_create_dig_out_ctls(codec,
> + /* create the spdif for each pcm
> + * pin will be bound when monitor is connected
> + */
> + if (spec->dyn_pcm_assign)
> + err = snd_hda_create_dig_out_ctls(codec,
> + 0, spec->cvt_nids[0],
> + HDA_PCM_TYPE_HDMI);
> + else {
> + struct hdmi_spec_per_pin *per_pin =
> + get_pin(spec, pcm_idx);
> + err = snd_hda_create_dig_out_ctls(codec,
> per_pin->pin_nid,
> per_pin->mux_nids[0],
>
> HDA_PCM_TYPE_HDMI);
> + }
> if (err < 0)
> return err;
> - /* pin number is the same with pcm number so far */
> - snd_hda_spdif_ctls_unassign(codec, pin_idx);
> + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> + }
> +
> + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> + struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> pin_idx);
>
> /* add control for ELD Bytes */
> err = hdmi_create_eld_ctl(codec, pin_idx,
> --
> 1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
2016-01-29 5:59 ` Yang, Libin
@ 2016-01-29 6:38 ` Takashi Iwai
0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2016-01-29 6:38 UTC (permalink / raw)
To: Yang, Libin
Cc: Lin, Mengdong, libin.yang@linux.intel.com,
alsa-devel@alsa-project.org
On Fri, 29 Jan 2016 06:59:47 +0100,
Yang, Libin wrote:
>
> Hi Takashi,
>
> This patch is for DP MST audio, and for hda-mst branch.
OK, applied now. Also, I rebased topic/hda-mst branch on top of
4.5-rc1 (so that it's now building cleanly).
thanks,
Takashi
>
> Regards,
> Libin
>
>
> > -----Original Message-----
> > From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
> > Sent: Friday, January 29, 2016 1:53 PM
> > To: alsa-devel@alsa-project.org; tiwai@suse.de
> > Cc: Lin, Mengdong; Yang, Libin; Libin Yang
> > Subject: [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm
> >
> > From: Libin Yang <libin.yang@linux.intel.com>
> >
> > SPDIF ctl should be based on pcm. Each spdif ctl controls
> > one pcm state.
> >
> > This patch creates spdif based on pcm and no longer
> > based on pin.
> >
> > Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> > ---
> > sound/pci/hda/patch_hdmi.c | 27 ++++++++++++++++++---------
> > 1 file changed, 18 insertions(+), 9 deletions(-)
> >
> > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> > index dfb7c26..2f949fb 100644
> > --- a/sound/pci/hda/patch_hdmi.c
> > +++ b/sound/pci/hda/patch_hdmi.c
> > @@ -2255,6 +2255,7 @@ static int hdmi_pcm_close(struct
> > hda_pcm_stream *hinfo,
> > hinfo->nid = 0;
> >
> > mutex_lock(&spec->pcm_lock);
> > + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > clear_bit(pcm_idx, &spec->pcm_in_use);
> > pin_idx = hinfo_to_pin_index(codec, hinfo);
> > if (spec->dyn_pcm_assign && pin_idx < 0) {
> > @@ -2276,8 +2277,6 @@ static int hdmi_pcm_close(struct
> > hda_pcm_stream *hinfo,
> > pinctl & ~PIN_OUT);
> > }
> >
> > - snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > -
> > mutex_lock(&per_pin->lock);
> > per_pin->chmap_set = false;
> > memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
> > @@ -2560,19 +2559,29 @@ static int
> > generic_hdmi_build_controls(struct hda_codec *codec)
> > err = generic_hdmi_build_jack(codec, pcm_idx);
> > if (err < 0)
> > return err;
> > - }
> >
> > - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> > - struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> > pin_idx);
> > -
> > - err = snd_hda_create_dig_out_ctls(codec,
> > + /* create the spdif for each pcm
> > + * pin will be bound when monitor is connected
> > + */
> > + if (spec->dyn_pcm_assign)
> > + err = snd_hda_create_dig_out_ctls(codec,
> > + 0, spec->cvt_nids[0],
> > + HDA_PCM_TYPE_HDMI);
> > + else {
> > + struct hdmi_spec_per_pin *per_pin =
> > + get_pin(spec, pcm_idx);
> > + err = snd_hda_create_dig_out_ctls(codec,
> > per_pin->pin_nid,
> > per_pin->mux_nids[0],
> >
> > HDA_PCM_TYPE_HDMI);
> > + }
> > if (err < 0)
> > return err;
> > - /* pin number is the same with pcm number so far */
> > - snd_hda_spdif_ctls_unassign(codec, pin_idx);
> > + snd_hda_spdif_ctls_unassign(codec, pcm_idx);
> > + }
> > +
> > + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> > + struct hdmi_spec_per_pin *per_pin = get_pin(spec,
> > pin_idx);
> >
> > /* add control for ELD Bytes */
> > err = hdmi_create_eld_ctl(codec, pin_idx,
> > --
> > 1.9.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-01-29 6:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 5:53 [PATCH] ALSA: hda - hdmi create spdif ctl based on pcm libin.yang
2016-01-29 5:59 ` Yang, Libin
2016-01-29 6:38 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2016-01-14 7:49 libin.yang
2016-01-14 9:08 ` Takashi Iwai
2016-01-15 0:46 ` Yang, Libin
2016-01-15 5:51 ` Takashi Iwai
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.