From patchwork Tue Sep 19 16:11:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9959499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4882601E9 for ; Tue, 19 Sep 2017 16:11:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE0FD2623D for ; Tue, 19 Sep 2017 16:11:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C246D284FC; Tue, 19 Sep 2017 16:11:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47EBA2623D for ; Tue, 19 Sep 2017 16:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751763AbdISQL4 (ORCPT ); Tue, 19 Sep 2017 12:11:56 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:60878 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbdISQLp (ORCPT ); Tue, 19 Sep 2017 12:11:45 -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=bO8oGG5m925lYNcvaPyasFsHQ4fJoSt+H8VyEiKxV2U=; b=tXNivPFGu/ks FzVX3syH4OG2X+haLXj8R9AXEEla577FqkmWyEf6jrjEtBra1eJPvqkU8cQvb09TcRkCPofrJLvUW mD9nZm5c03Zh954LN2E2yWB4OSxmkefXOIcx5NvB+k/GaQeDua64fRs6RR0T8GkE/Sbb+a0DgWSjz UJBlc=; 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 1duL75-0001er-Mp; Tue, 19 Sep 2017 16:11:07 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1duL75-0004gs-9C; Tue, 19 Sep 2017 17:11:07 +0100 From: Mark Brown To: Robert Jarzmik Cc: Charles Keepax , Mark Brown , Dmitry Torokhov , Lee Jones , Jaroslav Kysela , Takashi Iwai , Daniel Mack , Haojian Zhuang , Liam Girdwood , Mark Brown , Lars-Peter Clausen , Charles Keepax , alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: wm9705: add private structure" to the asoc tree In-Reply-To: <1497857229-12049-10-git-send-email-robert.jarzmik@free.fr> Message-Id: Date: Tue, 19 Sep 2017 17:11:07 +0100 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: wm9705: add private structure 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 c6e46e52b7b3301dda529830226e578cf773151c Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Wed, 13 Sep 2017 21:37:21 +0200 Subject: [PATCH] ASoC: wm9705: add private structure Add a private data structure. This is a preparation for a codec which would need an another data on top of snd_ac97, which will be the case when an MFD wm97xx device will probe wm9705. Signed-off-by: Robert Jarzmik Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm9705.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index f6d5c0f2aea5..08477d040028 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c @@ -24,6 +24,10 @@ #define WM9705_VENDOR_ID 0x574d4c05 #define WM9705_VENDOR_ID_MASK 0xffffffff +struct wm9705_priv { + struct snd_ac97 *ac97; +}; + static const struct reg_default wm9705_reg_defaults[] = { { 0x02, 0x8000 }, { 0x04, 0x8000 }, @@ -292,10 +296,10 @@ static int wm9705_soc_suspend(struct snd_soc_codec *codec) static int wm9705_soc_resume(struct snd_soc_codec *codec) { - struct snd_ac97 *ac97 = snd_soc_codec_get_drvdata(codec); + struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec); int ret; - ret = snd_ac97_reset(ac97, true, WM9705_VENDOR_ID, + ret = snd_ac97_reset(wm9705->ac97, true, WM9705_VENDOR_ID, WM9705_VENDOR_ID_MASK); if (ret < 0) return ret; @@ -311,38 +315,38 @@ static int wm9705_soc_resume(struct snd_soc_codec *codec) static int wm9705_soc_probe(struct snd_soc_codec *codec) { - struct snd_ac97 *ac97; + struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec); struct regmap *regmap; int ret; - ac97 = snd_soc_new_ac97_codec(codec, WM9705_VENDOR_ID, - WM9705_VENDOR_ID_MASK); - if (IS_ERR(ac97)) { + wm9705->ac97 = snd_soc_new_ac97_codec(codec, WM9705_VENDOR_ID, + WM9705_VENDOR_ID_MASK); + if (IS_ERR(wm9705->ac97)) { dev_err(codec->dev, "Failed to register AC97 codec\n"); - return PTR_ERR(ac97); + return PTR_ERR(wm9705->ac97); } - regmap = regmap_init_ac97(ac97, &wm9705_regmap_config); + regmap = regmap_init_ac97(wm9705->ac97, &wm9705_regmap_config); if (IS_ERR(regmap)) { ret = PTR_ERR(regmap); goto err_free_ac97_codec; } - snd_soc_codec_set_drvdata(codec, ac97); + snd_soc_codec_set_drvdata(codec, wm9705->ac97); snd_soc_codec_init_regmap(codec, regmap); return 0; err_free_ac97_codec: - snd_soc_free_ac97_codec(ac97); + snd_soc_free_ac97_codec(wm9705->ac97); return ret; } static int wm9705_soc_remove(struct snd_soc_codec *codec) { - struct snd_ac97 *ac97 = snd_soc_codec_get_drvdata(codec); + struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec); snd_soc_codec_exit_regmap(codec); - snd_soc_free_ac97_codec(ac97); + snd_soc_free_ac97_codec(wm9705->ac97); return 0; } @@ -364,6 +368,14 @@ static const struct snd_soc_codec_driver soc_codec_dev_wm9705 = { static int wm9705_probe(struct platform_device *pdev) { + struct wm9705_priv *wm9705; + + wm9705 = devm_kzalloc(&pdev->dev, sizeof(*wm9705), GFP_KERNEL); + if (wm9705 == NULL) + return -ENOMEM; + + platform_set_drvdata(pdev, wm9705); + return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm9705, wm9705_dai, ARRAY_SIZE(wm9705_dai)); }