Re: [PATCH v4 0/5] ALSA: jack: Refactoring for jack kctls

David Henningsson
2015-04-08T07:50:01Z

On 2015-04-08 09:34, Takashi Iwai wrote:
> 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.

Yes, that sounds even better - that would make it easy for non-HDA
drivers to create phantom jacks too, if they want.

--
David Henningsson, Canonical Ltd.