From nobody Sat Apr 11 00:43:24 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75927C25B08 for ; Wed, 17 Aug 2022 12:24:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239412AbiHQMYJ (ORCPT ); Wed, 17 Aug 2022 08:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232466AbiHQMYD (ORCPT ); Wed, 17 Aug 2022 08:24:03 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A22474E8 for ; Wed, 17 Aug 2022 05:24:02 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27HBro3S026619; Wed, 17 Aug 2022 07:23:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=KbIaOF8/xfmF6NFGZtHHR2xoP917ye6MKAgaY49pSnU=; b=TAuPMQeQXRWS3CU3TTnMznrRvR8T5y1SJLFOZfEspOdi6ZRC9i/yHL47M13S7ZYjzdai DkYoj67JsdGjOGnLvREEufnf5FJrD2kALhkhbWni9YL1Zt12SFyWIkO8u1kIGhtoCWj7 T0SJlkoGGzut79f9+QAFbp0FjWzacIKjr40FeQTnY3vA1X7wWBMuzaiDY2nMORDcdUDp QUvGCYBdnDfTtiDMXsboxOCNt4QOWMvaePhPeNGdrYZiSYWrW14TJDwY/zSKN/gnyhas wuGPQSZQ9seXOr3WC8+Vsf/XtrddR+BkdwRD486h92tehCROnS8PJKxe8YauIKY8yStP 2g== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3hx8cpcueb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Aug 2022 07:23:49 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Wed, 17 Aug 2022 07:23:47 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Wed, 17 Aug 2022 07:23:47 -0500 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id ABBEA459; Wed, 17 Aug 2022 12:23:47 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 1/5] ASoC: cs42l42: Don't include kernel.h Date: Wed, 17 Aug 2022 13:23:43 +0100 Message-ID: <20220817122347.1356773-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com> References: <20220817122347.1356773-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: Q3uIgX7Sf2Dkq1TaQ0E45CcH7annyIHX X-Proofpoint-GUID: Q3uIgX7Sf2Dkq1TaQ0E45CcH7annyIHX X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" kernel.h includes a lot of other headers that we don't need. Replace with an include of types.h. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs42l42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index daafd4251ce6..9032dd1b9d57 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include --=20 2.30.2 From nobody Sat Apr 11 00:43:24 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9568AC25B08 for ; Wed, 17 Aug 2022 12:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239440AbiHQMYU (ORCPT ); Wed, 17 Aug 2022 08:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbiHQMYH (ORCPT ); Wed, 17 Aug 2022 08:24:07 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FBD84B0C0 for ; Wed, 17 Aug 2022 05:24:06 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27HBro3T026619; Wed, 17 Aug 2022 07:23:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=xQ3qvl9IMuy/CeupuXMZunDSLtXwsJGURkPujaWBUU0=; b=XFSQX9Yr+vUpg5KZK/AbF+IOT2pQDvuD90KZj38i7U5pZNgzXfuEZWyAnUyPMFoDMvxn 98wkx0fGurxAXcvuJsAoJjRiTClgT4R+o/683GtzGHK1lti8/oTyl+lzPO5xi4ClUpAI +UjEZkep3lTNna9pv4LSxd+xPAs6TpfJxaOwzzYFG52J5vNzAiINXxoc64LaDKplkL+P EkSwskT6KBSkhSIDSH5SzAhf16ncax326NjDOOR5h5AZIlLhfpnVqr8VvSDAew1XdM0L VQ3PdQWrwVKLc7dbw2GWrPkrNtn73fk0Vxp/kNW1YOHZ8HzBviXMvTVCM+A+TRlif5mo UQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3hx8cpcueb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Aug 2022 07:23:50 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Wed, 17 Aug 2022 07:23:47 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Wed, 17 Aug 2022 07:23:47 -0500 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id B9BE6B0E; Wed, 17 Aug 2022 12:23:47 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 2/5] ASoC: cs42l42: Add include dependencies to cs42l42.h Date: Wed, 17 Aug 2022 13:23:44 +0100 Message-ID: <20220817122347.1356773-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com> References: <20220817122347.1356773-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: A17s6qErAzGztvenkHtPWOst6oX6nLOc X-Proofpoint-GUID: A17s6qErAzGztvenkHtPWOst6oX6nLOc X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Make cs42l42.h include the other headers it depends on instead of assuming that the .c file already included them. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs42l42.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 5f50970375d4..1d53e0e050ee 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -12,7 +12,12 @@ #ifndef __CS42L42_H__ #define __CS42L42_H__ =20 +#include +#include +#include #include +#include +#include #include #include =20 --=20 2.30.2 From nobody Sat Apr 11 00:43:24 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F092C25B08 for ; Wed, 17 Aug 2022 12:24:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238933AbiHQMYG (ORCPT ); Wed, 17 Aug 2022 08:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbiHQMYD (ORCPT ); Wed, 17 Aug 2022 08:24:03 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 441B62B262 for ; Wed, 17 Aug 2022 05:24:02 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27H4vLJc010755; Wed, 17 Aug 2022 07:23:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=lO393XigoXWuen3e1+IceJwVClmyWkbjIZ9xxN7eD9M=; b=DXyyN87Y0mAuH2l4kovn8y2DTV6aCI8HxCMcInIa73X0U7Unp/cDh8XqO33cdHzfrTeE wg43yrKne+J+mzl+0Lhub9DBk6Liz+1wP2tlI+wCA+tRcLI7uZhGHNk8u8o4TTHxuhS9 Asd+eU8z+2/QElScMsaB3BhXHbfaUvp/xhsDRuwG1U3h/alO2+Wvh8ckX3mw5fuS3Z9d CwsDYssEOk7DeuSm54bPvCHJRleIxCu/K0Q2jxhThw2gfWWzuqbmNynRAjl24XOnR9gs kvwqcQENoVPseQ8lxB7Kpk2ZDQkjlrc9sbb2S7TCKv6QSOsEP491mkedQDQ+ADnawe1l DQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3hx8cpcuec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Aug 2022 07:23:49 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Wed, 17 Aug 2022 07:23:47 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Wed, 17 Aug 2022 07:23:47 -0500 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C967BB16; Wed, 17 Aug 2022 12:23:47 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 3/5] ASoC: cs42l42: Move cs42l42_supply_names to .c file Date: Wed, 17 Aug 2022 13:23:45 +0100 Message-ID: <20220817122347.1356773-4-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com> References: <20220817122347.1356773-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: ec7B2zCY3qquCT20rsfPwX-rRGgaLeyG X-Proofpoint-GUID: ec7B2zCY3qquCT20rsfPwX-rRGgaLeyG X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The array of supply name strings doesn't need to be in the header file. Move it to the .c file. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs42l42.c | 9 +++++++++ sound/soc/codecs/cs42l42.h | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 9032dd1b9d57..2235c17a0247 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -37,6 +37,14 @@ #include "cs42l42.h" #include "cirrus_legacy.h" =20 +static const char * const cs42l42_supply_names[] =3D { + "VA", + "VP", + "VCP", + "VD_FILT", + "VL", +}; + static const struct reg_default cs42l42_reg_defaults[] =3D { { CS42L42_FRZ_CTL, 0x00 }, { CS42L42_SRC_CTL, 0x10 }, @@ -2215,6 +2223,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_c= lient) return ret; } =20 + BUILD_BUG_ON(ARRAY_SIZE(cs42l42_supply_names) !=3D ARRAY_SIZE(cs42l42->su= pplies)); for (i =3D 0; i < ARRAY_SIZE(cs42l42->supplies); i++) cs42l42->supplies[i].supply =3D cs42l42_supply_names[i]; =20 diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 1d53e0e050ee..50299c9f283a 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -21,14 +21,6 @@ #include #include =20 -static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] =3D { - "VA", - "VP", - "VCP", - "VD_FILT", - "VL", -}; - struct cs42l42_private { struct regmap *regmap; struct device *dev; --=20 2.30.2 From nobody Sat Apr 11 00:43:24 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 328BEC25B08 for ; Wed, 17 Aug 2022 12:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239425AbiHQMYO (ORCPT ); Wed, 17 Aug 2022 08:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234850AbiHQMYD (ORCPT ); Wed, 17 Aug 2022 08:24:03 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3E9491DF for ; Wed, 17 Aug 2022 05:24:03 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27HBro3U026619; Wed, 17 Aug 2022 07:23:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=hw05yTEBpCg1eF0uoWUssozLZPLdtapR5617P3hmzbM=; b=YZiK07evJYppCnBQN9ZiRked6cN4KMt0pzYaPN9bmvH7ln9CvJMl/o5bZ9OX+IC8NbGy 6aF6VchooEOqm3nocHdBPS5inmIfn4rpWP4MpIh62jMbUIH2QbRYKOMSduVxu61AQyii nTEiftPGCWPPkA+N54Ae1bfeEpRr5kl5pBqtfFgYSh48RzfA+Gmk3s4xVgL1MnvwSf5e BSE5EasqGgThwj7X49Nr1Y+kPAbZs2m9bax+zMMGypMFDNoTtOovd/4w8PJIcL9F0qkY HUt5rGFsapHBoZ5qbQ65pirbiHb/YFNMmzTXHUyvZEfd1mwbfu+u0M2cT2go4QsR8P2Q uw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3hx8cpcueb-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Aug 2022 07:23:51 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Wed, 17 Aug 2022 07:23:47 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Wed, 17 Aug 2022 07:23:47 -0500 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D7EFD7C; Wed, 17 Aug 2022 12:23:47 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 4/5] ASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put() Date: Wed, 17 Aug 2022 13:23:46 +0100 Message-ID: <20220817122347.1356773-5-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com> References: <20220817122347.1356773-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: bwlO0wCL2w4iOvtaaE1caDFVOCu5u-HZ X-Proofpoint-GUID: bwlO0wCL2w4iOvtaaE1caDFVOCu5u-HZ X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix "much change together" to "must change together". It's probably obvious what was meant but it's nice to fix it. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs42l42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 2235c17a0247..a84d873e29df 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -403,7 +403,7 @@ static int cs42l42_slow_start_put(struct snd_kcontrol *= kcontrol, struct snd_soc_component *component =3D snd_soc_kcontrol_component(kcontr= ol); u8 val; =20 - /* all bits of SLOW_START_EN much change together */ + /* all bits of SLOW_START_EN must change together */ switch (ucontrol->value.integer.value[0]) { case 0: val =3D 0; --=20 2.30.2 From nobody Sat Apr 11 00:43:24 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C17E0C25B08 for ; Wed, 17 Aug 2022 12:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239431AbiHQMYQ (ORCPT ); Wed, 17 Aug 2022 08:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235563AbiHQMYE (ORCPT ); Wed, 17 Aug 2022 08:24:04 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 094642B262 for ; Wed, 17 Aug 2022 05:24:03 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27H4vLJd010755; Wed, 17 Aug 2022 07:23:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=fo2EGunu8bsAB6527X+mSVSKQLth99Br3x4ca9Xnrow=; b=ZsG/wqn2+bIrzzJP+t/OZPsPnDjqMJZEvcfh5PZdvKYjLfCGHzTeNQQbhd3yCjFJkB98 kYpzqSPDZrQUVqkWj1QCRqCpOjIFNgwG9AFpJ8ijEPq+MnVbjIQINEQGU/XuFvCOY9mR iTbPLaqx25BkbW4Kbf75fZhVsEwIJqm/SPmMkdajZ11ZLl6rVMttEU8hbrOLwyxPJrQI rXRCqNaNai/rWlLQx0+vHdOAarqrDijumXq8cOudmblUJv4Uypl5XAWoWW88DiPjikvj EYINjpUeUselpDIq5JYVTI7MtfE8CDXfOlmc1DGDH63IFOMJf3rzcjf35jNlJoJnCWlG XQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3hx8cpcuec-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Aug 2022 07:23:49 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Wed, 17 Aug 2022 07:23:47 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Wed, 17 Aug 2022 07:23:47 -0500 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id E8290459; Wed, 17 Aug 2022 12:23:47 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 5/5] ASoC: cs42l42: Use snd_soc_tdm_params_to_bclk() Date: Wed, 17 Aug 2022 13:23:47 +0100 Message-ID: <20220817122347.1356773-6-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com> References: <20220817122347.1356773-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: i55BiZiuETI5FMbZ4F4wNDydevJOqvag X-Proofpoint-GUID: i55BiZiuETI5FMbZ4F4wNDydevJOqvag X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use the new snd_soc_tdm_params_to_bclk() helper function to calculate the bclk. This function handles most of the previous manipulation and makes the code tidier. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs42l42.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index a84d873e29df..42cdb051e0fb 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -893,22 +893,21 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_subst= ream *substream, struct cs42l42_private *cs42l42 =3D snd_soc_component_get_drvdata(compone= nt); unsigned int channels =3D params_channels(params); unsigned int width =3D (params_width(params) / 8) - 1; + unsigned int slot_width =3D 0; unsigned int val =3D 0; int ret; =20 cs42l42->srate =3D params_rate(params); - cs42l42->bclk =3D snd_soc_params_to_bclk(params); - - /* I2S frame always has 2 channels even for mono audio */ - if (channels =3D=3D 1) - cs42l42->bclk *=3D 2; =20 /* * Assume 24-bit samples are in 32-bit slots, to prevent SCLK being * more than assumed (which would result in overclocking). */ if (params_width(params) =3D=3D 24) - cs42l42->bclk =3D (cs42l42->bclk / 3) * 4; + slot_width =3D 32; + + /* I2S frame always has multiple of 2 channels */ + cs42l42->bclk =3D snd_soc_tdm_params_to_bclk(params, slot_width, 0, 2); =20 switch (substream->stream) { case SNDRV_PCM_STREAM_CAPTURE: --=20 2.30.2