From patchwork Fri Jun 10 12:36: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: 12877552 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 3FF4AC433EF for ; Fri, 10 Jun 2022 12:27:16 +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 73E251B06; Fri, 10 Jun 2022 14:26:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 73E251B06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864034; bh=6VvB/TlWpsJQa652pZrSZHJbablnDYdsutOy9NV5/cQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XaMjuIstv1uXlync5dniqMtLQrzGlcLod6Yzp1tEB7bn2seavqHE7RzoM5YhKNqVt 4iS38wVyUiZyiB0cX69ID2feQH3Oci0NAUEzsK9kREWAd5ZmHanuv5Xds2pse/lD/w gOkWt1CaJtKB7ipaUt4ZuXONgHDQYQ17YhgTWBOs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C7265F8052F; Fri, 10 Jun 2022 14:26:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 25316F800E5; Fri, 10 Jun 2022 14:26:22 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 3F4F0F800E5 for ; Fri, 10 Jun 2022 14:26:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3F4F0F800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OOagvMXY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863976; x=1686399976; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6VvB/TlWpsJQa652pZrSZHJbablnDYdsutOy9NV5/cQ=; b=OOagvMXYHHp7k2NnhLldtkHoQRuYDgXC+N/L05buNG55pdIr9bZvpQuS j1o/e3kez8cvTCCb5VgpEIA///WWA7NjE+VKuy4asuLM10Bp5pwnFKEOZ QhbDMgsxpfQKh4jIPVaJPKzFktsyltFWa9rBOyFxZokHZ8Z5586GKCjmX ieRTMdJg3K7PLupiQbnKCXChtc52fxhDXlBGRkSeTOhfltedrO5hPt+fh 4kOrKeHBhRVfV/HhZbi0kk3lGppCdkl3ETqn263R4yNyOaivK8qMIyAbk Q9hfYRLQonbeV8oAXZnGjYsOpQCtus6F1DYppFWEIL8V6atz2LqoE6Kx+ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414319" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414319" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517824" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:08 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 01/17] ASoC: Intel: Rename haswell source file to hsw_rt5640 Date: Fri, 10 Jun 2022 14:36:11 +0200 Message-Id: <20220610123627.1339985-2-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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/{haswell.c => hsw_rt5640.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename sound/soc/intel/boards/{haswell.c => hsw_rt5640.c} (100%) diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 40c0c3d1c500..e479546a3d4b 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -snd-soc-sst-haswell-objs := haswell.o +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 diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/hsw_rt5640.c similarity index 100% rename from sound/soc/intel/boards/haswell.c rename to sound/soc/intel/boards/hsw_rt5640.c From patchwork Fri Jun 10 12:36:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877560 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 4E5E2C433EF for ; Fri, 10 Jun 2022 12:28:29 +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 8F1F21AFA; Fri, 10 Jun 2022 14:27:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8F1F21AFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864107; bh=MimaEjhfOFMoaFaUoxenQwVquI+Sqlngom9jUe3PD1I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=povX/BwclrK/BHeUDQrQPm6NJLDtk+lEz9wnS+cln7ReAgVvxvx51WrBubycX6NlZ uh2xnSEFmzQzYEkGvdOoUVkFGxWOLMp0GMv0Hc1ZnFYhCMl6dY0vQUN9SEiATlwd+r DkrwPZbTeFzOnCRqWcBHgZHZJ3qvMRy+aLaW4wtA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3C591F8053E; Fri, 10 Jun 2022 14:26:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E8240F80527; Fri, 10 Jun 2022 14:26:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 75F88F804DA for ; Fri, 10 Jun 2022 14:26:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 75F88F804DA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PHKmOjFN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863980; x=1686399980; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MimaEjhfOFMoaFaUoxenQwVquI+Sqlngom9jUe3PD1I=; b=PHKmOjFNxKn+dnjIgaVvpz6zhVsKFEWSUsFLj3z8uMIRd71ch+oeVhEP N4/duZ0UOcOpojhk4u4ftiFRGcCjaJUsNLznAxsImkj1xt0tteRKXyZ5r YybxTGQpRbSmcXoaH4C8bcUnPv6pNNB7TmOYybxl7z/1QXqdr538//Jie aK+IjCvN+P0NOxuNWMRRoorTecUylB+V3U66HmaJe23matXRvrzrXfGsz 0f2S8HyYCuuA8FgqfummwENfxbujBOpL752WDstNBNixOjcrqYoAKJ/Uq O+IPU4VIxUvhinsbsBhWa+3uPsV/dXZ0125N0KxXZjsinmkzv5CrcnGKo g==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414331" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414331" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517836" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:10 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 02/17] ASoC: Intel: hsw_rt5640: Reword prefixes of all driver members Date: Fri, 10 Jun 2022 14:36:12 +0200 Message-Id: <20220610123627.1339985-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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/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 Fri Jun 10 12:36: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: 12877553 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 C4752C433EF for ; Fri, 10 Jun 2022 12:27:18 +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 0F3451B24; Fri, 10 Jun 2022 14:26:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0F3451B24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864037; bh=6JtxhdVF68FxjUQnyy4IHfIL6UuGS31kUjgIV/EBCks=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NB6oXzkkIYxam45ETmkPfFPkdjef5twck/eQwONOmuL+V7XoejuVBPqndll/WMzM1 weti9p49xunKHWsjyoTnJwHXcI9JcLWEenY6SyifSA1/txLO5YO3oNqh11vcPAwJUl aB7pmEQPe3hakFzxmbbMHzPHkI9j17JYQhNUzvBk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9FEDCF80534; Fri, 10 Jun 2022 14:26:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2D8E7F80535; Fri, 10 Jun 2022 14:26:24 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 1DEDDF804D2 for ; Fri, 10 Jun 2022 14:26:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1DEDDF804D2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Eaz1mBiP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863978; x=1686399978; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6JtxhdVF68FxjUQnyy4IHfIL6UuGS31kUjgIV/EBCks=; b=Eaz1mBiPtkl44kO04mRKW7o7VnURbffewb0jABHL5tnyTlIJmFIelZeP zF8n4AAgSNQ1eBo2R/GWir/VVYbv8zlgfZlONcr+Aa4SMr3IVot/2vmjk zc8LLBJLKQNV03lHQWE2ZWJ8OlT8soV9MtvHh7BiX3fU0S7I5AKr5F53p 3BbQ7Szm2xLo9sNA4YRDlN75+dFamEuLNHo+MhRu7xiZTYQHQpIKUoSsF l+fkH4yTA4LCJ99JalFh8PGnOQ70IosWFDQi5HBcYNE4QGjH5l0uFiwCC mkFNW3Qr9sBMciBz5Oq0qtj/wIcGHRmALV50pgQ5gzdTrTpHnAH9xDLvb Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414347" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414347" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517845" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:12 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 03/17] ASoC: Intel: hsw_rt5640: Reword driver name Date: Fri, 10 Jun 2022 14:36:13 +0200 Message-Id: <20220610123627.1339985-4-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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/hsw_rt5640.c | 4 ++-- sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index b51ce8d0ca22..a096453bf1df 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -188,7 +188,7 @@ static int hsw_rt5640_probe(struct platform_device *pdev) static struct platform_driver hsw_rt5640_driver = { .probe = hsw_rt5640_probe, .driver = { - .name = "haswell-audio", + .name = "hsw_rt5640", .pm = &snd_soc_pm_ops, }, }; @@ -199,4 +199,4 @@ module_platform_driver(hsw_rt5640_driver) MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); MODULE_DESCRIPTION("Intel SST Audio for Haswell Lynxpoint"); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:haswell-audio"); +MODULE_ALIAS("platform:hsw_rt5640"); 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 0441df97b260..4e00f8f6c521 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 @@ -12,7 +12,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[] = { { .id = "INT33CA", - .drv_name = "haswell-audio", + .drv_name = "hsw_rt5640", .fw_filename = "intel/IntcSST1.bin", .sof_tplg_filename = "sof-hsw.tplg", }, @@ -41,7 +41,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[] = { }, { .id = "INT33CA", - .drv_name = "haswell-audio", + .drv_name = "hsw_rt5640", .fw_filename = "intel/IntcSST2.bin", .sof_tplg_filename = "sof-bdw-rt5640.tplg", }, From patchwork Fri Jun 10 12:36:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877561 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 341A2C433EF for ; Fri, 10 Jun 2022 12:28:48 +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 714DD1DE8; Fri, 10 Jun 2022 14:27:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 714DD1DE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864126; bh=3tPMe99bTOkQE9DysdgkDAUkjYxsM7CWAZAt8mQ7eFg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W+T5+dShpqdSW0rHSDkCgV3kssk84xPixcbOacHgAb6k/dOsbCqZDU582CXgsrgQn YQpNxbbtIPENPQi+/Hmkk+pcyOowbuHU3t3JUo19OP7dgN45LR4YY6ReeuL08MS/0t sxQ9euu15/Nx2AyQ5YnVDVfLDu3SMIkgzQbr4dc4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 74522F800E5; Fri, 10 Jun 2022 14:26:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 044FEF804D8; Fri, 10 Jun 2022 14:26:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 80D57F80527 for ; Fri, 10 Jun 2022 14:26:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80D57F80527 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Q5lHa4Th" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863978; x=1686399978; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3tPMe99bTOkQE9DysdgkDAUkjYxsM7CWAZAt8mQ7eFg=; b=Q5lHa4ThQsJdmL4xtVuspxCHP0xUj5AyvzLJULDeArzgBFZ20lMur1ex 489u/BbuV5ymt4jRKizSmvttheL3KCBxY+gCU1FebeEMOTyHdbI3jjhyj R+gJ0L7JhMKIKZc4mU7akovevbWxcWyfokGovSUofi/Stvfhxw6LYr+sE BBjhfLqkxM43+7Wgh6RvmVizYzPOBkc4u8IfgBRYrzxqmQJpXtbltb8Rs c5zY/+NiOdlBs14rdwpsBN7KUW2/WgDFHZVy7/eD4GxjQppOpHxyMpKof 0k+PCxqCVRGey90SxKtrzKF3cZ+oP98b9WW70vn22JmR7lyn727hP696r A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414356" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414356" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517854" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:13 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 04/17] ASoC: Intel: hsw_rt5640: Update code indentation Date: Fri, 10 Jun 2022 14:36:14 +0200 Message-Id: <20220610123627.1339985-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 | 67 ++++++++++------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index a096453bf1df..69be5086b98d 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 */ @@ -105,7 +85,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "System Playback/Capture", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_playback = 1, .dpcm_capture = 1, SND_SOC_DAILINK_REG(system, dummy, platform), @@ -115,7 +95,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Offload0 Playback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_playback = 1, SND_SOC_DAILINK_REG(offload0, dummy, platform), }, @@ -124,7 +104,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Offload1 Playback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_playback = 1, SND_SOC_DAILINK_REG(offload1, dummy, platform), }, @@ -133,19 +113,17 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Loopback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .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 Fri Jun 10 12:36: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: 12877555 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 E74C6C433EF for ; Fri, 10 Jun 2022 12:28:00 +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 2FE821B40; Fri, 10 Jun 2022 14:27:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2FE821B40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864079; bh=ASwBtb78kA/ZxwM96te3oAsVro2Po6ndmsMI8j4Kb+c=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BBRtWmj0NY7qiNumB3fF/EKdmrLty7o7HFoQZd4rA1oogjYC0CbZR3Yjw10gHduJB uHUHLv4IZ92MMZVEdj21OUWTTg5urcvB+WW36oGiKJO40pTbVu0+aj/k4bH+iitBZm vUlQ635ODnu+P6EOGPGRGlxOoju33R5DA4rhnNmw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A69C8F80536; Fri, 10 Jun 2022 14:26:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAB27F80535; Fri, 10 Jun 2022 14:26:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 379CDF80520 for ; Fri, 10 Jun 2022 14:26:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 379CDF80520 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dW8uBmtd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863980; x=1686399980; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ASwBtb78kA/ZxwM96te3oAsVro2Po6ndmsMI8j4Kb+c=; b=dW8uBmtde7+on45zwPR6hzO37hscbZfF8nZpMhxLW6FOsdpjkhY2bCvb vRsVAl4+0kg+cN3i3qgOv82Etq0oeYTpP0tf5wPjBshh9RXjXPcJV54fQ Eitvrp0uo94AKWBIM/Hz5sJq/vITx6Ek9Uay9Xc83TGBAX+ewCmL1MWVc l/3Cr5aFdiuXFRLc3aaTbqU4y/oF9cDUvE2OyVR+2E00optrHK4zHN1Si WRxfsxM6hhDy4bh8wI+KavrxA+RJ5BLl7Ec1l1KkTLi2m0p0UQ0mwffQQ clJcE/774DNf9hWbhhREEg+7Qoe0MsnaLeUuzThTEkKkumIHs9Mp/clja A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414369" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414369" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517865" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:16 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 05/17] ASoC: Intel: hsw_rt5640: Update file comments Date: Fri, 10 Jun 2022 14:36:15 +0200 Message-Id: <20220610123627.1339985-6-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 and update valuable comments within the file to increase readability. This patch also revisits module information and kconfig help strings. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/Kconfig | 2 +- sound/soc/intel/boards/hsw_rt5640.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 4b4c1e1e4808..817b4c04bf6a 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -41,7 +41,7 @@ config SND_SOC_INTEL_SOF_CIRRUS_COMMON if SND_SOC_INTEL_CATPT config SND_SOC_INTEL_HASWELL_MACH - tristate "Haswell Lynxpoint" + tristate "Haswell with RT5640 I2S codec" depends on I2C depends on I2C_DESIGNWARE_PLATFORM || COMPILE_TEST depends on X86_INTEL_LPSS || COMPILE_TEST diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index 69be5086b98d..0cd788a73694 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Intel Haswell Lynxpoint SST Audio + * Sound card driver for Intel Haswell Lynx Point with Realtek 5640 * * Copyright (C) 2013, Intel Corporation. All rights reserved. */ @@ -14,7 +14,6 @@ #include #include "../../codecs/rt5640.h" -/* Haswell ULT platforms have a Headphone and Mic jack */ static const struct snd_soc_dapm_widget card_widgets[] = { SND_SOC_DAPM_HP("Headphones", NULL), SND_SOC_DAPM_MIC("Mic", NULL), @@ -36,10 +35,10 @@ static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, 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 */ + /* The ADSP will convert the FE rate to 48k, stereo. */ rate->min = rate->max = 48000; channels->min = channels->max = 2; - /* set SSP0 to 16 bit */ + /* Set SSP0 to 16 bit. */ params_set_format(params, SNDRV_PCM_FORMAT_S16_LE); return 0; @@ -58,7 +57,7 @@ static int codec_link_hw_params(struct snd_pcm_substream *substream, return ret; } - /* set correct codec filter for DAI format and clock config */ + /* Set correct codec filter for DAI format and clock config. */ snd_soc_component_update_bits(codec_dai->component, 0x83, 0xffff, 0x8000); return ret; @@ -133,7 +132,6 @@ static struct snd_soc_dai_link card_dai_links[] = { }, }; -/* audio machine driver for Haswell Lynxpoint DSP + RT5640 */ static struct snd_soc_card hsw_rt5640_card = { .name = "haswell-rt5640", .owner = THIS_MODULE, @@ -152,7 +150,6 @@ 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); @@ -172,8 +169,7 @@ static struct platform_driver hsw_rt5640_driver = { module_platform_driver(hsw_rt5640_driver) -/* Module information */ MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); -MODULE_DESCRIPTION("Intel SST Audio for Haswell Lynxpoint"); -MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Sound card driver for Intel Haswell Lynx Point with Realtek 5640"); +MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:hsw_rt5640"); From patchwork Fri Jun 10 12:36:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877554 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 0ED3FC433EF for ; Fri, 10 Jun 2022 12:27:41 +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 37A581B30; Fri, 10 Jun 2022 14:26:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 37A581B30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864059; bh=sNYVYVE2ky9o1xmfL+Ctpt9c5/YEj5m36st4gg2yEO4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GMciHjHuy6kIeiqTCBP1XH5BH7uUFOctwrXuLaU5bqjDH6+xHmjOlbC0nGYQUP26U 1DPw0yclN+ZS/ou0hnsoiGrE/1X9cQULinTvAmLBeRSrI2TmFwmKLC0AKakaNc8wQp 3y6w0Rw5bh3QIbfojSA1MPFA193XdZ9TgNXO7Ryg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3CB1AF8052D; Fri, 10 Jun 2022 14:26:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 956A3F804CF; Fri, 10 Jun 2022 14:26:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 622B7F80528 for ; Fri, 10 Jun 2022 14:26:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 622B7F80528 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bMomP+7u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863981; x=1686399981; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sNYVYVE2ky9o1xmfL+Ctpt9c5/YEj5m36st4gg2yEO4=; b=bMomP+7upmQPpkNEZmaMjgOZSWpFWlGngdDOXIJXR0a1IhcTkVa1mUcL SL/Ms8/fCweZ60rRj6hyPoxhNW4yfj7bOHyGAXFJ68L0fgccW2rz6NyVc nokrh6hcWGm8IRAxyTozL/Kg90NaCSFTLJ5b0DfPgGpJbxtNrGkaOgASd kuBQ1Bd9LwRL/o+8MJP5A3q0Kai4qpABH1Z63569h1+Rm7B1t1W2uYexm hmswAXtsw5eutKbjUI0a1kNoLvkmW5pugqLGwLqmKJbb7nLcekjWMl+5F mwjsvxw5jo5rrtSGDbwtNZV8EPcu8gVt4LCgczFnYbQdXBk1T+Ydcgo6X g==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414375" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414375" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517872" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:18 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 06/17] ASoC: Intel: hsw_rt5640: Improve probe() function quality Date: Fri, 10 Jun 2022 14:36:16 +0200 Message-Id: <20220610123627.1339985-7-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 0cd788a73694..94f96de0b62a 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 Fri Jun 10 12:36: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: 12877556 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 8F378C43334 for ; Fri, 10 Jun 2022 12:28:09 +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 CC04B1B50; Fri, 10 Jun 2022 14:27:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CC04B1B50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864087; bh=2NbET2uuELT2qxeUA6UaI5G3IivOjV6ok7fat1d8OXM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pzflaeM0tmqQAqR/qTfr6rHGKnziGBINDfxQnP9k0sTd4NzBOPNHF9IL5JwoSFWsQ SjmzoF7xmti8n59z6SBX7FN9idK6WvLgeHKjXM+QyZsEgadnaX0r7WS7W8msNSMzUR 14ghlu1V4lrQ3/Tx/o6NXokQiCoiE+QSEDcyHKLI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 69C54F8053C; Fri, 10 Jun 2022 14:26:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81004F80535; Fri, 10 Jun 2022 14:26:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 B793CF8052D for ; Fri, 10 Jun 2022 14:26:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B793CF8052D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Oa0kGBzE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863984; x=1686399984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2NbET2uuELT2qxeUA6UaI5G3IivOjV6ok7fat1d8OXM=; b=Oa0kGBzELGia2WFbBNytUcHCFdDMP8XmDVS3gKjWhKZXbMEQmZmsJwND hZ4mIRC1E44OBjtFIZVXvK+i2wwq0hGSdfnqFfc3j4BMGhEdzIMM7JsAq ENadjWhicMiISXjbgkNp0f/yzs4dOH0b4+KekyVTsYI7GThcv8HQCAHdH k80iriDeggUEgwI+wZRXtfao28T87SSAuhfZ2oLW/XDyCl1N51qiDi30N vEMImS78w3d4pYkx2hDC93Ohg8cQN6Jdu02UZe7K6hPAbwg3Km+VLmrK0 HhvnsZfPlxEJHi8Sy2+VWAQ01S3dC4Ktw2nP910sWzzRPP185TYsAFdf3 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414399" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414399" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517877" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:20 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 07/17] ASoC: Intel: hsw_rt5640: Improve hw_params() debug-ability Date: Fri, 10 Jun 2022 14:36:17 +0200 Message-Id: <20220610123627.1339985-8-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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/hsw_rt5640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index 94f96de0b62a..5e2224f7e986 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -53,7 +53,7 @@ static int codec_link_hw_params(struct snd_pcm_substream *substream, 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"); + dev_err(rtd->dev, "set codec sysclk failed: %d\n", ret); return ret; } From patchwork Fri Jun 10 12:36: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: 12877563 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 0D007C433EF for ; Fri, 10 Jun 2022 12:29:21 +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 3374D1B07; Fri, 10 Jun 2022 14:28:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3374D1B07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864159; 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=KGU1tYsDd6p+4kEr7dKMQq+jXK9+wTmV8xg9r4mrnxidgatDJJOC7qsCKtNHZNhQH Q9cqLIaYzOfDCWzlP9FgCCq2mKBgj9oV1sy2mvOS1r4yUXRA1u9KPz9EwghNoMD9QQ 3aTEsZZuOhuRW2VKkrgbDDTwJVGENUcrhRK0Y9Gw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CF39CF80563; Fri, 10 Jun 2022 14:26:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8DA34F80543; Fri, 10 Jun 2022 14:26:33 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 04D08F800C7 for ; Fri, 10 Jun 2022 14:26:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 04D08F800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GNL7oQFZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863986; x=1686399986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o0Kok7wGPSNdLmm0aDT4JNZdUbDgMsPnAiN9aOQ2AiM=; b=GNL7oQFZc8hvXRAvTtvQH+ut0uw31pyMQpMIBEvXddHhuTsfiXIhaLGN SpndUA8IoURRL/rFa9lGSPQ47KdLcbpBFFumflukWljLW3xGFUd3pZSG3 tyvUpPgPq8v6zjwGcBmFKVnoJuaoxozpeYgOkNdSbaesy4ILaSyAs0wnN RtdvjC1Oz0a6ZlLv2YsHEC5gNLqHQaxpajy8TUQcXdRgZ4olJF0osWKEG G7ZA7sAM+xx9+WLiAq1rijjGFtxlgn92TEUgK/OPbWtAJ4l2nZecOipP+ 7WXyYmdIzMcKCHZqsxxDk5+IG+5HNV4gqOOjhhkMkRTv3SgnzBYgpt9f/ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414423" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414423" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517896" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:22 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 08/17] ASoC: Intel: Rename broadwell source file to bdw_rt286 Date: Fri, 10 Jun 2022 14:36:18 +0200 Message-Id: <20220610123627.1339985-9-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 Fri Jun 10 12:36: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: 12877564 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 B2F44C43334 for ; Fri, 10 Jun 2022 12:29:38 +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 E4D4E1B1A; Fri, 10 Jun 2022 14:28:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E4D4E1B1A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864177; bh=5BQ5MHlwnuq9iDJwDNaNV0k8nuJSTLk9Bmi2Dkel+dg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fQ5vj0PbE/2MaCE8gXV19DrPW498fxcSPWHPx6acGedMcR7gB261uHbRzOiFMzRtR VWxQFEWqFN5y1s885AFwKSP+c1e8XqeZLI09DRjZ0MDOGfaQDpn6SF+WBV6Z5Kirgw 4Aw39LL0HiiYSMHZ58y5he/t56r385a2CjpNDz/4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 606FDF80566; Fri, 10 Jun 2022 14:26:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5E8B1F80548; Fri, 10 Jun 2022 14:26:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 4B483F800E5 for ; Fri, 10 Jun 2022 14:26:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4B483F800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="anGvW/mU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863988; x=1686399988; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5BQ5MHlwnuq9iDJwDNaNV0k8nuJSTLk9Bmi2Dkel+dg=; b=anGvW/mUUDYKQ/D3ijK48WAr8In47pLNfEettKqhF2pEcc5xOM5C1Ikd +iUkgfQx+Z7GSr6DwDPF5NrJ9cshVSfHDnPpsZeqHbYlro4PGTtw7eelu Zu0oPxOeKbH/183JaJ9CZTmn9IAi1raxrDDdoczGlwdd1YE1j+tV83s12 U8bKHfNvhwzKjymxWa5F+tusy9RXu0Vqqlyyz+LEEVJtUiItR1mAHZ+Oh RKFDMO2GVlWiOA6QQoQ3IzoWIQVgfIg7p6AIJwP3pc6to4/366nhoRFDF MFqA3WO00f4uaY1rD1zaVSw/llZ4W6QQJFGmN+AfLSvJR4cEs548xSR/B Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414454" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414454" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517910" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:24 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 09/17] ASoC: Intel: bdw_rt286: Reword prefixes of all driver members Date: Fri, 10 Jun 2022 14:36:19 +0200 Message-Id: <20220610123627.1339985-10-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 | 96 +++++++++++++++--------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index b29d77dfb281..092bc9a45548 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; - rt286_mic_detect(component, &broadwell_headset); + rt286_mic_detect(component, &card_headset); 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,12 +215,12 @@ 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), @@ -241,21 +241,21 @@ static void broadwell_disable_jack(struct snd_soc_card *card) } } -static int broadwell_suspend(struct snd_soc_card *card) +static int card_suspend_pre(struct snd_soc_card *card) { broadwell_disable_jack(card); return 0; } -static int broadwell_resume(struct snd_soc_card *card){ +static int card_resume_post(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"); - rt286_mic_detect(component, &broadwell_headset); + rt286_mic_detect(component, &card_headset); break; } } @@ -270,48 +270,48 @@ 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 = card_suspend_pre, + .resume_post = card_resume_post, }; -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); @@ -320,16 +320,16 @@ static int broadwell_audio_remove(struct platform_device *pdev) return 0; } -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 Fri Jun 10 12:36:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877562 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 A1F13C43334 for ; Fri, 10 Jun 2022 12:29:04 +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 D32EB1ED8; Fri, 10 Jun 2022 14:28:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D32EB1ED8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864142; bh=oLw62bFRVUSpkqb9Dtxj1cVu/Jz+bpKq6ce1rwnr6/0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=diLfQbXI6BIad+fPYwhq8Ty7zRCO4j6ZiTYiEFZhbL6Vab37LBetS0NXA1b8ggR1p dWs5YF7BjeIlnaZIssSOP2sUPtE3Mpru3kUDpxAn+pzpBlIlLTv6o8CsXdtLKBcYrS 6U6nGLSQRERCLXrm1hym+9ZG9MDpT4+TPh0Nq56E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CC82DF80558; Fri, 10 Jun 2022 14:26:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6E7F7F8053D; Fri, 10 Jun 2022 14:26:32 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 7E395F804D8 for ; Fri, 10 Jun 2022 14:26:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7E395F804D8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T/RLTibn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863990; x=1686399990; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oLw62bFRVUSpkqb9Dtxj1cVu/Jz+bpKq6ce1rwnr6/0=; b=T/RLTibnRhlHdPzZvAWFxK4hUcheLhuk59l2kwH+hCBr8pLWko4UNLBN kt29jQmrbHa4IbXT3HXmfo+LlBo9Cua7bGIXBdKmkR56tKi3zmgtm600R U0qXW9epY3ycV96CFsgWHWAj8/auwv+pI2nm+nM++yihsTz64zVDhdruB 7jUyVVEXUFUXO5rjnhuPYIFGWi56lZTciDJeFvcF1ch0djOfsNGe5/KO+ 1OuqsrQNvWNtwUGvt7DrzwbtfxhpFgS35upukXtGK9wPU6bhVZOBNZKmj wtuFWHvlxth0F4sMFe7gYecgFHSHXVDWpzSZbBde5dQ28CvvjK8JTjH9T A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414460" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414460" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517914" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:26 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 10/17] ASoC: Intel: bdw_rt286: Reword driver name Date: Fri, 10 Jun 2022 14:36:20 +0200 Message-Id: <20220610123627.1339985-11-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 092bc9a45548..0e67741aea79 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -324,7 +324,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 }, }; @@ -335,4 +335,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 Fri Jun 10 12:36:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877565 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 1C9DAC433EF for ; Fri, 10 Jun 2022 12:29:53 +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 699891EFC; Fri, 10 Jun 2022 14:29:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 699891EFC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864191; bh=YOK2wOTKnfoEMs78PzQR47Kz5JWbwboudShuXlNTgVY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ba8teJVWBS/7CRDTUbnPJneRuDSh9qyIKcBM5+fQ37uwp4LYm4Jj2FNwy1WnBrJBW EXfPTSzRvPHjnZw8k+0Ni5YE76d6S5P7lkQjDH+lIetVpkloExRZ1vsybCmoz3ERmw HWANYe6WmJh8EKBTxgA8bbgos83xstAEsl6C1ORQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5BF10F80570; Fri, 10 Jun 2022 14:26:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15546F8054A; Fri, 10 Jun 2022 14:26:35 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 105C2F80537 for ; Fri, 10 Jun 2022 14:26:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 105C2F80537 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="k/SaGrq/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863992; x=1686399992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YOK2wOTKnfoEMs78PzQR47Kz5JWbwboudShuXlNTgVY=; b=k/SaGrq/VYNYR1dVor9xubQy3MoToNEfJP7GGE+f0usSG5cpmwwMZvc3 h/MJUfT85WXPkNBFF7nBhkSCTIshKNFbbASuOXCOzvqA1PxdgzWTg9L5s 8Vl+IY3jGOMsjU1p6T4uUMFnt1Qug7WOk+gpymiXXiXIWwH0TFnNeWo/W 51dY1QcnZ74jReonX6C+VQW3BzJ7QXoinymQRGHpq76S75XyvaFQkPBgU +l/5GkFB1CXUDZJTN6ZuHA/ppyXxvBprXIA6t2h+ghGURbBBaP8vfSChE R6BgRdt8G0G4/qYtOzG0CFgT4biVkkmEeI5ODCt4aY3vuhNAx05uaFNaK w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414466" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414466" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517923" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:28 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 11/17] ASoC: Intel: bdw_rt286: Update code indentation Date: Fri, 10 Jun 2022 14:36:21 +0200 Message-Id: <20220610123627.1339985-12-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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. While at it, rename local variable 'chan' to 'channels' to match hsw_rt5640 board's equivalent. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 87 +++++++++++------------------- 1 file changed, 32 insertions(+), 55 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 0e67741aea79..fbef19a545b0 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -8,12 +8,11 @@ #include #include #include -#include -#include #include +#include #include +#include #include - #include "../../codecs/rt286.h" static struct snd_soc_jack card_headset; @@ -44,7 +43,6 @@ static const struct snd_soc_dapm_widget card_widgets[] = { }; static const struct snd_soc_dapm_route card_routes[] = { - /* speaker */ {"Speaker", NULL, "SPOR"}, {"Speaker", NULL, "SPOL"}, @@ -69,9 +67,10 @@ 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, &card_headset, - card_headset_pins, ARRAY_SIZE(card_headset_pins)); + + ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, + &card_headset, card_headset_pins, + ARRAY_SIZE(card_headset_pins)); if (ret) return ret; @@ -79,34 +78,29 @@ static int codec_link_init(struct snd_soc_pcm_runtime *rtd) return 0; } - 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 *chan = 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; - chan->min = chan->max = 2; - + 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, RT286_SCLK_S_PLL, 24000000, - SND_SOC_CLOCK_IN); - + 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"); return ret; @@ -135,8 +129,7 @@ static int bdw_rt286_fe_startup(struct snd_pcm_substream *substream) /* Board supports stereo configuration only */ runtime->hw.channels_max = 2; - return snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_CHANNELS, + return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &constraints_channels); } @@ -144,29 +137,15 @@ 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(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(offload1, - DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin"))); - -SND_SOC_DAILINK_DEF(loopback, - DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin"))); - -SND_SOC_DAILINK_DEF(dummy, - DAILINK_COMP_ARRAY(COMP_DUMMY())); - -SND_SOC_DAILINK_DEF(platform, - DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio"))); - -SND_SOC_DAILINK_DEF(codec, - DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1"))); - -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(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio"))); +SND_SOC_DAILINK_DEF(codec, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1"))); +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 card_dai_links[] = { @@ -176,7 +155,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "System Playback/Capture", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .ops = &bdw_rt286_fe_ops, .dpcm_playback = 1, .dpcm_capture = 1, @@ -187,7 +166,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Offload0 Playback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_playback = 1, SND_SOC_DAILINK_REG(offload0, dummy, platform), }, @@ -196,7 +175,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Offload1 Playback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_playback = 1, SND_SOC_DAILINK_REG(offload1, dummy, platform), }, @@ -205,7 +184,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .stream_name = "Loopback", .nonatomic = 1, .dynamic = 1, - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, + .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST }, .dpcm_capture = 1, SND_SOC_DAILINK_REG(loopback, dummy, platform), }, @@ -216,8 +195,7 @@ static struct snd_soc_dai_link card_dai_links[] = { .id = 0, .no_pcm = 1, .init = codec_link_init, - .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, @@ -233,7 +211,6 @@ static void broadwell_disable_jack(struct snd_soc_card *card) for_each_card_components(card, component) { if (!strcmp(component->name, "i2c-INT343A:00")) { - dev_dbg(component->dev, "disabling jack detect before going to suspend.\n"); rt286_mic_detect(component, NULL); break; @@ -248,17 +225,18 @@ static int card_suspend_pre(struct snd_soc_card *card) return 0; } -static int card_resume_post(struct snd_soc_card *card){ +static int card_resume_post(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"); rt286_mic_detect(component, &card_headset); break; } } + return 0; } @@ -291,11 +269,10 @@ static int bdw_rt286_probe(struct platform_device *pdev) int ret; bdw_rt286_card.dev = &pdev->dev; - /* override platform name, if required */ mach = pdev->dev.platform_data; - ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card, - mach->mach_params.platform); + + ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card, mach->mach_params.platform); if (ret) return ret; From patchwork Fri Jun 10 12:36:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877567 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 A78ACC43334 for ; Fri, 10 Jun 2022 12:30:26 +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 E02FA1B4B; Fri, 10 Jun 2022 14:29:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E02FA1B4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864225; bh=EyGmrKRw3Kskh9z2l/biC22smat8lnm1gYePTEilGvY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=q9UfJbqaBdLKqQhQ++XwA5zBYRtMLM1GFG3DT6sTZTn1yrlI167r9IPjtQDWyk+cB sDgszlzOd2i8tF72VMSa4EwN7ozGuApOJGaN9+FWuZQ4OZhW2QSMuSYu7hmjeYusw4 dxpWEkSm+8Eqm9CorMw1v2FMTP5TqlHLVNF2Clw4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1CAD7F8058C; Fri, 10 Jun 2022 14:26:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BD842F8057D; Fri, 10 Jun 2022 14:26:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 18168F8053D for ; Fri, 10 Jun 2022 14:26:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 18168F8053D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jxoFPQ8a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863994; x=1686399994; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EyGmrKRw3Kskh9z2l/biC22smat8lnm1gYePTEilGvY=; b=jxoFPQ8afIfmWg451OAEtnJSK6MsxgqiUMkuNwffRSuw83pkrSGpUrur 1+GXTnPGKXcvVztrKsH15Qc/s5FiZs9x9xbIHuJb+accwXzsqau4sU2PC CmWOwTE7rrQb1JrDtKoe/O5481DxGO0/nUuJllluk6VNkeVAGBoW/TX9L ocy1+wIDP5N6QcEuhI4kFi67XhJdvUz7LzJi/fDnXa4CxuStiieOt1l6L ODDz6qbOeuSuS/op24ODxw+JkjIP/qzgV/DfUpl4znCudORr3X6tzq72S HZPGl0AeONsxHI35y/ZjEOrqIDfr5XkvFXx9cEbHSyWXiH527AeFYzvsO w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414469" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414469" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517926" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:30 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 12/17] ASoC: Intel: bdw_rt286: Update file comments Date: Fri, 10 Jun 2022 14:36:22 +0200 Message-Id: <20220610123627.1339985-13-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 and update valuable comments within the file to increase readability. This patch also revisits module information and kconfig help strings. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/Kconfig | 2 +- sound/soc/intel/boards/bdw_rt286.c | 23 +++++++---------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 817b4c04bf6a..aa12d7e3dd2f 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -85,7 +85,7 @@ config SND_SOC_INTEL_BDW_RT5677_MACH If unsure select "N". config SND_SOC_INTEL_BROADWELL_MACH - tristate "Broadwell Wildcatpoint" + tristate "Broadwell with RT286 I2S codec" depends on I2C depends on I2C_DESIGNWARE_PLATFORM || COMPILE_TEST depends on X86_INTEL_LPSS || COMPILE_TEST diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index fbef19a545b0..51b37dafb469 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Intel Broadwell Wildcatpoint SST Audio + * Sound card driver for Intel Broadwell Wildcat Point with Realtek 286 * * Copyright (C) 2013, Intel Corporation. All rights reserved. */ @@ -16,7 +16,7 @@ #include "../../codecs/rt286.h" static struct snd_soc_jack card_headset; -/* Headset jack detection DAPM pins */ + static struct snd_soc_jack_pin card_headset_pins[] = { { .pin = "Mic Jack", @@ -43,18 +43,14 @@ static const struct snd_soc_dapm_widget card_widgets[] = { }; static const struct snd_soc_dapm_route card_routes[] = { - /* speaker */ {"Speaker", NULL, "SPOR"}, {"Speaker", NULL, "SPOL"}, - /* HP jack connectors - unknown if we have jack deteck */ {"Headphone Jack", NULL, "HPO Pin"}, - /* other jacks */ {"MIC1", NULL, "Mic Jack"}, {"LINE1", NULL, "Line Jack"}, - /* digital mics */ {"DMIC1 Pin", NULL, "DMIC1"}, {"DMIC2 Pin", NULL, "DMIC2"}, @@ -84,10 +80,10 @@ static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, 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 */ + /* The ADSP will convert the FE rate to 48kHz, stereo. */ rate->min = rate->max = 48000; channels->min = channels->max = 2; - /* set SSP0 to 16 bit */ + /* Set SSP0 to 16 bit. */ params_set_format(params, SNDRV_PCM_FORMAT_S16_LE); return 0; @@ -147,7 +143,6 @@ SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audi SND_SOC_DAILINK_DEF(codec, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1"))); 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 card_dai_links[] = { /* Front End DAI links */ { @@ -240,14 +235,13 @@ static int card_resume_post(struct snd_soc_card *card) return 0; } -/* use space before codec name to simplify card ID, and simplify driver name */ +/* Use space before codec name to simplify card ID, and simplify driver name. */ #define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */ #define SOF_DRIVER_NAME "SOF" #define CARD_NAME "broadwell-rt286" #define DRIVER_NAME NULL /* card name will be used for driver name */ -/* broadwell audio machine driver for WPT + RT286S */ static struct snd_soc_card bdw_rt286_card = { .owner = THIS_MODULE, .dai_link = card_dai_links, @@ -269,14 +263,12 @@ static int bdw_rt286_probe(struct platform_device *pdev) int ret; bdw_rt286_card.dev = &pdev->dev; - /* override platform name, if required */ mach = pdev->dev.platform_data; 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)) { bdw_rt286_card.name = SOF_CARD_NAME; bdw_rt286_card.driver_name = SOF_DRIVER_NAME; @@ -308,8 +300,7 @@ static struct platform_driver bdw_rt286_driver = { module_platform_driver(bdw_rt286_driver) -/* Module information */ MODULE_AUTHOR("Liam Girdwood, Xingchao Wang"); -MODULE_DESCRIPTION("Intel SST Audio for WPT/Broadwell"); -MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Sound card driver for Intel Broadwell Wildcat Point with Realtek 286"); +MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:bdw_rt286"); From patchwork Fri Jun 10 12:36: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: 12877568 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 2DF8AC43334 for ; Fri, 10 Jun 2022 12:30:45 +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 4B3751E7C; Fri, 10 Jun 2022 14:29:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B3751E7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864243; bh=3MH/rR37WDhB/lUIYLU4IB4XrHdaAlrvhFP9VPgxti0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HYIdSrXodJJg+TwcRVKvDPS2ynWA/EeWeFTmrarWV2KC5frxnq460dKk8O9a4XtrL nVm9jgU1hs/DCr1mOzDXz5o6q/VgmBxZNiO6dkOjIEKb65ajrnk7uFa5Tr7apDJF6R exKCBidE5ifPjhAIKbbdc9HY4NPrjA2d+qgonfgk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 977CCF805A8; Fri, 10 Jun 2022 14:26:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 870C5F8059F; Fri, 10 Jun 2022 14:26:41 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 EF448F80553 for ; Fri, 10 Jun 2022 14:26:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EF448F80553 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VH+MkaYQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863996; x=1686399996; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3MH/rR37WDhB/lUIYLU4IB4XrHdaAlrvhFP9VPgxti0=; b=VH+MkaYQI2MzsbXnhC1IarjJMpFusr+Voj/Q9wwcfcip45/vH4KVXIXo qa4ykMEA9YjUFQtaqz/sUfkj1omGbaqxrTGHm6zUyMgkt8bIjdGOA2z09 hlFOXG7BonxcVHByJmytR01oc6GCaYUQdXdYWBDpiSM8ibtY2C+ALRCIO D3q0WRqfLabjtDkxFf6aW5BWYPE2AQkh+7VIoY9F68eqGNdWdNLTcxFng O4MAMoyY5EhrwEFdt0p5tXmidCNf0Kpn44SLw3rPtWANGMHCWJPAeLNJ2 7zA1H+Q/+F0XD+qVrX/2EX/OB6QSjqlrR/HVnem3ALy4OS65h1Ok+0y9c A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414476" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414476" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517936" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:32 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 13/17] ASoC: Intel: bdw_rt286: Improve probe() function quality Date: Fri, 10 Jun 2022 14:36:23 +0200 Message-Id: <20220610123627.1339985-14-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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. Relocate few relevant to the function macros for the exact same read too. Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 51b37dafb469..d401b2c85b20 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -235,13 +235,6 @@ static int card_resume_post(struct snd_soc_card *card) return 0; } -/* Use space before codec name to simplify card ID, and simplify driver name. */ -#define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */ -#define SOF_DRIVER_NAME "SOF" - -#define CARD_NAME "broadwell-rt286" -#define DRIVER_NAME NULL /* card name will be used for driver name */ - static struct snd_soc_card bdw_rt286_card = { .owner = THIS_MODULE, .dai_link = card_dai_links, @@ -257,27 +250,33 @@ static struct snd_soc_card bdw_rt286_card = { .resume_post = card_resume_post, }; +/* Use space before codec name to simplify card ID, and simplify driver name. */ +#define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */ +#define SOF_DRIVER_NAME "SOF" + +#define CARD_NAME "broadwell-rt286" + static int bdw_rt286_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; + struct device *dev = &pdev->dev; int ret; - bdw_rt286_card.dev = &pdev->dev; - mach = pdev->dev.platform_data; + bdw_rt286_card.dev = dev; + mach = dev_get_platdata(dev); ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card, mach->mach_params.platform); if (ret) return ret; - if (snd_soc_acpi_sof_parent(&pdev->dev)) { + if (snd_soc_acpi_sof_parent(dev)) { bdw_rt286_card.name = SOF_CARD_NAME; bdw_rt286_card.driver_name = SOF_DRIVER_NAME; } else { bdw_rt286_card.name = CARD_NAME; - bdw_rt286_card.driver_name = DRIVER_NAME; } - return devm_snd_soc_register_card(&pdev->dev, &bdw_rt286_card); + return devm_snd_soc_register_card(dev, &bdw_rt286_card); } static int bdw_rt286_remove(struct platform_device *pdev) From patchwork Fri Jun 10 12:36: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: 12877566 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 EBE43C433EF for ; Fri, 10 Jun 2022 12:30:13 +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 36D101ED9; Fri, 10 Jun 2022 14:29:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 36D101ED9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864212; bh=rSZxPEtqkGgpYMB/XsOi274ItDObbjO3MN7YNIRwdhE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BwlAUustXE6xFIMo0kXBLjXJ5wOEgSsbt93hAZhaixfaP8Zuvq0EJYxczcVuUIlbq tzp1LbzcLFWUYM84u0EOJMGkjQ2S+rR1kb7LaabWJZ11kIuXV1UvtjyNwa81G83Cnn HnnW/xr2o6D12Y6BmG+dnrLjujFSzfW1ZeH9SsTU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6FC10F80588; Fri, 10 Jun 2022 14:26:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D07C8F8057C; Fri, 10 Jun 2022 14:26:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 C513EF8055C for ; Fri, 10 Jun 2022 14:26:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C513EF8055C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Abw5+9jD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863998; x=1686399998; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rSZxPEtqkGgpYMB/XsOi274ItDObbjO3MN7YNIRwdhE=; b=Abw5+9jDhsF7OCw3EqMJJACBNkSonw1NQcteA5BdTKkjKNBkMNqg/0W2 DagUdzHsdp5Le1P+dBzFip3AeWcn1wF8ank+A93bW9jpn6R5QYX9i+bev Fuo/O6YWJSvpzKtd/r04tj4SF8NNbvwTrtibsRBZKSn2w6kaSgF6Je6ub koN6UBcjIftGXWpcre2Z5lwhyjJaeGLyg24BwnvPRahsSDr/WuHDVSZIb PUtESEFpu/FkutRqMCxrczdHE9KuDRKBgC0P1lRp+m0WVSt7kgQKIA0q1 L+OGS+HxReaRcORtyKbLlUrLAj9OLxj6Dr7kG2JnhZLqXEPNxGN4Neepa w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414482" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414482" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517941" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:34 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 14/17] ASoC: Intel: bdw_rt286: Improve hw_params() debug-ability Date: Fri, 10 Jun 2022 14:36:24 +0200 Message-Id: <20220610123627.1339985-15-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 d401b2c85b20..e173546b68cc 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 Fri Jun 10 12:36:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877569 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 3E7D3C433EF for ; Fri, 10 Jun 2022 12:31:01 +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 3F7C51F05; Fri, 10 Jun 2022 14:30:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3F7C51F05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864260; bh=lw5cL6KYoePrz5pxkB4ij9kUl2kncOnWIdeNSEbJmKc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HF4h0Z+Xbn7XXYZ5JRHsUizdRfoePpsCRxDJCq4tosao9Vr5YtkTYZfJ28IOhPE01 MHE++Ha7z6fwdCQz7jn4UfFz8ybNQUBkbrg/I761I7f6xdh9TqsU3hpaWKIDW48rin dJuT04EqjfBzryPgr5Ncl1r2tUI4L4UKtB1SFw6U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2D0D5F805B0; Fri, 10 Jun 2022 14:26:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2ECBAF805B3; Fri, 10 Jun 2022 14:26:45 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 AD0BFF8057B for ; Fri, 10 Jun 2022 14:26:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AD0BFF8057B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XOjJBXHB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654863999; x=1686399999; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lw5cL6KYoePrz5pxkB4ij9kUl2kncOnWIdeNSEbJmKc=; b=XOjJBXHBv68JvFBld5hMsrK/1l1v7M05b9R44tSaJbZBupiviws1vSAG sxlu1DyAIUBkDtnVejJe7CncZndek28PoB1zJ88kngDqxY5SrLrlzwCw3 s+yZPnwACG/zx2UzS/pyJ1l3qDMlZV2V+Bxat26iyPGWHr+fsoPH9h2tE hw8wIcJgQJWX6qPd95R9VKyEUvCVKQfh3RffWKwFxcKk7vcuIUpRgJlFh HektNHBCI1rBfWQkc9HOuGqvCBlU0NyY//bU4Cz4522dN2jixu0muxLAF MgVnlSDcZP03mWR4ZMUcZcxHvshN21C0rkh9f23Xo5sVvuTQWFvM/5n96 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414488" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414488" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517945" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:36 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 15/17] ASoC: Intel: bdw_rt286: Improve codec_init() quality Date: Fri, 10 Jun 2022 14:36:25 +0200 Message-Id: <20220610123627.1339985-16-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 e173546b68cc..81da9781c3ba 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; - rt286_mic_detect(component, &card_headset); - return 0; + return rt286_mic_detect(codec, &card_headset); } static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, From patchwork Fri Jun 10 12:36: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: 12877571 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 7F0A5C433EF for ; Fri, 10 Jun 2022 12:31:37 +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 BDF711F80; Fri, 10 Jun 2022 14:30:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BDF711F80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864295; bh=HvheQlqo9Qk1XDkvr95LUajm9gwLG5cr+phlYzI9mdc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z+cPgyz9AC368V3i2H8qSsU3xDJiE44xlNXzBqt15iFJLxigyoCCVyhBjdyfH63BY BBcsZA3NUU1m22Zb+BB0zm5eys7Ic+Q7wl9JWc3Q4Mo00UHiEAGmCcqHco0HkPFDV7 0NxuDQlVfCZZgOKntrdsFVU+xviCTiRfCfmtuS3M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 90DA9F805C1; Fri, 10 Jun 2022 14:26:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6218F805C2; Fri, 10 Jun 2022 14:26:48 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 32C9AF805A9 for ; Fri, 10 Jun 2022 14:26:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 32C9AF805A9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KquV9ol1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654864003; x=1686400003; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HvheQlqo9Qk1XDkvr95LUajm9gwLG5cr+phlYzI9mdc=; b=KquV9ol1K9j5MxyQAlnB6ZkWFkiEFX7MEwEWyQqkGIdokw6bK+4pysi3 j40WZD21POpVFRs1a8r3ajRcjCbg/J20AP6elZTnGCKZL50lesPlcZnw5 DIDr57+1azm1uVgTjtv32HNYb35b8qn4yBmEHGk38yxwhUocuVUomq6jg 6IA6djpMbpCj9X+RHFvwhMcSwgBKSgwtJDxo7MwwT5noVfK12JQgZQG0n I0UGPAWsSqqqTEhcRjLCm0GN5g0b79C3hWDWzGj8GpUH6QQCyHHpVEN5I UyQQQ3WEN0JYhpyKOPWC9uZRKKPDfxIM6kYYpX0qZ2wXzDx1yZco5hgGW w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414495" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414495" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517949" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:38 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 16/17] ASoC: Intel: bdw_rt286: Refactor suspend/resume Date: Fri, 10 Jun 2022 14:36:26 +0200 Message-Id: <20220610123627.1339985-17-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 card->remove() rather than pdev->remove() to unassign jack during card unbind procedure. To reduce code size, define unified jack setter in form of bdw_rt286_set_jack() and invoke it during remove(), suspend_pre() and resume_port(). Signed-off-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński --- sound/soc/intel/boards/bdw_rt286.c | 50 +++++++++--------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c index 81da9781c3ba..a2ff4da0bb93 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -199,43 +199,33 @@ static struct snd_soc_dai_link card_dai_links[] = { }, }; -static void broadwell_disable_jack(struct snd_soc_card *card) +static int card_set_jack(struct snd_soc_card *card, struct snd_soc_jack *jack) { - struct snd_soc_component *component; - - for_each_card_components(card, component) { - if (!strcmp(component->name, "i2c-INT343A:00")) { - dev_dbg(component->dev, "disabling jack detect before going to suspend.\n"); - rt286_mic_detect(component, NULL); - break; - } - } + struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, "rt286-aif1"); + + return rt286_mic_detect(codec_dai->component, jack); } -static int card_suspend_pre(struct snd_soc_card *card) +static int card_remove(struct snd_soc_card *card) { - broadwell_disable_jack(card); + return card_set_jack(card, NULL); +} - return 0; +static int card_suspend_pre(struct snd_soc_card *card) +{ + return card_set_jack(card, NULL); } static int card_resume_post(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"); - rt286_mic_detect(component, &card_headset); - break; - } - } - - return 0; + return card_set_jack(card, &card_headset); } static struct snd_soc_card bdw_rt286_card = { .owner = THIS_MODULE, + .remove = card_remove, + .suspend_pre = card_suspend_pre, + .resume_post = card_resume_post, .dai_link = card_dai_links, .num_links = ARRAY_SIZE(card_dai_links), .controls = card_controls, @@ -245,8 +235,6 @@ static struct snd_soc_card bdw_rt286_card = { .dapm_routes = card_routes, .num_dapm_routes = ARRAY_SIZE(card_routes), .fully_routed = true, - .suspend_pre = card_suspend_pre, - .resume_post = card_resume_post, }; /* Use space before codec name to simplify card ID, and simplify driver name. */ @@ -278,18 +266,8 @@ static int bdw_rt286_probe(struct platform_device *pdev) return devm_snd_soc_register_card(dev, &bdw_rt286_card); } -static int bdw_rt286_remove(struct platform_device *pdev) -{ - struct snd_soc_card *card = platform_get_drvdata(pdev); - - broadwell_disable_jack(card); - - return 0; -} - static struct platform_driver bdw_rt286_driver = { .probe = bdw_rt286_probe, - .remove = bdw_rt286_remove, .driver = { .name = "bdw_rt286", .pm = &snd_soc_pm_ops From patchwork Fri Jun 10 12:36:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12877570 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 D8D8AC433EF for ; Fri, 10 Jun 2022 12:31:12 +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 23D311F19; Fri, 10 Jun 2022 14:30:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 23D311F19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654864271; bh=MnA/zvLOHXOwPxUeE7yEGW4hRg5u/uyCNgxQJp5Kx0Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lLhjbniQw5mwVAxZDXS3KL1YeP0PIT28qv/AUDuZ3RypuEsfsxs7OVsYJe3woAIGq KiOfdB0Yn08SM2IRuIKchj9QiKRDMNJf/ed7tybM+XhkvwkHu5l1bmxnE85Q1MhUfe dCwc5MLFZVX9P78FkjzZnJqhBos8sMHtgmKZWadk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A11CEF805B5; Fri, 10 Jun 2022 14:26:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F9ADF805B2; Fri, 10 Jun 2022 14:26:45 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 CE893F805AE for ; Fri, 10 Jun 2022 14:26:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CE893F805AE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="a9faCpIx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654864004; x=1686400004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MnA/zvLOHXOwPxUeE7yEGW4hRg5u/uyCNgxQJp5Kx0Y=; b=a9faCpIxIaeAJvmZ4wmpaxaICpWoNdstJx0/CII+dmEyrpTEqfP9YktE E+7peUrXRuBF9cvyu3tVYqbgOS7HZZZkhEPYTkotG1XI1FN/5geQZPBVO QJRhBAfI9uUgC+fwmW225s5WxfzLXEVOEpG9TFcpt2Yn+BjDa12ASxRW9 jkFxUnQ/QUe3CKX33wbs6PkjE302rwG0T9rF+QE+rORovmieBoC/TApC2 IgIbJX9oavIuvCejUgabywL52lh0v8aTYKZDG50/xAoAyHfH7Gxqy5bJB OFfToHBM0iP2Lxz+Bf+6sgtspeoPjRhzr3s/grFMdPjpDDeto2Clde0kt A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278414500" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="278414500" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 05:26:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="684517965" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2022 05:26:40 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 17/17] ASoC: Intel: bdw_rt286: Remove FE DAI ops Date: Fri, 10 Jun 2022 14:36:27 +0200 Message-Id: <20220610123627.1339985-18-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610123627.1339985-1-cezary.rojewski@intel.com> References: <20220610123627.1339985-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 FE DAIs 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 a2ff4da0bb93..7d34e5002558 100644 --- a/sound/soc/intel/boards/bdw_rt286.c +++ b/sound/soc/intel/boards/bdw_rt286.c @@ -108,30 +108,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"))); @@ -150,7 +126,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),