From patchwork Tue Sep 19 16:11:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 113033 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp1207225edb; Tue, 19 Sep 2017 09:11:36 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCYP+UmXpc9LtdUqOBQFYTGJkb5ifLkKjbPc+fq+JQ7MteKEGEYgdZ0sEe822ZD8Z89LzKM X-Received: by 10.28.35.22 with SMTP id j22mr1590205wmj.68.1505837496214; Tue, 19 Sep 2017 09:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505837496; cv=none; d=google.com; s=arc-20160816; b=0r6sssEU58TUgEmAlfACkmAKQl/ytPi1rTSRInorif7VgH76NYD+R+Rmxt6kR4nYhN Y0t4N9VC7Xk/CsLIWFPRooe5t3C66uTMwWxLMBCDvCT9jB0hLdBkgImRuhM4AxvrUH96 DdoEXCGuz5NnzyTayL6v2ojVJKSrDHO1pLVEHR7Y5FpOGuYsyGf+7qwvhdBYjV26k3YU UcNyjhnO48mYgkQ7yyZrf20IoDwKYMhiyb1cWsOvBLsrm0JScVXdMkN6lQJwIsBx36ud Vyb76gs4f4CGBES81WbEvqP6vFMtGYdtcFqxnxx8e71A3eCF4S18pT2hAb2jBdNR9uGL HdYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=TDmv22Yq+UV8xYrThSsjloZC+ZiPVt1MWgq4kt3hKWg=; b=pXljw2FEFVjx9ZUYY8l8J7qark941B0eHxa1VHsrF5OlaebisvUVCHmAZWOttnXVCK AfoRLDnPQeTmhAVq9Y28XD8nMTaRQKMrj/sp/wy20YJjBc8tUxlUP3RyW2Vr0fB/+wWM NweUMR8MA7s2iVZral+ivbNLnYZ2EcqfV3QA8KmlWagVtxm4zysnQIFeFJG6BjGjStjP tnmg/2zA99kSDkAiDVuLc5PUKnkU3xdARAPl9ualaqyGnU4LJvlol+2AJjw4T+Jy2ZnN DQ8pQ9dNOm98+fb/Px4LldTXLZwkvVET7vL3gIZQY+OsEnmK/NT1wT/6ZoNvesC3kXl6 VCIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=kdIQtd36; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y193si1565851wme.220.2017.09.19.09.11.33; Tue, 19 Sep 2017 09:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=kdIQtd36; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CE868267437; Tue, 19 Sep 2017 18:11:18 +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 B1A5D267437; Tue, 19 Sep 2017 18:11:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_NEUTRAL autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 2D26626742C for ; Tue, 19 Sep 2017 18:11:16 +0200 (CEST) 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=1p/U1c4nzzIL4E/PiPANhrjQ2itu23kvvOfAQa9vM3E=; b=kdIQtd3680YY Bel6CO6D45WNvDCeTMKwK6YOXbzcyZQye7O4RVqu4ArR7hi8SAWQxGXzCdAmsUeXyw4HSmCnyE7ts 0Y0OD8Xtjc9MHDvsWZZfN5KJOxetHFGoOizaJmoVwuP3OlXXnN9BBxRQxKF8kN8by3oltfew87mIt vSJxw=; 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 1duL7B-0001fE-I8; Tue, 19 Sep 2017 16:11:13 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1duL7B-0004iy-45; Tue, 19 Sep 2017 17:11:13 +0100 From: Mark Brown To: Robert Jarzmik In-Reply-To: Message-Id: Date: Tue, 19 Sep 2017 17:11:13 +0100 Cc: Charles Keepax , Mark Brown , alsa-devel@alsa-project.org Subject: [alsa-devel] Applied "ASoC: wm9713: add ac97 new bus support" to the asoc tree 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 The patch ASoC: wm9713: add ac97 new bus support has been applied to the asoc tree at git://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 9bd400cadae05a26c3a22dd8393081cb96d0e26a Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Wed, 13 Sep 2017 21:37:19 +0200 Subject: [PATCH] ASoC: wm9713: add ac97 new bus support Add support for the new ac97 bus model, where devices are automatically discovered on AC-Links. Signed-off-by: Robert Jarzmik Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/Kconfig | 3 ++- sound/soc/codecs/wm9713.c | 39 +++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 13 deletions(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index c367d11079bc..807901cac1b3 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -216,7 +216,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM9090 if I2C select SND_SOC_WM9705 if SND_SOC_AC97_BUS select SND_SOC_WM9712 if SND_SOC_AC97_BUS - select SND_SOC_WM9713 if SND_SOC_AC97_BUS + select SND_SOC_WM9713 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW) help Normally ASoC codec drivers are only built if a machine driver which uses them is also built since they are only usable with a machine @@ -1136,6 +1136,7 @@ config SND_SOC_WM9712 config SND_SOC_WM9713 tristate select REGMAP_AC97 + select AC97_BUS_COMPAT if AC97_BUS_NEW config SND_SOC_ZX_AUD96P22 tristate "ZTE ZX AUD96P22 CODEC" diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 7e4822185feb..df7220656d98 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -17,12 +17,15 @@ #include #include +#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -38,6 +41,7 @@ struct wm9713_priv { u32 pll_in; /* PLL input frequency */ unsigned int hp_mixer[2]; struct mutex lock; + struct wm97xx_platform_data *mfd_pdata; }; #define HPL_MIXER 0 @@ -1205,17 +1209,23 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec) static int wm9713_soc_probe(struct snd_soc_codec *codec) { struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); - struct regmap *regmap; + struct regmap *regmap = NULL; - wm9713->ac97 = snd_soc_new_ac97_codec(codec, WM9713_VENDOR_ID, - WM9713_VENDOR_ID_MASK); - if (IS_ERR(wm9713->ac97)) - return PTR_ERR(wm9713->ac97); - - regmap = regmap_init_ac97(wm9713->ac97, &wm9713_regmap_config); - if (IS_ERR(regmap)) { - snd_soc_free_ac97_codec(wm9713->ac97); - return PTR_ERR(regmap); + if (wm9713->mfd_pdata) { + wm9713->ac97 = wm9713->mfd_pdata->ac97; + regmap = wm9713->mfd_pdata->regmap; + } else { +#ifdef CONFIG_SND_SOC_AC97_BUS + wm9713->ac97 = snd_soc_new_ac97_codec(codec, WM9713_VENDOR_ID, + WM9713_VENDOR_ID_MASK); + if (IS_ERR(wm9713->ac97)) + return PTR_ERR(wm9713->ac97); + regmap = regmap_init_ac97(wm9713->ac97, &wm9713_regmap_config); + if (IS_ERR(regmap)) { + snd_soc_free_ac97_codec(wm9713->ac97); + return PTR_ERR(regmap); + } +#endif } snd_soc_codec_init_regmap(codec, regmap); @@ -1228,10 +1238,14 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) static int wm9713_soc_remove(struct snd_soc_codec *codec) { +#ifdef CONFIG_SND_SOC_AC97_BUS struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); - snd_soc_codec_exit_regmap(codec); - snd_soc_free_ac97_codec(wm9713->ac97); + if (!wm9713->mfd_pdata) { + snd_soc_codec_exit_regmap(codec); + snd_soc_free_ac97_codec(wm9713->ac97); + } +#endif return 0; } @@ -1262,6 +1276,7 @@ static int wm9713_probe(struct platform_device *pdev) mutex_init(&wm9713->lock); + wm9713->mfd_pdata = dev_get_platdata(&pdev->dev); platform_set_drvdata(pdev, wm9713); return snd_soc_register_codec(&pdev->dev,