From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jie Yang Subject: [PATCH v7 5/7] ASoC: jack: create kctls according to jack pins info Date: Tue, 21 Apr 2015 16:05:43 +0800 Message-ID: <1429603545-21063-6-git-send-email-yang.jie@intel.com> References: <1429603545-21063-1-git-send-email-yang.jie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 37A532606B3 for ; Tue, 21 Apr 2015 10:02:39 +0200 (CEST) In-Reply-To: <1429603545-21063-1-git-send-email-yang.jie@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: tiwai@suse.de Cc: alsa-devel@alsa-project.org, broonie@kernel.org, liam.r.girdwood@intel.com List-Id: alsa-devel@alsa-project.org In the new jack kctls design, we can create kctls according to pins info: 1. during jack creating, snd_jack_new() with NULL jack_kctl; 2. for each pin, call snd_jack_add_kctl() to add one kctl (it will call snd_ctl_add() to add kctl to card); Signed-off-by: Jie Yang --- sound/soc/soc-jack.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 836368b..b53f316 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -197,6 +197,7 @@ int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, INIT_LIST_HEAD(&pins[i].list); list_add(&(pins[i].list), &jack->pins); + snd_jack_add_new_kctl(jack->jack, pins[i].pin, pins[i].mask); } /* Update to reflect the last reported status; canned jack -- 1.9.1