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: 9959599 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 7927460568 for ; Tue, 19 Sep 2017 16:39:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 671B328E91 for ; Tue, 19 Sep 2017 16:39:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BDD628E93; Tue, 19 Sep 2017 16:39:52 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C994628E91 for ; Tue, 19 Sep 2017 16:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: References:List-Owner; bh=bipCtXre95O+Oho29O67/ynrUZ4DkGe74xhsLzhUwnQ=; b=CIZ VVgOGASYzUVIqfIk8ZRiphMHAiHxfOOItQgJuN9PUt9QyynZMbEjnogC7Il7QYGWAtvSb3C0bUcxP zLM0qK0WUGyAEFvy+UGbAGd8hf/py8q6VA7NZGZe0r/BftKeDLMpC1w1z09rfVJJ4ZnFXVKCJUZrc lhiahYRnt8sijF/Rf3Iz5i0yIfAG4C8dBPP1orCdQBS4FpltUDUs5lBZijKVNW6Pt7LSYj+e8c9J0 oOMaSHgqAHs7jyO1v8Lxq2f0pbejRvBVfg2+CLjHMOtrdbK7yYpTxXLZVFDFxg2EG/VnSHoLZN0qu 3f12iMGA5+Ydlwu9wCy/7neERtF22fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1duLYs-0001M7-WF; Tue, 19 Sep 2017 16:39:51 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duLMZ-0003UV-Ho for linux-arm-kernel@bombadil.infradead.org; Tue, 19 Sep 2017 16:27:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=V1G4ZfjoNDOVs94shcTHXaqg5N s5xjLwDwrUw6MbumpWltYIccXKoZsuj4IPCkEFX/q+4vkorpf28SaJJvntP19/eIytVlCscgu3mMQ Z25ZJ1JuxqpfW5uRGfskW1KTn6KVp6KeCpfqVFm3W2aqi0MHB5Y/4ExddsgPP4fAWYxzi+YHAGKrJ 2NAkrOfCdMvsbKW6Wn3qf5ihocN/ZeLcpiO9deHK0bXAhPkhF0NPgnm5d5oLCVwNztbFvcQSSakn0 YhuN54u/Jcltby2uWmshzOkzICv5MAJ5pHiPuc/WAr+hAPvtrwGJzTXtPoQAZMPf7prf24QBovAtj YD+7EPWg==; Received: from heliosphere.sirena.org.uk ([2a01:7e01::f03c:91ff:fed4:a3b6]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duL8y-0005Fr-C7 for linux-arm-kernel@lists.infradead.org; Tue, 19 Sep 2017 16:13:08 +0000 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 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 X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170919_171304_491183_34253ECF X-CRM114-Status: GOOD ( 23.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-input@vger.kernel.org, alsa-devel@alsa-project.org, Lars-Peter Clausen , Liam Girdwood , linux-kernel@vger.kernel.org, Dmitry Torokhov , Takashi Iwai , Haojian Zhuang , Jaroslav Kysela , Mark Brown , linux-arm-kernel@lists.infradead.org, patches@opensource.wolfsonmicro.com, Charles Keepax , Lee Jones , Daniel Mack MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)); }