Received: by 10.192.165.148 with SMTP id m20csp5387289imm; Tue, 1 May 2018 14:10:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZRNnzUTnJsdqE1O6Zwh5Ow0eXPY6ZO3E3q/9h42jiPlY3+9kYwhvi04EaZRid74EbDXpG X-Received: by 2002:a63:9a09:: with SMTP id o9-v6mr14344724pge.130.1525209044353; Tue, 01 May 2018 14:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525209044; cv=none; d=google.com; s=arc-20160816; b=lV+YdEzKGF4tcnuKlTq8/58fGW6S9gC4jMiSYm6UNAZSXmRT57UjjKkEdfd1uQ+J19 TBKqI1g+54O/cAxy/MHYkuOmX98FkJC6O5s8f01O9ynThvAAvSQY/txiIUXN7jQ8ulMz W8ObRrb/hF59VlMWlio/TiW01xvRBY6S0CpriXdK3FZi7EoDHYEfM230DJiTPUkxDoN2 8u7vsjFrG3ajeLYqX5QIlpCoNF4aEvj4JIdkW+TsVU0+CFoN2REx305AkjSu0LAky/zK 7SE3i/ldFynJfnhb9+UL3A59VoD2wOUTx5funJsWn0sTTbtbyPy1EGE6p+XrUzqbsK+U mIgg== 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=QL/QaahcnBKYL8AN/RutUywJ9dhdgQ4aH6x6jWAyV4s=; b=ouIKBAexrSi5MYFGerSMK7uUUGyoFF3wy+bPSy7P2+ZLe24kYzZBUEsGBWC/mx6tX1 siME9dasBH6/Vjg6Wph3+fh/IyuuzOjrMmzkn4YJ5lSt2dFTzJos8XC4wp5U5r6OjCgC TorlsApwD9k0OExktNTshbCYz/8ptM3uzhL7xjLJKOaeMYwnW5My0UBFNQDguTSRBbaG TRgouxOI48MNItoYPwEb419D8XECZm6iqlm0SUJBwhzNOMAnrxCkd2fa/Z157t15AWfm NMkZTBYy932lIqTRaBKxqO2KKla/DZGM/r1LrpGhl8Dk/YyH3BLZ+E/8doDYpD3XB1dc q5Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=S2Gkl8hF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si9805327pfn.254.2018.05.01.14.10.29; Tue, 01 May 2018 14:10:44 -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=S2Gkl8hF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbeEAVIy (ORCPT + 99 others); Tue, 1 May 2018 17:08:54 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:49942 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbeEAVIw (ORCPT ); Tue, 1 May 2018 17:08:52 -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=QL/QaahcnBKYL8AN/RutUywJ9dhdgQ4aH6x6jWAyV4s=; b=S2Gkl8hFTkWf /k+DGlf+pFCBU/Hviqn8ciSn8gxINYbRz+aqWbBYZ0dRb7L40pqBrmiEPFwnYpE6GrmTRqfeHLRRA mvTaaZlCKZPKPz5oKY7gj8vTVXhDBaTdNxy2zq9bpmsGumi7uGRRGBeuYZfDyK1Lh8Dkx2+mUYLAZ T4k3k=; Received: from [211.55.52.17] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDcVs-0001Op-PE; Tue, 01 May 2018 21:08:41 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id ED3D144007A; Tue, 1 May 2018 22:08:36 +0100 (BST) From: Mark Brown To: Ryder Lee Cc: Mark Brown , Mark Brown , alsa-devel@alsa-project.org, Garlic Tseng , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: mediatek: add the .probe() callback in mt2701_afe_pcm_dai_component" to the asoc tree In-Reply-To: <2bcfa1a389ff00a00204c2ddf3a94882195fd19d.1525090110.git.ryder.lee@mediatek.com> Message-Id: <20180501210836.ED3D144007A@finisterre.ee.mobilebroadband> Date: Tue, 1 May 2018 22:08:36 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: mediatek: add the .probe() callback in mt2701_afe_pcm_dai_component 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 10abdc7c149a058c74be803f33c9ffb1080ad07e Mon Sep 17 00:00:00 2001 From: Ryder Lee Date: Mon, 30 Apr 2018 20:15:31 +0800 Subject: [PATCH] ASoC: mediatek: add the .probe() callback in mt2701_afe_pcm_dai_component For the sake of uniformity, this patch adds a callback mt2701_afe_pcm_probe() in mt2701_afe_pcm_dai_component to retrieve the regmap - the canonical way to obtain the pointer.. Doing so, we could switch to use devm_snd_soc_register_component() to register the component driver. Signed-off-by: Ryder Lee Signed-off-by: Mark Brown --- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c index d6eeb4c36fcc..828d11c30c6a 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c @@ -958,7 +958,17 @@ static const struct snd_soc_dapm_route mt2701_afe_pcm_routes[] = { { "O31", "I35 Switch", "I35" }, }; +static int mt2701_afe_pcm_probe(struct snd_soc_component *component) +{ + struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); + + snd_soc_component_init_regmap(component, afe->regmap); + + return 0; +} + static const struct snd_soc_component_driver mt2701_afe_pcm_dai_component = { + .probe = mt2701_afe_pcm_probe, .name = "mt2701-afe-pcm-dai", .dapm_widgets = mt2701_afe_pcm_widgets, .num_dapm_widgets = ARRAY_SIZE(mt2701_afe_pcm_widgets), @@ -1316,22 +1326,6 @@ static int mt2701_afe_runtime_resume(struct device *dev) return mt2701_afe_enable_clock(afe); } -static int mt2701_afe_add_component(struct mtk_base_afe *afe) -{ - struct snd_soc_component *component; - - component = kzalloc(sizeof(*component), GFP_KERNEL); - if (!component) - return -ENOMEM; - - component->regmap = afe->regmap; - - return snd_soc_add_component(afe->dev, component, - &mt2701_afe_pcm_dai_component, - mt2701_afe_pcm_dais, - ARRAY_SIZE(mt2701_afe_pcm_dais)); -} - static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) { struct mtk_base_afe *afe; @@ -1442,7 +1436,10 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) goto err_platform; } - ret = mt2701_afe_add_component(afe); + ret = devm_snd_soc_register_component(&pdev->dev, + &mt2701_afe_pcm_dai_component, + mt2701_afe_pcm_dais, + ARRAY_SIZE(mt2701_afe_pcm_dais)); if (ret) { dev_warn(dev, "err_dai_component\n"); goto err_platform; -- 2.17.0