From patchwork Mon Jun 20 08:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7515C43334 for ; Mon, 20 Jun 2022 08:13:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0AFF18A7; Mon, 20 Jun 2022 10:12:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0AFF18A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712829; bh=lD2G5JwHec2OmnF8T8Qd5ZXlprPapmWgIqCk2wrTBzE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QSnwrug1waAkxRGuGJe8A0UWW/GWnV+tOvJ5xBGEWQQz9/5xUPxUgFUQJ6vQ76EKF 4zAeyfHC3gJrGVOMBsyXYPSeszjdKWU5NoMFwwL8GLY3NY2FoZqCY7XlDCaNda46PP xfz8fcLd1BS1znmlpkizMOpUA+fHTKtGxk0ZW+oM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 39D75F800CB; Mon, 20 Jun 2022 10:12:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 102CCF80536; Mon, 20 Jun 2022 10:12:32 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E6EEAF800FB for ; Mon, 20 Jun 2022 10:12:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E6EEAF800FB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AnxbVKvy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712746; x=1687248746; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lD2G5JwHec2OmnF8T8Qd5ZXlprPapmWgIqCk2wrTBzE=; b=AnxbVKvyfqQujY9IlbVmGNWK+lTuGP4YNxJUhHbWVqVcZyrQd3AHRL44 8sHn2jpVSiYUFGs86NuI0eLvMU3s/b1mG1aMNNsxjA/W0wO/jD7+PW3/q sHf7LbdKzLSVVpqMHQ9uJLQMmMdRsAG72tmEmZK6M4xSGg3jLV6r6XHC0 DnjhS0W5ogM9vTKsaLnhko2Q5EMQrud/GQ8xgrRsYapihmjuFPDrFy5gP jimfe4NRLqiTyypyrjEzKF03W3A9Zmn4TlxhYaVA3HOqWFwY+SNkmQnFU VGqF77cJq+gJFRADF8imEiE4tyGETXGkz6oorZEZi8fMZdcu49vLjykK3 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270853" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270853" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067352" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:19 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 02/17] ASoC: Intel: hsw_rt5640: Reword prefixes of all driver members Date: Mon, 20 Jun 2022 10:22:11 +0200 Message-Id: <20220620082226.2489357-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Replace ambiguous 'haswell_rt5640_' prefixes in favour of 'card_', 'link_' and other similar strings to clearly state which object given member implements behavior for. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/hsw_rt5640.c | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index aa61e101f793..b51ce8d0ca22 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -16,12 +16,12 @@ #include "../../codecs/rt5640.h" /* Haswell ULT platforms have a Headphone and Mic jack */ -static const struct snd_soc_dapm_widget haswell_widgets[] = { +static const struct snd_soc_dapm_widget card_widgets[] = { SND_SOC_DAPM_HP("Headphones", NULL), SND_SOC_DAPM_MIC("Mic", NULL), }; -static const struct snd_soc_dapm_route haswell_rt5640_map[] = { +static const struct snd_soc_dapm_route card_routes[] = { {"Headphones", NULL, "HPOR"}, {"Headphones", NULL, "HPOL"}, @@ -32,7 +32,7 @@ static const struct snd_soc_dapm_route haswell_rt5640_map[] = { {"AIF1 Playback", NULL, "SSP0 CODEC OUT"}, }; -static int haswell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, +static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *rate = hw_param_interval(params, @@ -49,7 +49,7 @@ static int haswell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } -static int haswell_rt5640_hw_params(struct snd_pcm_substream *substream, +static int codec_link_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); @@ -70,8 +70,8 @@ static int haswell_rt5640_hw_params(struct snd_pcm_substream *substream, return ret; } -static const struct snd_soc_ops haswell_rt5640_ops = { - .hw_params = haswell_rt5640_hw_params, +static const struct snd_soc_ops codec_link_ops = { + .hw_params = codec_link_hw_params, }; SND_SOC_DAILINK_DEF(dummy, @@ -98,7 +98,7 @@ SND_SOC_DAILINK_DEF(platform, SND_SOC_DAILINK_DEF(ssp0_port, DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port"))); -static struct snd_soc_dai_link haswell_rt5640_dais[] = { +static struct snd_soc_dai_link card_dai_links[] = { /* Front End DAI links */ { .name = "System", @@ -147,8 +147,8 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = { .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC, .ignore_pmdown_time = 1, - .be_hw_params_fixup = haswell_ssp0_fixup, - .ops = &haswell_rt5640_ops, + .be_hw_params_fixup = codec_link_hw_params_fixup, + .ops = &codec_link_ops, .dpcm_playback = 1, .dpcm_capture = 1, SND_SOC_DAILINK_REG(ssp0_port, codec, platform), @@ -156,44 +156,44 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = { }; /* audio machine driver for Haswell Lynxpoint DSP + RT5640 */ -static struct snd_soc_card haswell_rt5640 = { +static struct snd_soc_card hsw_rt5640_card = { .name = "haswell-rt5640", .owner = THIS_MODULE, - .dai_link = haswell_rt5640_dais, - .num_links = ARRAY_SIZE(haswell_rt5640_dais), - .dapm_widgets = haswell_widgets, - .num_dapm_widgets = ARRAY_SIZE(haswell_widgets), - .dapm_routes = haswell_rt5640_map, - .num_dapm_routes = ARRAY_SIZE(haswell_rt5640_map), + .dai_link = card_dai_links, + .num_links = ARRAY_SIZE(card_dai_links), + .dapm_widgets = card_widgets, + .num_dapm_widgets = ARRAY_SIZE(card_widgets), + .dapm_routes = card_routes, + .num_dapm_routes = ARRAY_SIZE(card_routes), .fully_routed = true, }; -static int haswell_audio_probe(struct platform_device *pdev) +static int hsw_rt5640_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; int ret; - haswell_rt5640.dev = &pdev->dev; + hsw_rt5640_card.dev = &pdev->dev; /* override platform name, if required */ mach = pdev->dev.platform_data; - ret = snd_soc_fixup_dai_links_platform_name(&haswell_rt5640, + ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, mach->mach_params.platform); if (ret) return ret; - return devm_snd_soc_register_card(&pdev->dev, &haswell_rt5640); + return devm_snd_soc_register_card(&pdev->dev, &hsw_rt5640_card); } -static struct platform_driver haswell_audio = { - .probe = haswell_audio_probe, +static struct platform_driver hsw_rt5640_driver = { + .probe = hsw_rt5640_probe, .driver = { .name = "haswell-audio", .pm = &snd_soc_pm_ops, }, }; -module_platform_driver(haswell_audio) +module_platform_driver(hsw_rt5640_driver) /* Module information */ MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); From patchwork Mon Jun 20 08:22:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6AEFC433EF for ; Mon, 20 Jun 2022 08:14:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CAC6A18D1; Mon, 20 Jun 2022 10:13:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAC6A18D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712858; bh=IwFzZR/dDdOnz/WoMNQ45E381MBJMF1Mmf6b0pF1HWg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Tkr4iA57UnwnHzhFm4tcdI+6Ut+yVWOxyIWkF8Ym5ebOumgSu7KQd3r3nK8XEaC4T pvfjP5pcroLfbLNcgPe13jklxi8pTxHMD923r+HejMHuKZIBPl6T236JqXfdnh7CHD v/0lcldGhZxdUdxQ/fCJJ7m2E3kUnUHUsx9plT08= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 23156F80543; Mon, 20 Jun 2022 10:12:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 57AC5F80543; Mon, 20 Jun 2022 10:12:37 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E3036F804E7 for ; Mon, 20 Jun 2022 10:12:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E3036F804E7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PT0TZB71" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712748; x=1687248748; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IwFzZR/dDdOnz/WoMNQ45E381MBJMF1Mmf6b0pF1HWg=; b=PT0TZB71eY59h3aiMz/DxwHoHLKHRYsiGfMYPkGnTCTFv5ToJL5rLQJU Cpl60U7Rk6QBx7Uda4Rrce2kui5RPlcYU38571Z0+n5aUzWKb8GGptymV Sf8kgzX6s01bxcaQ7OPoi21fmqML2GpzK5aLDm2hxEAeavlgT/lz244cI rlvhGEUhl4xvajsRK6BwoMlYjj3pzJwU+yK4tpGuwZzHHsQT5zd1qcIw5 CxSEhFgimLUgwhfsmLMzi9RAHQkAl+auhy+20Q3dJpBkPjOpgznmnrcPZ uSVxCH9CBjpdhHdwaPI2WVgWEa3Dola+7G2yNIei2shSHSKnnXXxkH27b Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270875" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270875" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067373" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:23 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 04/17] ASoC: Intel: hsw_rt5640: Update code indentation Date: Mon, 20 Jun 2022 10:22:13 +0200 Message-Id: <20220620082226.2489357-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Make use of 100 character limit and modify indentation so code is easier to read. While at it, sort includes in alphabetical order. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/hsw_rt5640.c | 59 +++++++++-------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index a096453bf1df..da31b011b495 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -9,10 +9,9 @@ #include #include #include +#include #include #include -#include - #include "../../codecs/rt5640.h" /* Haswell ULT platforms have a Headphone and Mic jack */ @@ -22,7 +21,6 @@ static const struct snd_soc_dapm_widget card_widgets[] = { }; static const struct snd_soc_dapm_route card_routes[] = { - {"Headphones", NULL, "HPOR"}, {"Headphones", NULL, "HPOL"}, {"IN2P", NULL, "Mic"}, @@ -33,32 +31,28 @@ static const struct snd_soc_dapm_route card_routes[] = { }; static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_hw_params *params) + struct snd_pcm_hw_params *params) { - struct snd_interval *rate = hw_param_interval(params, - SNDRV_PCM_HW_PARAM_RATE); - struct snd_interval *channels = hw_param_interval(params, - SNDRV_PCM_HW_PARAM_CHANNELS); + struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); /* The ADSP will covert the FE rate to 48k, stereo */ rate->min = rate->max = 48000; channels->min = channels->max = 2; - /* set SSP0 to 16 bit */ params_set_format(params, SNDRV_PCM_FORMAT_S16_LE); + return 0; } static int codec_link_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) + struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); int ret; - ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_MCLK, 12288000, - SND_SOC_CLOCK_IN); - + ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_MCLK, 12288000, SND_SOC_CLOCK_IN); if (ret < 0) { dev_err(rtd->dev, "can't set codec sysclk configuration\n"); return ret; @@ -74,29 +68,15 @@ static const struct snd_soc_ops codec_link_ops = { .hw_params = codec_link_hw_params, }; -SND_SOC_DAILINK_DEF(dummy, - DAILINK_COMP_ARRAY(COMP_DUMMY())); - -SND_SOC_DAILINK_DEF(system, - DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); +SND_SOC_DAILINK_DEF(system, DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); +SND_SOC_DAILINK_DEF(offload0, DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin"))); +SND_SOC_DAILINK_DEF(offload1, DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin"))); +SND_SOC_DAILINK_DEF(loopback, DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin"))); -SND_SOC_DAILINK_DEF(offload0, - DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin"))); - -SND_SOC_DAILINK_DEF(offload1, - DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin"))); - -SND_SOC_DAILINK_DEF(loopback, - DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin"))); - -SND_SOC_DAILINK_DEF(codec, - DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT33CA:00", "rt5640-aif1"))); - -SND_SOC_DAILINK_DEF(platform, - DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio"))); - -SND_SOC_DAILINK_DEF(ssp0_port, - DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port"))); +SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY())); +SND_SOC_DAILINK_DEF(codec, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT33CA:00", "rt5640-aif1"))); +SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio"))); +SND_SOC_DAILINK_DEF(ssp0_port, DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port"))); static struct snd_soc_dai_link card_dai_links[] = { /* Front End DAI links */ @@ -137,15 +117,13 @@ static struct snd_soc_dai_link card_dai_links[] = { .dpcm_capture = 1, SND_SOC_DAILINK_REG(loopback, dummy, platform), }, - /* Back End DAI links */ { /* SSP0 - Codec */ .name = "Codec", .id = 0, .no_pcm = 1, - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBC_CFC, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC, .ignore_pmdown_time = 1, .be_hw_params_fixup = codec_link_hw_params_fixup, .ops = &codec_link_ops, @@ -174,11 +152,10 @@ static int hsw_rt5640_probe(struct platform_device *pdev) int ret; hsw_rt5640_card.dev = &pdev->dev; - /* override platform name, if required */ mach = pdev->dev.platform_data; - ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, - mach->mach_params.platform); + + ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, mach->mach_params.platform); if (ret) return ret; From patchwork Mon Jun 20 08:22:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8BDBC43334 for ; Mon, 20 Jun 2022 08:15:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 061721902; Mon, 20 Jun 2022 10:14:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 061721902 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712921; bh=aBOBlOyz852sglEqIR7/HbSbdqdNaRPyc8TMc0PuzuY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aqQJYpAbWjGCvNPsNGJ6aavkVjk0jDeI0TX/fT0reauRiSi9QbUNQUBU+1kIbJw9y 2pubUqL2wnrHSgntSwxSCrhDFwD4gx0/2dwAIokgFmfZhX7aKopt1MwRS5YaaxbhgF tA0hMLTjdtMOrpq2LnIKM/FAvsgBK/I6F7LNNwrY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D0299F80567; Mon, 20 Jun 2022 10:12:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 734D3F8052E; Mon, 20 Jun 2022 10:12:41 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8B027F8052E for ; Mon, 20 Jun 2022 10:12:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B027F8052E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KzrmD1w2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712751; x=1687248751; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aBOBlOyz852sglEqIR7/HbSbdqdNaRPyc8TMc0PuzuY=; b=KzrmD1w2hjLRkYKypspjj6xsyLMuIzwoZtKjoNUeqlBZ4bpCrGX+Ba9R 0TU21bv1eGqFhs5jDOjxn0WBEjjmyvCLz0XDvAbVopwzYYR4RgaWh66+K 9sXx+KNBmomWpbIK3z7tV9M/N1ZMpH9OtUuI82Rdl4INpoIKa6KiRdztp x49bJlZTz9o9inszOOaSN8F1ZzfaTxyFVIMGfR8b1JWxvJ+pbgaXSMxMV 5t11PBkzMBYPNvSrqi2J2ERrcT/N8/TnPsNc54RVH1vxA0TIfTLeCo9Cd /9B7W0ASJFh2dqqkFgaCoPhk9MvPmn3iUiz2E0IROdz+5tpF5ACJugURa g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270888" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270888" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067385" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:28 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 06/17] ASoC: Intel: hsw_rt5640: Improve probe() function quality Date: Mon, 20 Jun 2022 10:22:15 +0200 Message-Id: <20220620082226.2489357-7-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Declare local 'dev' and make use of it plus dev_get_platdata() to improve code readability. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/hsw_rt5640.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index f843ba5f4718..273c8e274d25 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -147,16 +147,17 @@ static struct snd_soc_card hsw_rt5640_card = { static int hsw_rt5640_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; + struct device *dev = &pdev->dev; int ret; - hsw_rt5640_card.dev = &pdev->dev; - mach = pdev->dev.platform_data; + hsw_rt5640_card.dev = dev; + mach = dev_get_platdata(dev); ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, mach->mach_params.platform); if (ret) return ret; - return devm_snd_soc_register_card(&pdev->dev, &hsw_rt5640_card); + return devm_snd_soc_register_card(dev, &hsw_rt5640_card); } static struct platform_driver hsw_rt5640_driver = { From patchwork Mon Jun 20 08:22:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71174C43334 for ; Mon, 20 Jun 2022 08:14:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B44DB187D; Mon, 20 Jun 2022 10:14:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B44DB187D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712896; bh=o0Kok7wGPSNdLmm0aDT4JNZdUbDgMsPnAiN9aOQ2AiM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=A1h0tmF7evau3PmzJL1M5NZuyj8TneDG+ymKD97MOuIdrEuhEjpI4zncoDcZQtwzG oGGtkb3qaJ1JYT9bnCzgDkhF5Gfwc7bn/CvHvjhJOnkbhntfIVsIS2ICHtvOZPquaq s71w/GWTl7Mzpwzuz12ck8kMTmafGA944OhK5WBM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9F636F80553; Mon, 20 Jun 2022 10:12:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91B9CF80557; Mon, 20 Jun 2022 10:12:40 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B8D87F80542 for ; Mon, 20 Jun 2022 10:12:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8D87F80542 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Llve7oz+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712755; x=1687248755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o0Kok7wGPSNdLmm0aDT4JNZdUbDgMsPnAiN9aOQ2AiM=; b=Llve7oz+dAMgXhqXSkyJH98MUZbOdSbG1IVM7M/4W9d5GXMY3jXFaYe6 F1Y4Ff5gSgW1NfE7WTQEKvCqdyLI5ILxVaLJxnohFEg1737mIYXsRZuws LVp1D9UCm9g39CKg3sg8p1uI+yjvdwv0JYZqbJMCXqC3i9y00OO5eEpqa lVALp+D0PUzDQylM2HSj3IDL+tevfTwjFFCX4WvTudD+m76DKJokg8rsq ma4WiAqHdxYs4IYxWDwRyIB1Ltr5YzCCpaceIqVDgnoM7bVgkLghpR8rH Mki5evzQxK4FuRXUPrd3ZLmJ3+84MweV68xWR9Xn7yz5JXFeIgswzfGZe A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270901" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270901" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067404" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:32 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 08/17] ASoC: Intel: Rename broadwell source file to bdw_rt286 Date: Mon, 20 Jun 2022 10:22:17 +0200 Message-Id: <20220620082226.2489357-9-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Rename source file to drop any ambiguity. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/Makefile | 2 +- sound/soc/intel/boards/{broadwell.c => bdw_rt286.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename sound/soc/intel/boards/{broadwell.c => bdw_rt286.c} (100%) diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index e479546a3d4b..eea1e26acfda 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -2,7 +2,7 @@ snd-soc-sst-haswell-objs := hsw_rt5640.o snd-soc-sst-bdw-rt5650-mach-objs := bdw-rt5650.o snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o -snd-soc-sst-broadwell-objs := broadwell.o +snd-soc-sst-broadwell-objs := bdw_rt286.o snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o snd-soc-sst-bxt-rt298-objs := bxt_rt298.o snd-soc-sst-sof-pcm512x-objs := sof_pcm512x.o diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/bdw_rt286.c similarity index 100% rename from sound/soc/intel/boards/broadwell.c rename to sound/soc/intel/boards/bdw_rt286.c From patchwork Mon Jun 20 08:22:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26BE8C43334 for ; Mon, 20 Jun 2022 08:15:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 656F818D1; Mon, 20 Jun 2022 10:15:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 656F818D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712952; bh=4y9ok9xQuFHnOyMzJ5GiR0iSYQysMulcNNRs5oaiviU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=psA9q0nXc2lcl1/Ivl9/Evi9U4myynJfFw7JAvRUSTU3iVWnLJ35HNxHe8uCh+4A/ ZqqRwAIXuiNJQoPffAVCrSZJBjUv1kYMBPIgPbwMqKENt5aaMjQjYOWu9gf0SXfbxT GfzG6ZIbsO/h6b8E8pYebeX/eJ3CHFqLZhlfwPf0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9BCFDF80558; Mon, 20 Jun 2022 10:12:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04767F804E5; Mon, 20 Jun 2022 10:12:43 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 161D2F804EB for ; Mon, 20 Jun 2022 10:12:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 161D2F804EB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KGQDm4Ds" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712758; x=1687248758; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4y9ok9xQuFHnOyMzJ5GiR0iSYQysMulcNNRs5oaiviU=; b=KGQDm4DsSzfac0VKk8M38nK7MjYtxPA6Rse8NGlEOdXTnfVS6Dh4hZ4a T+RfxbxaUMZtIObW6JpsOMm6Y+qc5NAEx8bz7/t1AhpQI3Oc3MtojKDzY uRC6T5D4KgdTrWaxWi++jE34xH408fA68ercW4Rb0lXWHtNigTJxSgI83 6whmAHwZs9l+Kq1fW4uVLyhUOg9h9Onmnecu/nzo5g8YNcypWT066CR+f q/bFonswEoqitWlUQ1E8li55BWWX6ZKEkGSqYH4npRsVaSSUzCe7MKdGk WcqUHOWPRvnxYRbZBhPpqiXIy/NhFAIpjTQhYw7Fo4OY0JjIW8Ld1u1el g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270906" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270906" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067411" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:33 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 09/17] ASoC: Intel: bdw_rt286: Reword prefixes of all driver members Date: Mon, 20 Jun 2022 10:22:18 +0200 Message-Id: <20220620082226.2489357-10-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Replace ambiguous 'broadwell_rt286_' prefixes in favour of 'card_', 'link_' and other similar strings to clearly state which object given member implements behavior for. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 102 ++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 19977f7e8f20..a5a425f6d95c 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -16,9 +16,9 @@ #include "../../codecs/rt286.h" -static struct snd_soc_jack broadwell_headset; +static struct snd_soc_jack card_headset; /* Headset jack detection DAPM pins */ -static struct snd_soc_jack_pin broadwell_headset_pins[] = { +static struct snd_soc_jack_pin card_headset_pins[] = { { .pin = "Mic Jack", .mask = SND_JACK_MICROPHONE, @@ -29,12 +29,12 @@ static struct snd_soc_jack_pin broadwell_headset_pins[] = { }, }; -static const struct snd_kcontrol_new broadwell_controls[] = { +static const struct snd_kcontrol_new card_controls[] = { SOC_DAPM_PIN_SWITCH("Speaker"), SOC_DAPM_PIN_SWITCH("Headphone Jack"), }; -static const struct snd_soc_dapm_widget broadwell_widgets[] = { +static const struct snd_soc_dapm_widget card_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_SPK("Speaker", NULL), SND_SOC_DAPM_MIC("Mic Jack", NULL), @@ -43,7 +43,7 @@ static const struct snd_soc_dapm_widget broadwell_widgets[] = { SND_SOC_DAPM_LINE("Line Jack", NULL), }; -static const struct snd_soc_dapm_route broadwell_rt286_map[] = { +static const struct snd_soc_dapm_route card_routes[] = { /* speaker */ {"Speaker", NULL, "SPOR"}, @@ -65,22 +65,22 @@ static const struct snd_soc_dapm_route broadwell_rt286_map[] = { {"AIF1 Playback", NULL, "SSP0 CODEC OUT"}, }; -static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd) +static int codec_link_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; int ret = 0; ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", - SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset, - broadwell_headset_pins, ARRAY_SIZE(broadwell_headset_pins)); + SND_JACK_HEADSET | SND_JACK_BTN_0, &card_headset, + card_headset_pins, ARRAY_SIZE(card_headset_pins)); if (ret) return ret; - snd_soc_component_set_jack(component, &broadwell_headset, NULL); + snd_soc_component_set_jack(component, &card_headset, NULL); return 0; } -static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, +static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *rate = hw_param_interval(params, @@ -97,7 +97,7 @@ static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } -static int broadwell_rt286_hw_params(struct snd_pcm_substream *substream, +static int codec_link_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); @@ -115,8 +115,8 @@ static int broadwell_rt286_hw_params(struct snd_pcm_substream *substream, return ret; } -static const struct snd_soc_ops broadwell_rt286_ops = { - .hw_params = broadwell_rt286_hw_params, +static const struct snd_soc_ops codec_link_ops = { + .hw_params = codec_link_hw_params, }; static const unsigned int channels[] = { @@ -129,7 +129,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = { .mask = 0, }; -static int broadwell_fe_startup(struct snd_pcm_substream *substream) +static int bdw_rt286_fe_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -140,8 +140,8 @@ static int broadwell_fe_startup(struct snd_pcm_substream *substream) &constraints_channels); } -static const struct snd_soc_ops broadwell_fe_ops = { - .startup = broadwell_fe_startup, +static const struct snd_soc_ops bdw_rt286_fe_ops = { + .startup = bdw_rt286_fe_startup, }; SND_SOC_DAILINK_DEF(system, @@ -169,7 +169,7 @@ SND_SOC_DAILINK_DEF(ssp0_port, DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port"))); /* broadwell digital audio interface glue - connects codec <--> CPU */ -static struct snd_soc_dai_link broadwell_rt286_dais[] = { +static struct snd_soc_dai_link card_dai_links[] = { /* Front End DAI links */ { .name = "System PCM", @@ -177,7 +177,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { .nonatomic = 1, .dynamic = 1, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, - .ops = &broadwell_fe_ops, + .ops = &bdw_rt286_fe_ops, .dpcm_playback = 1, .dpcm_capture = 1, SND_SOC_DAILINK_REG(system, dummy, platform), @@ -215,19 +215,19 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { .name = "Codec", .id = 0, .no_pcm = 1, - .init = broadwell_rt286_codec_init, + .init = codec_link_init, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC, .ignore_pmdown_time = 1, - .be_hw_params_fixup = broadwell_ssp0_fixup, - .ops = &broadwell_rt286_ops, + .be_hw_params_fixup = codec_link_hw_params_fixup, + .ops = &codec_link_ops, .dpcm_playback = 1, .dpcm_capture = 1, SND_SOC_DAILINK_REG(ssp0_port, codec, platform), }, }; -static int broadwell_disable_jack(struct snd_soc_card *card) +static int bdw_rt286_disable_jack(struct snd_soc_card *card) { struct snd_soc_component *component; @@ -243,19 +243,19 @@ static int broadwell_disable_jack(struct snd_soc_card *card) return 0; } -static int broadwell_suspend(struct snd_soc_card *card) +static int bdw_rt286_suspend(struct snd_soc_card *card) { - return broadwell_disable_jack(card); + return bdw_rt286_disable_jack(card); } -static int broadwell_resume(struct snd_soc_card *card){ +static int bdw_rt286_resume(struct snd_soc_card *card){ struct snd_soc_component *component; for_each_card_components(card, component) { if (!strcmp(component->name, "i2c-INT343A:00")) { dev_dbg(component->dev, "enabling jack detect for resume.\n"); - snd_soc_component_set_jack(component, &broadwell_headset, NULL); + snd_soc_component_set_jack(component, &bdw_rt286_headset, NULL); break; } } @@ -270,64 +270,64 @@ static int broadwell_resume(struct snd_soc_card *card){ #define DRIVER_NAME NULL /* card name will be used for driver name */ /* broadwell audio machine driver for WPT + RT286S */ -static struct snd_soc_card broadwell_rt286 = { +static struct snd_soc_card bdw_rt286_card = { .owner = THIS_MODULE, - .dai_link = broadwell_rt286_dais, - .num_links = ARRAY_SIZE(broadwell_rt286_dais), - .controls = broadwell_controls, - .num_controls = ARRAY_SIZE(broadwell_controls), - .dapm_widgets = broadwell_widgets, - .num_dapm_widgets = ARRAY_SIZE(broadwell_widgets), - .dapm_routes = broadwell_rt286_map, - .num_dapm_routes = ARRAY_SIZE(broadwell_rt286_map), + .dai_link = card_dai_links, + .num_links = ARRAY_SIZE(card_dai_links), + .controls = card_controls, + .num_controls = ARRAY_SIZE(card_controls), + .dapm_widgets = card_widgets, + .num_dapm_widgets = ARRAY_SIZE(card_widgets), + .dapm_routes = card_routes, + .num_dapm_routes = ARRAY_SIZE(card_routes), .fully_routed = true, - .suspend_pre = broadwell_suspend, - .resume_post = broadwell_resume, + .suspend_pre = bdw_rt286_suspend, + .resume_post = bdw_rt286_resume, }; -static int broadwell_audio_probe(struct platform_device *pdev) +static int bdw_rt286_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; int ret; - broadwell_rt286.dev = &pdev->dev; + bdw_rt286_card.dev = &pdev->dev; /* override platform name, if required */ mach = pdev->dev.platform_data; - ret = snd_soc_fixup_dai_links_platform_name(&broadwell_rt286, + ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card, mach->mach_params.platform); if (ret) return ret; /* set card and driver name */ if (snd_soc_acpi_sof_parent(&pdev->dev)) { - broadwell_rt286.name = SOF_CARD_NAME; - broadwell_rt286.driver_name = SOF_DRIVER_NAME; + bdw_rt286_card.name = SOF_CARD_NAME; + bdw_rt286_card.driver_name = SOF_DRIVER_NAME; } else { - broadwell_rt286.name = CARD_NAME; - broadwell_rt286.driver_name = DRIVER_NAME; + bdw_rt286_card.name = CARD_NAME; + bdw_rt286_card.driver_name = DRIVER_NAME; } - return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286); + return devm_snd_soc_register_card(&pdev->dev, &bdw_rt286_card); } -static int broadwell_audio_remove(struct platform_device *pdev) +static int bdw_rt286_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); - return broadwell_disable_jack(card); + return bdw_rt286_disable_jack(card); } -static struct platform_driver broadwell_audio = { - .probe = broadwell_audio_probe, - .remove = broadwell_audio_remove, +static struct platform_driver bdw_rt286_driver = { + .probe = bdw_rt286_probe, + .remove = bdw_rt286_remove, .driver = { .name = "broadwell-audio", .pm = &snd_soc_pm_ops }, }; -module_platform_driver(broadwell_audio) +module_platform_driver(bdw_rt286_driver) /* Module information */ MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); From patchwork Mon Jun 20 08:22:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5316C43334 for ; Mon, 20 Jun 2022 08:16:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 11FE918D8; Mon, 20 Jun 2022 10:15:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 11FE918D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655712984; bh=X4L5HxgvJhKjA8csEVWyCP3QlR1qaLDSS0PxrRvBsuI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aGtVjX5w32g4lSO10LhQJrx/jlNCunabI7MkyWgXbmtr3ens9aX03ApE4T3IahKUZ c8qcFuRds70fv4ol92z6U6Lcjl65fz37yImoyopnh4y8X6GnHIHbn1wKI3+fCyUsbR jS3pPzLUdR1CXXy3Ycotxr5LZK0O8BaZSuIHYdu8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5FC8EF8058C; Mon, 20 Jun 2022 10:12:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CCCFEF80566; Mon, 20 Jun 2022 10:12:46 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5A5B4F80548 for ; Mon, 20 Jun 2022 10:12:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5A5B4F80548 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MX1EdnYL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712759; x=1687248759; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X4L5HxgvJhKjA8csEVWyCP3QlR1qaLDSS0PxrRvBsuI=; b=MX1EdnYLKBhhjWyl0fsVP4drdlGeN62ui6NDrHRaAoQlPQhzhebk0dnw ljda/CIs7fSiWJ9IpsMFcSZrhzn6O3EsqlosY+qDAmIyTQ3ilSKGyK8MY hpYIIyAl+joblSNhio5BUolQFjpYnZN65TjHCyd7Z1WKtjnZbplKX8ED6 aTHWe7fH4bQHfB/kjI+8m23KyvCO1RM5IwzpkUd9FR0CsCErXtGBQuCIb loGWgaEYW/ulNT7KZdvK2LbGreX6rnkcVzGgF+EBsMe+S6VCB5sQkhVyo nrHQrWhnhoFvoWEjQnNieEcyQ9T+oqfPxf7Q5vmln9g7YxK4fNrZR4ate w==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270913" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270913" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067418" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:36 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 10/17] ASoC: Intel: bdw_rt286: Reword driver name Date: Mon, 20 Jun 2022 10:22:19 +0200 Message-Id: <20220620082226.2489357-11-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Align with other Intel boards naming convention and let the name explicitly state which components are being connected. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 4 ++-- sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index a5a425f6d95c..03cc50cb3c31 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -322,7 +322,7 @@ static struct platform_driver bdw_rt286_driver = { .probe = bdw_rt286_probe, .remove = bdw_rt286_remove, .driver = { - .name = "broadwell-audio", + .name = "bdw_rt286", .pm = &snd_soc_pm_ops }, }; @@ -333,4 +333,4 @@ module_platform_driver(bdw_rt286_driver) MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); MODULE_DESCRIPTION("Intel SST Audio for WPT/Broadwell"); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:broadwell-audio"); +MODULE_ALIAS("platform:bdw_rt286"); diff --git a/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c b/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c index 4e00f8f6c521..cbcb649604e5 100644 --- a/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c @@ -23,7 +23,7 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_haswell_machines); struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[] = { { .id = "INT343A", - .drv_name = "broadwell-audio", + .drv_name = "bdw_rt286", .fw_filename = "intel/IntcSST2.bin", .sof_tplg_filename = "sof-bdw-rt286.tplg", }, From patchwork Mon Jun 20 08:22:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD335C433EF for ; Mon, 20 Jun 2022 08:16:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EC45118C9; Mon, 20 Jun 2022 10:16:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EC45118C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655713015; bh=pAoRV9qZAV0vIHCKPW5NwP8uZjCziWDwJzbXGyXGaQk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XgfuH5OMhTyCE7OOPV+miSMTd12Gc9I+mpXafjDBHxkn53H/Mgre63lDOEdOVR99w cYvYSIdCaricLE78leqWa0bBy0mONhgys4Ubi/7CNSicsmkCXZ4fpMHH7dkFhvyDTG 6pY7AZDxJ8R1sQfi96RBBeqy/yTSxlBSfyK6aBx0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0B599F80571; Mon, 20 Jun 2022 10:12:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7EAF4F8057D; Mon, 20 Jun 2022 10:12:49 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 571FBF80566 for ; Mon, 20 Jun 2022 10:12:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 571FBF80566 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="msQ7GVo8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712767; x=1687248767; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pAoRV9qZAV0vIHCKPW5NwP8uZjCziWDwJzbXGyXGaQk=; b=msQ7GVo8xsO8LpTHQI32V/7qPFmgJ/xq4YQ2Kb2ee/JinfiOe+6W3HAV 2FAD32Ku9c5jwx2nqft+GqarpeRG6fJ1ziCwRO7/MMg4xTN1L1UVvp8O/ ufrAqffpc0TlhpVOV8vGF5BO5yNSL0QqxVW6LAHD7NNEDhU5Pzwd2OCx9 f4bZOGIs0HGpIdNDnUNarSzJy5OPCfNWTowR9c3waoNITUvKOZBi7v36z XsL5mZGqXLzBhYKoX0ZtR61W6piPTywVqsUZXQr5VB62X4sDmHXzbAr3a gIBDX9YHp+HlC+lY/BQN2j90qk5Kh7Mld5xx0Tw0rLmVinrgqr8XbMgqK g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270942" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270942" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067451" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:44 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 14/17] ASoC: Intel: bdw_rt286: Improve hw_params() debug-ability Date: Mon, 20 Jun 2022 10:22:23 +0200 Message-Id: <20220620082226.2489357-15-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Print status if setting sysclk fails. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 8624e52b4def..16bddf4c6dcd 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -98,7 +98,7 @@ static int codec_link_hw_params(struct snd_pcm_substream *substream, ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000, SND_SOC_CLOCK_IN); if (ret < 0) { - dev_err(rtd->dev, "can't set codec sysclk configuration\n"); + dev_err(rtd->dev, "set codec sysclk failed: %d\n", ret); return ret; } From patchwork Mon Jun 20 08:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583294 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DE24C433EF for ; Mon, 20 Jun 2022 08:17:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B463A18E5; Mon, 20 Jun 2022 10:16:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B463A18E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655713049; bh=vADdhna7FQFqstMcXpeMKuGDfa4BtI+bMMrDxM47pLY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iEAe9Q4YjUuFVTiMDhMKmpQW48cm6sApOhUH/SflGh5ecE5jiDjeaycz8reYeRACK gnQ+GCE4D41p/oyKD/9XammUNuosS9R8pJzFWJ/tNrTcBPDerAeE0Sz2/r6+3AIL5Y KWoaChI6d2gl2xBrnbX2L1NaA2CqlNO+jxaLlAMY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5CFDBF805B6; Mon, 20 Jun 2022 10:12:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1DE95F8052E; Mon, 20 Jun 2022 10:12:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 253A7F8057A for ; Mon, 20 Jun 2022 10:12:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 253A7F8057A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HLXiwrQq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712769; x=1687248769; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vADdhna7FQFqstMcXpeMKuGDfa4BtI+bMMrDxM47pLY=; b=HLXiwrQqJ9sbQRTR2IiJvvynXnXk/OXi1R0HQZ4YMebIqaaPv5WsLpSX 8KRfSErsa2YcDA60CMRwEWCcP9AI3mCFTuGR/sPmCAzPC5wm7YYaIYj2W Ahv+jq3J/7V1PA74v2duq4GPFcuCKqZJz2OMcSWur9NyokJmJLMK+PMHt 96opy/XNwdg8nxP7rFmn2Rrl2VgqCrB2ibRDgmgSBtzIuPHl832Wj17pU 0ntCl802vuknhHban3WhpYjlnlER/5xkK29Qv1LYMFB9ApmPyDyRHzTWt L9KfZwx6H9SLJvN/LWNeNCyuFuBsLBdu/F3hM8XDSWQ6u0IOv3fzoCQz9 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270953" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270953" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067462" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:46 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 15/17] ASoC: Intel: bdw_rt286: Improve codec_init() quality Date: Mon, 20 Jun 2022 10:22:24 +0200 Message-Id: <20220620082226.2489357-16-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Drop redundant 'ret' assignemnt, stop ignoring set_jack() return value and reword local 'component' variable to 'codec' to improve readability. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 16bddf4c6dcd..091b8194fdcb 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -61,8 +61,8 @@ static const struct snd_soc_dapm_route card_routes[] = { static int codec_link_init(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; - int ret = 0; + struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; + int ret; ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, &card_headset, card_headset_pins, @@ -70,8 +70,7 @@ static int codec_link_init(struct snd_soc_pcm_runtime *rtd) if (ret) return ret; - snd_soc_component_set_jack(component, &card_headset, NULL); - return 0; + return snd_soc_component_set_jack(codec, &card_headset, NULL); } static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, From patchwork Mon Jun 20 08:22:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 583293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC9F0C43334 for ; Mon, 20 Jun 2022 08:18:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1124618E2; Mon, 20 Jun 2022 10:17:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1124618E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655713087; bh=O4SwyI2G/dNCqyMJTE1m8IbY8RbyRbpnChN1eMMr6xc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qtFH3IQLqiRTx9XT5uOKFvrdHZ2RLVMiMBSwXAQ+AhAG00CR/G/pakd/UJKps2s/w U2Y//B2RKR8uM1dFxOMDC/MYy1yFKSqFXqfqOqDR5N7XA5XW5uOS0FAyhLeAm9ntFV LwCvkvBdlKtXz1rVCd/f7977f9CebPRe7XquMuHk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9FFDAF805C9; Mon, 20 Jun 2022 10:13:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2435BF805B2; Mon, 20 Jun 2022 10:12:56 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 47A14F8057D for ; Mon, 20 Jun 2022 10:12:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 47A14F8057D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TKFPm2CP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655712773; x=1687248773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O4SwyI2G/dNCqyMJTE1m8IbY8RbyRbpnChN1eMMr6xc=; b=TKFPm2CPi5SmvqX8xrlSBUQtCDoR6mrYfYUXxY8x9+e4gk7yQICjKaxA W1M7bzEE8XNQ7qauDuUdHo7gOxgtoLZYCOo06mi/pyLIq54H/x/J5UYjX 0rQXWmp7cr11bB+oGnhWWBCMLU0TQ55hbZ4h5XW6tBn3wSEGB28oEZXWx VthpNGWQMkkbAid2wz3kA1ZMEZGukUr5nZcEOdTVcRB7jICThHcOgZI68 NQU/NjnWFpT2YbIG+D8C+0UE0yWj5fCl07sdoUkPYR731oFJE9PQdZOJz yn1FAkwPo3OCQoTeHizj0twgHx3Yi5eflcQOTv/cMk0gDuGmxbRk37q7J A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305270963" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305270963" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 01:12:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="591067491" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jun 2022 01:12:50 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v3 17/17] ASoC: Intel: bdw_rt286: Remove FE DAI ops Date: Mon, 20 Jun 2022 10:22:26 +0200 Message-Id: <20220620082226.2489357-18-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620082226.2489357-1-cezary.rojewski@intel.com> References: <20220620082226.2489357-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" bdw_rt286_fe_ops is redundant as platform components already limit the number of channels available for the endpoint. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 622f2424ca59..2317a0bb136a 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -115,30 +115,6 @@ static const struct snd_soc_ops codec_link_ops = { .hw_params = codec_link_hw_params, }; -static const unsigned int channels[] = { - 2, -}; - -static const struct snd_pcm_hw_constraint_list constraints_channels = { - .count = ARRAY_SIZE(channels), - .list = channels, - .mask = 0, -}; - -static int bdw_rt286_fe_startup(struct snd_pcm_substream *substream) -{ - struct snd_pcm_runtime *runtime = substream->runtime; - - /* Board supports stereo configuration only */ - runtime->hw.channels_max = 2; - return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, - &constraints_channels); -} - -static const struct snd_soc_ops bdw_rt286_fe_ops = { - .startup = bdw_rt286_fe_startup, -}; - SND_SOC_DAILINK_DEF(system, DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); SND_SOC_DAILINK_DEF(offload0, DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin"))); SND_SOC_DAILINK_DEF(offload1, DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin"))); @@ -157,7 +133,6 @@ static struct snd_soc_dai_link card_dai_links[] = { .nonatomic = 1, .dynamic = 1, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, - .ops = &bdw_rt286_fe_ops, .dpcm_playback = 1, .dpcm_capture = 1, SND_SOC_DAILINK_REG(system, dummy, platform),