From patchwork Sat Apr 18 10:04:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jie, Yang" X-Patchwork-Id: 6236761 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E6B8BF4A6 for ; Sat, 18 Apr 2015 10:02:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D86E6203AB for ; Sat, 18 Apr 2015 10:02:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E3CC1203A0 for ; Sat, 18 Apr 2015 10:02:10 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 05E8F265A55; Sat, 18 Apr 2015 12:02:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6C4A42615F7; Sat, 18 Apr 2015 12:01:13 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 39256261736; Sat, 18 Apr 2015 12:01:12 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 72760261736 for ; Sat, 18 Apr 2015 12:01:07 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 18 Apr 2015 03:01:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,599,1422950400"; d="scan'208";a="711346023" Received: from keyon-u1310.sh.intel.com ([10.239.13.15]) by fmsmga002.fm.intel.com with ESMTP; 18 Apr 2015 03:01:05 -0700 From: Jie Yang To: tiwai@suse.de Date: Sat, 18 Apr 2015 18:04:18 +0800 Message-Id: <1429351460-15932-5-git-send-email-yang.jie@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429351460-15932-1-git-send-email-yang.jie@intel.com> References: <1429351460-15932-1-git-send-email-yang.jie@intel.com> Cc: alsa-devel@alsa-project.org, broonie@kernel.org, tanu.kaskinen@linux.intel.com, liam.r.girdwood@intel.com Subject: [alsa-devel] [PATCH v6 4/6] ASoC: jack: create kctls according to jack pins info X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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_kctls() 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..44b3c8c 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_kctls(jack->jack, pins[i].pin, pins[i].mask); } /* Update to reflect the last reported status; canned jack