From patchwork Tue Oct 6 15:07:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 7336051 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 15D25BEEA4 for ; Tue, 6 Oct 2015 15:22:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28B012071A for ; Tue, 6 Oct 2015 15:22:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3BDE120660 for ; Tue, 6 Oct 2015 15:22:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CA8F7265D73; Tue, 6 Oct 2015 17:22:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BA59A26583C; Tue, 6 Oct 2015 17:15:07 +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 75DE42657B6; Tue, 6 Oct 2015 17:15:06 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 0D1E426592A for ; Tue, 6 Oct 2015 17:10:32 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 06 Oct 2015 08:08:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,644,1437462000"; d="scan'208";a="804820779" Received: from vkoul-mobl.iind.intel.com ([10.252.23.210]) by fmsmga001.fm.intel.com with ESMTP; 06 Oct 2015 08:08:29 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Tue, 6 Oct 2015 16:07:47 +0100 Message-Id: <1444144075-28963-11-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444144075-28963-1-git-send-email-vinod.koul@intel.com> References: <1444144075-28963-1-git-send-email-vinod.koul@intel.com> Cc: liam.r.girdwood@linux.intel.com, tiwai@suse.de, broonie@kernel.org, Vinod Koul , patches.audio@intel.com Subject: [alsa-devel] [PATCH 10/18] ALSA: hda: move patch_cirrus to use hdac helpers 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 Move patch_cirrus to use newly moved snd_hdac_read/write_codec() APIs This was done using coccinelle script Signed-off-by: Vinod Koul --- sound/pci/hda/patch_cirrus.c | 52 +++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 584a0343ab0c..f07b90bb438f 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -142,9 +142,9 @@ enum { static inline int cs_vendor_coef_get(struct hda_codec *codec, unsigned int idx) { struct cs_spec *spec = codec->spec; - snd_hda_codec_write(codec, spec->vendor_nid, 0, - AC_VERB_SET_COEF_INDEX, idx); - return snd_hda_codec_read(codec, spec->vendor_nid, 0, + snd_hdac_codec_write(&codec->core, spec->vendor_nid, 0, + AC_VERB_SET_COEF_INDEX, idx); + return snd_hdac_codec_read(&codec->core, spec->vendor_nid, 0, AC_VERB_GET_PROC_COEF, 0); } @@ -152,10 +152,10 @@ static inline void cs_vendor_coef_set(struct hda_codec *codec, unsigned int idx, unsigned int coef) { struct cs_spec *spec = codec->spec; - snd_hda_codec_write(codec, spec->vendor_nid, 0, - AC_VERB_SET_COEF_INDEX, idx); - snd_hda_codec_write(codec, spec->vendor_nid, 0, - AC_VERB_SET_PROC_COEF, coef); + snd_hdac_codec_write(&codec->core, spec->vendor_nid, 0, + AC_VERB_SET_COEF_INDEX, idx); + snd_hdac_codec_write(&codec->core, spec->vendor_nid, 0, + AC_VERB_SET_PROC_COEF, coef); } /* @@ -176,8 +176,8 @@ static void cs_automute(struct hda_codec *codec) if (spec->gpio_eapd_hp || spec->gpio_eapd_speaker) { spec->gpio_data = spec->gen.hp_jack_present ? spec->gpio_eapd_hp : spec->gpio_eapd_speaker; - snd_hda_codec_write(codec, 0x01, 0, - AC_VERB_SET_GPIO_DATA, spec->gpio_data); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_DATA, spec->gpio_data); } } @@ -316,12 +316,13 @@ static int cs_init(struct hda_codec *codec) snd_hda_gen_init(codec); if (spec->gpio_mask) { - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, - spec->gpio_mask); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, - spec->gpio_dir); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, - spec->gpio_data); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_MASK, spec->gpio_mask); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_DIRECTION, + spec->gpio_dir); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_DATA, spec->gpio_data); } if (spec->vendor_nid == CS420X_VENDOR_NID) { @@ -1033,12 +1034,13 @@ static int cs421x_init(struct hda_codec *codec) snd_hda_gen_init(codec); if (spec->gpio_mask) { - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, - spec->gpio_mask); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, - spec->gpio_dir); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, - spec->gpio_data); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_MASK, spec->gpio_mask); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_DIRECTION, + spec->gpio_dir); + snd_hdac_codec_write(&codec->core, 0x01, 0, + AC_VERB_SET_GPIO_DATA, spec->gpio_data); } init_input_coef(codec); @@ -1111,10 +1113,10 @@ static int cs421x_suspend(struct hda_codec *codec) snd_hda_shutup_pins(codec); - snd_hda_codec_write(codec, CS4210_DAC_NID, 0, - AC_VERB_SET_POWER_STATE, AC_PWRST_D3); - snd_hda_codec_write(codec, CS4210_ADC_NID, 0, - AC_VERB_SET_POWER_STATE, AC_PWRST_D3); + snd_hdac_codec_write(&codec->core, CS4210_DAC_NID, 0, + AC_VERB_SET_POWER_STATE, AC_PWRST_D3); + snd_hdac_codec_write(&codec->core, CS4210_ADC_NID, 0, + AC_VERB_SET_POWER_STATE, AC_PWRST_D3); if (spec->vendor_nid == CS4210_VENDOR_NID) { coef = cs_vendor_coef_get(codec, CS421X_IDX_DEV_CFG);