Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3838454imm; Mon, 18 Jun 2018 05:04:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEx5RYAnJ6LSPi0HQ2pyM0smVSzWN2/SXJjG1F1XTr/N0AJ8NQ4erxfGMszgZ2M7UPOM9A X-Received: by 2002:a62:4c04:: with SMTP id z4-v6mr13127240pfa.205.1529323460316; Mon, 18 Jun 2018 05:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323460; cv=none; d=google.com; s=arc-20160816; b=cDoLx+aqHgJwoTxnvjLspntWxQtUV0Uw7oHHfaMEQIzi3Ue9YOXr5CX0HfyfVyeaik CMp7vrPf4tYB3yWfi8deIlNcFiTFkAldN8j2pSzi4jAin/K5l2pzLigTT8LffjdYp/+A JsT9ckj1eBN9FTO5fKmSdsnzR/kPFDvru6DnEHupPBXzbzhKmM6w/Xb0Cp8T1VtEyaYP nWNmvRq2hyIVGsNW2qVNfccxlrPg1K79oKCK2Z6WJpvwjWcrpAapTePqHjTuJSQwQCjc ux5QCnqUHKOtIkkOPQqZ7YrZ+HsKkHwS3peYiLkNp0vnRh7/J5MhrVWYq+4wdlZNSbM4 OWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=y4OrGW1N7hlTHqtwKHXwXqscq6Zb/tUHzruiqKPnvB4=; b=qhih2WHxfuXUgEMZNJX7ht90SpVKbad0hva5wU/5X7aq6RxnD815W0RQRBvgXPBJX9 yjH2bRQXmLbe7P0IMHp3OBa/QogSb0A2KK1J8Hs/9rdV6zJLs5ONL+8SaIswYmLr9DdV MOhduKJsFE1G6mqLBLeoQmQAaPFboXqgj1odyn+OmZBHW2cyj9zuj3DO6Q4nVu6UkFAD O/McbMW7N++esdLOiNzT45hrk9qDrnO81GqOQmz48BxtX3/im699fD5vMkD/Delc+Oj7 +pWtoIsspbDo/gWwR4XVtxY0dBYCu24MyxrmOO2pLzLy0x+FnBcJ7cxLbjmHTcfkuRz6 5kUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=HL0minfH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q71-v6si14729403pfl.317.2018.06.18.05.04.06; Mon, 18 Jun 2018 05:04:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=HL0minfH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934822AbeFRMAV (ORCPT + 99 others); Mon, 18 Jun 2018 08:00:21 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:45544 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934774AbeFRMAS (ORCPT ); Mon, 18 Jun 2018 08:00:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=y4OrGW1N7hlTHqtwKHXwXqscq6Zb/tUHzruiqKPnvB4=; b=HL0minfHEpGY L2USjJFpjDCIeJ3hXNgOwaNL5Iv+EYVm5hZvJ2BIgHuA8sUgCkNPArK3KJnMGic9Pvn3Wg9WhjPUZ sdnHudwf79Tv4hsHvvtV98sZvkUHS37zSh4XFA+p7n73LJQFIXhAb6mm5fpYYdpeCOyF0qIOz0c/H mVEiE=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fUspQ-0007y7-BW; Mon, 18 Jun 2018 12:00:12 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fUspP-00009M-T8; Mon, 18 Jun 2018 13:00:11 +0100 From: Mark Brown To: Katsuhiro Suzuki Cc: Kuninori Morimoto , Mark Brown , Kuninori Morimoto , Mark Brown , alsa-devel@alsa-project.org, Jassi Brar , linux-arm-kernel@lists.infradead.org, Masami Hiramatsu , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: simple-card: move hp and mic detection to soc_card probe" to the asoc tree In-Reply-To: <20180611083214.16858-2-suzuki.katsuhiro@socionext.com> Message-Id: Date: Mon, 18 Jun 2018 13:00:11 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: simple-card: move hp and mic detection to soc_card probe has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 8d1bd113a194407f9ad083403ea1cf92108edf5c Mon Sep 17 00:00:00 2001 From: Katsuhiro Suzuki Date: Mon, 11 Jun 2018 17:32:13 +0900 Subject: [PATCH] ASoC: simple-card: move hp and mic detection to soc_card probe This patch moves headphone and microphone detection to probe() of snd_soc_card from init() of snd_soc_dai_link. This is because init() is called (and an input device /dev/input/eventX is created too) twice or above if simple card has two or more DAI links. Signed-off-by: Katsuhiro Suzuki Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/generic/simple-card.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index a6477a022156..c5b6e04cd926 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -149,14 +149,6 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd) if (ret < 0) return ret; - ret = asoc_simple_card_init_hp(rtd->card, &priv->hp_jack, PREFIX); - if (ret < 0) - return ret; - - ret = asoc_simple_card_init_mic(rtd->card, &priv->mic_jack, PREFIX); - if (ret < 0) - return ret; - return 0; } @@ -350,6 +342,22 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) return ret; } +static int asoc_simple_soc_card_probe(struct snd_soc_card *card) +{ + struct simple_card_data *priv = snd_soc_card_get_drvdata(card); + int ret; + + ret = asoc_simple_card_init_hp(card, &priv->hp_jack, PREFIX); + if (ret < 0) + return ret; + + ret = asoc_simple_card_init_mic(card, &priv->mic_jack, PREFIX); + if (ret < 0) + return ret; + + return 0; +} + static int asoc_simple_card_probe(struct platform_device *pdev) { struct simple_card_data *priv; @@ -385,6 +393,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) card->dev = dev; card->dai_link = priv->dai_link; card->num_links = num; + card->probe = asoc_simple_soc_card_probe; if (np && of_device_is_available(np)) { -- 2.17.1