-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Tuesday, April 21, 2015 5:21 AM To: Jie, Yang Cc: tiwai@suse.de; alsa-devel@alsa-project.org; Girdwood, Liam R; tanu.kaskinen@linux.intel.com Subject: Re: [PATCH v6 4/6] ASoC: jack: create kctls according to jack pins info
On Sat, Apr 18, 2015 at 06:04:18PM +0800, Jie Yang wrote:
In the new jack kctls design, we can create kctls according to pins info:
- during jack creating, snd_jack_new() with NULL jack_kctl; 2. for
each pin, call snd_jack_add_kctls() to add one kctl (it will call snd_ctl_add() to add kctl to card);
I'm a little confused why this isn't done by the jack core?
The kctl creating and adding to jack is actually done by the jack core(inside snd_jack_add_kctls()).
Mark, do you mean that you prefer doing this inside snd_jack_new()?
For we may need create multiple kctls for a jack, and I found we can reuse the pins' info for those kctls' creating.
For example, in broadwell.c, the jack broadwell_headset have 2 pins: "Mic Jack" and "Headphone Jack", then 2 kctls with same names will be created, and they are visible for PA, can be switched on/off by PA separately.
~Keyon