Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	alsa-devel@alsa-project.org, broonie@kernel.org,
	Jeeja KP <jeeja.kp@intel.com>
Subject: Re: [PATCH v8 2/3] ALSA: hdac_ext: add hdac extended controller
Date: Thu, 11 Jun 2015 09:13:46 +0530	[thread overview]
Message-ID: <20150611034346.GX28601@localhost> (raw)
In-Reply-To: <s5hr3pj8kzf.wl-tiwai@suse.de>

On Wed, Jun 10, 2015 at 08:41:08PM +0200, Takashi Iwai wrote:
> At Wed, 10 Jun 2015 18:36:01 +0530,
> Vinod Koul wrote:
> > 
> > +/**
> > + * snd_hdac_ext_bus_get_link_index - get link based on codec name
> > + * @ebus: HD-audio extended core bus
> > + * @codec_name: codec name
> > + */
> > +struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_ext_bus *ebus,
> > +						 const char *codec_name)
> > +{
> > +	int i;
> > +	struct hdac_ext_link *hlink = NULL;
> > +	char name[32];
> > +
> > +	list_for_each_entry(hlink, &ebus->hlink_list, list) {
> > +		for (i = 0; i < HDA_MAX_CODECS; i++) {
> > +			snprintf(name, sizeof(name), "codec#%03x", hlink->codec[i]);
> > +			if (!strncmp(name, codec_name, strlen(codec_name)))
> > +				return hlink;
> 
> Is this name supposed to be identical with the string the patch 1
> sets?  If so, this looks incompatible.
Yes my miss :(

This also means that I would be required to save the idx number, so I am
thinking of returning the idx value in snd_hdac_ext_bus_device_init() and
then pass on snd_hdac_ext_bus_map_codec_to_link() API which can save this in
the array and then use idx here as well and use I like below so will add
this

> 
> Also, it'd be easier to parse the string only once like:
> 
> 	int bus_idx, addr;
> 
> 	if (sscanf(codec_name, "ehdaudio%dD%d", &bus_idx, &addr) != 2)
> 		return NULL;
> 	if (ebus->index != bus_idx)
> 		return NULL;
> 	list_for_each_entry(hlink, &ebus->hlink_list, list)
> 		if (hlink->lsdiid && (0x1 << addr))
> 			return hlink;
> 
> 	return NULL;

Thanks

-- 
~Vinod

  reply	other threads:[~2015-06-11  3:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 13:05 [PATCH v8 0/3] HDA: add extended HDA Vinod Koul
2015-06-10 13:06 ` [PATCH v8 1/3] ALSA: hdac_ext: add extended HDA bus Vinod Koul
2015-06-10 13:06 ` [PATCH v8 2/3] ALSA: hdac_ext: add hdac extended controller Vinod Koul
2015-06-10 18:41   ` Takashi Iwai
2015-06-11  3:43     ` Vinod Koul [this message]
2015-06-11  4:18       ` Vinod Koul
2015-06-10 13:06 ` [PATCH v8 3/3] ALSA: hdac_ext: add extended stream capabilities Vinod Koul

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=20150611034346.GX28601@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.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