From: Takashi Iwai <tiwai@suse.de>
To: libin.yang@linux.intel.com
Cc: libin.yang@intel.com, mengdong.lin@intel.com,
alsa-devel@alsa-project.org
Subject: Re: [PATCH 2/4] ALSA: hda - add hdmi_pcm to manage hdmi pcm related features
Date: Thu, 07 Jan 2016 14:59:10 +0100 [thread overview]
Message-ID: <s5hlh81fq35.wl-tiwai@suse.de> (raw)
In-Reply-To: <1451524942-17288-3-git-send-email-libin.yang@linux.intel.com>
On Thu, 31 Dec 2015 02:22:20 +0100,
libin.yang@linux.intel.com wrote:
>
> From: Libin Yang <libin.yang@linux.intel.com>
>
> Use struct hdmi_pcm wrapper for hdmi pcm management.
> All PCM related features, like jack, will be put in this structure.
>
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> ---
> sound/pci/hda/patch_hdmi.c | 44 ++++++++++++++++++++++++--------------------
> 1 file changed, 24 insertions(+), 20 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 6d6dba4..5549ddf 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -86,7 +86,7 @@ struct hdmi_spec_per_pin {
> struct delayed_work work;
> struct snd_kcontrol *eld_ctl;
> struct snd_jack *acomp_jack; /* jack via audio component */
> - struct hda_pcm *pcm; /* pointer to spec->pcm_rec[n] dynamically*/
> + struct hdmi_pcm *pcm; /* pointer to spec->pcm_rec[n] dynamically*/
> int pcm_idx; /* which pcm is attached. -1 means no pcm is attached */
> int repoll_count;
> bool setup; /* the stream has been set up by prepare callback */
> @@ -132,6 +132,11 @@ struct hdmi_ops {
> int (*chmap_validate)(int ca, int channels, unsigned char *chmap);
> };
>
> +struct hdmi_pcm {
> + struct hda_pcm *pcm;
> + struct snd_jack *jack;
> +};
> +
> struct hdmi_spec {
> int num_cvts;
> struct snd_array cvts; /* struct hdmi_spec_per_cvt */
> @@ -139,7 +144,7 @@ struct hdmi_spec {
>
> int num_pins;
> struct snd_array pins; /* struct hdmi_spec_per_pin */
> - struct hda_pcm *pcm_rec[16];
> + struct hdmi_pcm pcm_rec[16];
> struct mutex pcm_lock;
> /* pcm_bitmap means which pcms have been assigned to pins*/
> unsigned long pcm_bitmap;
> @@ -403,7 +408,7 @@ static int hinfo_to_pcm_index(struct hda_codec *codec,
> int pcm_idx;
>
> for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++)
> - if (get_pcm_rec(spec, pcm_idx)->stream == hinfo)
> + if (get_pcm_rec(spec, pcm_idx).pcm->stream == hinfo)
I would change rather get_pcm_rec() itself to point to hda_pcm.
For referencing to hdmi_pcm, we can introduce another macro, e.g.
get_hdmi_pcm(spec, idx). For example:
/* obtain hdmi_pcm object assigned to idx */
#define get_hdmi_pcm(spec, idx) (&(spec)->pcm_rec[idx])
/* obtain hda_pcm object assigned to idx */
#define get_pcm_rec(spec, idx) get_hdmi_pcm(spec, idx)->pcm
Takashi
next prev parent reply other threads:[~2016-01-07 13:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-31 1:22 [PATCH 0/4] ALSA: hda - hdmi jack support for dynamic pcm assignment libin.yang
2015-12-31 1:22 ` [PATCH 1/4] ALSA: Add documentation about HD-audio DP MST libin.yang
2015-12-31 1:22 ` [PATCH 2/4] ALSA: hda - add hdmi_pcm to manage hdmi pcm related features libin.yang
2016-01-07 13:59 ` Takashi Iwai [this message]
2016-01-08 2:48 ` Yang, Libin
2015-12-31 1:22 ` [PATCH 3/4] ALSA: hda - hdmi jack created based on pcm libin.yang
2016-01-07 14:13 ` Takashi Iwai
2016-01-08 3:15 ` Yang, Libin
2016-01-08 7:43 ` Takashi Iwai
2016-01-08 7:52 ` Yang, Libin
2016-01-08 7:54 ` Takashi Iwai
2016-01-08 7:57 ` Yang, Libin
2015-12-31 1:22 ` [PATCH 4/4] ALSA: hda - hdmi monitor hotplug support for dynamic pcm assignment libin.yang
2016-01-07 14:18 ` Takashi Iwai
2016-01-08 5:25 ` Yang, Libin
2016-01-08 7:45 ` Takashi Iwai
2016-01-08 7:53 ` Yang, Libin
2016-01-06 9:18 ` [PATCH 0/4] ALSA: hda - hdmi jack " Takashi Iwai
2016-01-07 1:41 ` Yang, Libin
2016-01-07 10:31 ` Takashi Iwai
2016-01-08 2:47 ` Yang, Libin
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=s5hlh81fq35.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=libin.yang@intel.com \
--cc=libin.yang@linux.intel.com \
--cc=mengdong.lin@intel.com \
/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