From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v6 1/3] ALSA: hdac_ext: add extended HDA bus Date: Mon, 08 Jun 2015 11:03:12 +0200 Message-ID: References: <1433411602-5444-1-git-send-email-vinod.koul@intel.com> <1433411602-5444-2-git-send-email-vinod.koul@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 (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 135C526057D for ; Mon, 8 Jun 2015 11:03:13 +0200 (CEST) In-Reply-To: <1433411602-5444-2-git-send-email-vinod.koul@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: Vinod Koul Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com, alsa-devel@alsa-project.org, broonie@kernel.org, Jeeja KP List-Id: alsa-devel@alsa-project.org One thing forgot... At Thu, 4 Jun 2015 15:23:20 +0530, Vinod Koul wrote: > > +/** > + * snd_hdac_ext_device_init - initialize the HDA extended codec base device > + * @sbus: hdac extended bus to attach to > + * @addr: codec address > + * > + * Returns zero for success or a negative error code. > + */ > +int snd_hdac_ext_bus_device_init(struct hdac_ext_bus *sbus, int addr) > +{ > + struct hdac_device *hdev = NULL; > + struct hdac_bus *bus = hdac_bus(sbus); > + char name[15]; > + int ret; > + > + hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); > + if (!hdev) > + return -ENOMEM; > + > + snprintf(name, sizeof(name), "hda-codec#%03x", addr); > + > + ret = snd_hdac_device_init(hdev, bus, name, addr); The device name must be unique to the whole system. Using only the codec address as an id would conflict if there are multiple cards. The legacy HDA device consists of "hdaudioC%dD%d" indicating both the card number and the codec address, for example. Takashi