From patchwork Thu Jan 15 11:52:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 5638801 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2A56C058D for ; Thu, 15 Jan 2015 11:56:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 084F52015E for ; Thu, 15 Jan 2015 11:56:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CDAE620158 for ; Thu, 15 Jan 2015 11:56:20 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1834826576D; Thu, 15 Jan 2015 12:56:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 9537E261298; Thu, 15 Jan 2015 12:52:42 +0100 (CET) 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 7687D261171; Thu, 15 Jan 2015 12:52:40 +0100 (CET) Received: from smtp-out-247.synserver.de (smtp-out-247.synserver.de [212.40.185.247]) by alsa0.perex.cz (Postfix) with ESMTP id BDFC72605F5 for ; Thu, 15 Jan 2015 12:52:24 +0100 (CET) Received: (qmail 9558 invoked by uid 0); 15 Jan 2015 11:52:24 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 8899 Received: from p4fc46079.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.196.96.121] by 217.119.54.96 with SMTP; 15 Jan 2015 11:52:23 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Thu, 15 Jan 2015 12:52:08 +0100 Message-Id: <1421322737-19077-9-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1421322737-19077-1-git-send-email-lars@metafoo.de> References: <1421322737-19077-1-git-send-email-lars@metafoo.de> Cc: Oder Chiou , alsa-devel@alsa-project.org, Lars-Peter Clausen , Jyri Sarha , Peter Ujfalusi , Bard Liao , Misael Lopez Cruz Subject: [alsa-devel] [PATCH 08/17] ASoC: alc5623: Replace w->codec snd_soc_dapm_to_codec(w->dapm) 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 X-Virus-Scanned: ClamAV using ClamSMTP The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/alc5623.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index bdf8c5a..0e35799 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c @@ -55,18 +55,20 @@ static inline int alc5623_reset(struct snd_soc_codec *codec) static int amp_mixer_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { + struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); + /* to power-on/off class-d amp generators/speaker */ /* need to write to 'index-46h' register : */ /* so write index num (here 0x46) to reg 0x6a */ /* and then 0xffff/0 to reg 0x6c */ - snd_soc_write(w->codec, ALC5623_HID_CTRL_INDEX, 0x46); + snd_soc_write(codec, ALC5623_HID_CTRL_INDEX, 0x46); switch (event) { case SND_SOC_DAPM_PRE_PMU: - snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0xFFFF); + snd_soc_write(codec, ALC5623_HID_CTRL_DATA, 0xFFFF); break; case SND_SOC_DAPM_POST_PMD: - snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0); + snd_soc_write(codec, ALC5623_HID_CTRL_DATA, 0); break; }