From: Takashi Iwai Subject: Re: [PATCH v4 0/5] ALSA: jack: Refactoring for jack kctls Date: Wed, 08 Apr 2015 09:34:58 +0200 Message-ID: References: <1428062838-14786-1-git-send-email-yang.jie@intel.com> <5524D6D8.60205@canonical.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 4AA48265122 for ; Wed, 8 Apr 2015 09:34:59 +0200 (CEST) In-Reply-To: <5524D6D8.60205@canonical.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: David Henningsson Cc: broonie@kernel.org, alsa-devel@alsa-project.org, liam.r.girdwood@intel.com List-Id: alsa-devel@alsa-project.org At Wed, 08 Apr 2015 09:20:56 +0200, David Henningsson wrote: > > > > On 2015-04-07 18:06, Takashi Iwai wrote: > > This would work, yes. But, I have some uneasy feeling, something not > > well digested... > > > > Ideally, we want a single API for representing both input and kctl > > jacks. > > Maybe this is somewhat my fault for steering Yang in that direction. But > the requirements are somewhat different. > > HDA has the phantom jacks, and the exact naming for each kctl requirements. > ASoC has the combination/button requirements, i e one jack can represent > more than one kctl. > > The phantom jack requirement means that the snd_kctl_jack_new API cannot > be removed straight away; we could move it to be internal to HDA (it's > not much code anyway), but I don't see a need for that. > > But the HDA code can be moved around to look like this: > > if (phantom_jack) { > snd_kctl_jack_new(); > } > else { > snd_jack_new(); > snd_jack_add_new_kctls(); > } > > Now the HDA looks more like the ASoC variant. Yang, what do you think > about that? That would make the API simpler, wouldn't it? Well, what I thought was rather to allow snd_jack_new() creating a phantom jack, too, with some flag. When a phantom flag is set, it creates no input jack device but only kctl jacks. Takashi