From nobody Sun Jun 14 16:28: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 5FCF2C433F5 for ; Mon, 16 May 2022 08:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241591AbiEPISu (ORCPT ); Mon, 16 May 2022 04:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241581AbiEPISt (ORCPT ); Mon, 16 May 2022 04:18:49 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C0A36E2B for ; Mon, 16 May 2022 01:18:45 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6FCD01A0475; Mon, 16 May 2022 10:18:44 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 38D331A0474; Mon, 16 May 2022 10:18:44 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id B841F180031D; Mon, 16 May 2022 16:18:42 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ASoC: fsl_sai: Add support for i.MX8MM Date: Mon, 16 May 2022 16:06:10 +0800 Message-Id: <1652688372-10274-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> References: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On i.MX8MM the max register is FSL_SAI_MCTL, which is different with previous platform, so add max_register in soc data to distinguish platforms. And add specific soc data for i.MX8MM Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam --- sound/soc/fsl/fsl_sai.c | 17 +++++++++++++++++ sound/soc/fsl/fsl_sai.h | 1 + 2 files changed, 18 insertions(+) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index ffc24afb5a7a..1ac65de094b9 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1203,6 +1203,7 @@ static const struct fsl_sai_soc_data fsl_sai_vf610_da= ta =3D { .reg_offset =3D 0, .mclk0_is_mclk1 =3D false, .flags =3D 0, + .max_register =3D FSL_SAI_RMR, }; =20 static const struct fsl_sai_soc_data fsl_sai_imx6sx_data =3D { @@ -1213,6 +1214,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx6sx_d= ata =3D { .reg_offset =3D 0, .mclk0_is_mclk1 =3D true, .flags =3D 0, + .max_register =3D FSL_SAI_RMR, }; =20 static const struct fsl_sai_soc_data fsl_sai_imx7ulp_data =3D { @@ -1223,6 +1225,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx7ulp_= data =3D { .reg_offset =3D 8, .mclk0_is_mclk1 =3D false, .flags =3D PMQOS_CPU_LATENCY, + .max_register =3D FSL_SAI_RMR, }; =20 static const struct fsl_sai_soc_data fsl_sai_imx8mq_data =3D { @@ -1233,6 +1236,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx8mq_d= ata =3D { .reg_offset =3D 8, .mclk0_is_mclk1 =3D false, .flags =3D 0, + .max_register =3D FSL_SAI_RMR, }; =20 static const struct fsl_sai_soc_data fsl_sai_imx8qm_data =3D { @@ -1243,6 +1247,18 @@ static const struct fsl_sai_soc_data fsl_sai_imx8qm_= data =3D { .reg_offset =3D 0, .mclk0_is_mclk1 =3D false, .flags =3D 0, + .max_register =3D FSL_SAI_RMR, +}; + +static const struct fsl_sai_soc_data fsl_sai_imx8mm_data =3D { + .use_imx_pcm =3D true, + .use_edma =3D false, + .fifo_depth =3D 128, + .reg_offset =3D 8, + .mclk0_is_mclk1 =3D false, + .pins =3D 8, + .flags =3D 0, + .max_register =3D FSL_SAI_MCTL, }; =20 static const struct of_device_id fsl_sai_ids[] =3D { @@ -1252,6 +1268,7 @@ static const struct of_device_id fsl_sai_ids[] =3D { { .compatible =3D "fsl,imx7ulp-sai", .data =3D &fsl_sai_imx7ulp_data }, { .compatible =3D "fsl,imx8mq-sai", .data =3D &fsl_sai_imx8mq_data }, { .compatible =3D "fsl,imx8qm-sai", .data =3D &fsl_sai_imx8qm_data }, + { .compatible =3D "fsl,imx8mm-sai", .data =3D &fsl_sai_imx8mm_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_sai_ids); diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 7310fd02cc3c..e4965efe6102 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -223,6 +223,7 @@ struct fsl_sai_soc_data { unsigned int pins; unsigned int reg_offset; unsigned int flags; + unsigned int max_register; }; =20 /** --=20 2.17.1 From nobody Sun Jun 14 16:28: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 4EFFAC433EF for ; Mon, 16 May 2022 08:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241602AbiEPITI (ORCPT ); Mon, 16 May 2022 04:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236381AbiEPISt (ORCPT ); Mon, 16 May 2022 04:18:49 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B9C36E24 for ; Mon, 16 May 2022 01:18:46 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6F68F1A0490; Mon, 16 May 2022 10:18:45 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 37F1D1A0474; Mon, 16 May 2022 10:18:45 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id B7995180219B; Mon, 16 May 2022 16:18:43 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] ASoC: fsl_sai: Add support for i.MX8M Plus Date: Mon, 16 May 2022 16:06:11 +0800 Message-Id: <1652688372-10274-3-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> References: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8M Plus specific soc data, the max register is FSL_SAI_MDIV. Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam --- sound/soc/fsl/fsl_sai.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 1ac65de094b9..b528722acd65 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1261,6 +1261,17 @@ static const struct fsl_sai_soc_data fsl_sai_imx8mm_= data =3D { .max_register =3D FSL_SAI_MCTL, }; =20 +static const struct fsl_sai_soc_data fsl_sai_imx8mp_data =3D { + .use_imx_pcm =3D true, + .use_edma =3D false, + .fifo_depth =3D 128, + .reg_offset =3D 8, + .mclk0_is_mclk1 =3D false, + .pins =3D 8, + .flags =3D 0, + .max_register =3D FSL_SAI_MDIV, +}; + static const struct of_device_id fsl_sai_ids[] =3D { { .compatible =3D "fsl,vf610-sai", .data =3D &fsl_sai_vf610_data }, { .compatible =3D "fsl,imx6sx-sai", .data =3D &fsl_sai_imx6sx_data }, @@ -1269,6 +1280,7 @@ static const struct of_device_id fsl_sai_ids[] =3D { { .compatible =3D "fsl,imx8mq-sai", .data =3D &fsl_sai_imx8mq_data }, { .compatible =3D "fsl,imx8qm-sai", .data =3D &fsl_sai_imx8qm_data }, { .compatible =3D "fsl,imx8mm-sai", .data =3D &fsl_sai_imx8mm_data }, + { .compatible =3D "fsl,imx8mp-sai", .data =3D &fsl_sai_imx8mp_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_sai_ids); --=20 2.17.1 From nobody Sun Jun 14 16:28: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 A950BC433EF for ; Mon, 16 May 2022 08:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234500AbiEPITX (ORCPT ); Mon, 16 May 2022 04:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241587AbiEPISu (ORCPT ); Mon, 16 May 2022 04:18:50 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEAE736E36 for ; Mon, 16 May 2022 01:18:47 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6B8A4200513; Mon, 16 May 2022 10:18:46 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 33F5820050C; Mon, 16 May 2022 10:18:46 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id B6ECD180031D; Mon, 16 May 2022 16:18:44 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ASoC: fsl_sai: Add support for i.MX8ULP Date: Mon, 16 May 2022 16:06:12 +0800 Message-Id: <1652688372-10274-4-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> References: <1652688372-10274-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8ULP specific soc data, the max register is FSL_SAI_RTCAP the IP version is also 0x0301, So version can't be used for the condition of register FSL_SAI_MCTL setting. Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam --- sound/soc/fsl/fsl_sai.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index b528722acd65..fa950dde5310 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1147,7 +1147,7 @@ static int fsl_sai_probe(struct platform_device *pdev) =20 /* Select MCLK direction */ if (of_find_property(np, "fsl,sai-mclk-direction-output", NULL) && - sai->verid.version >=3D 0x0301) { + sai->soc_data->max_register >=3D FSL_SAI_MCTL) { regmap_update_bits(sai->regmap, FSL_SAI_MCTL, FSL_SAI_MCTL_MCLK_EN, FSL_SAI_MCTL_MCLK_EN); } @@ -1272,6 +1272,17 @@ static const struct fsl_sai_soc_data fsl_sai_imx8mp_= data =3D { .max_register =3D FSL_SAI_MDIV, }; =20 +static const struct fsl_sai_soc_data fsl_sai_imx8ulp_data =3D { + .use_imx_pcm =3D true, + .use_edma =3D true, + .fifo_depth =3D 16, + .reg_offset =3D 8, + .mclk0_is_mclk1 =3D false, + .pins =3D 4, + .flags =3D PMQOS_CPU_LATENCY, + .max_register =3D FSL_SAI_RTCAP, +}; + static const struct of_device_id fsl_sai_ids[] =3D { { .compatible =3D "fsl,vf610-sai", .data =3D &fsl_sai_vf610_data }, { .compatible =3D "fsl,imx6sx-sai", .data =3D &fsl_sai_imx6sx_data }, @@ -1281,6 +1292,7 @@ static const struct of_device_id fsl_sai_ids[] =3D { { .compatible =3D "fsl,imx8qm-sai", .data =3D &fsl_sai_imx8qm_data }, { .compatible =3D "fsl,imx8mm-sai", .data =3D &fsl_sai_imx8mm_data }, { .compatible =3D "fsl,imx8mp-sai", .data =3D &fsl_sai_imx8mp_data }, + { .compatible =3D "fsl,imx8ulp-sai", .data =3D &fsl_sai_imx8ulp_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_sai_ids); --=20 2.17.1