From patchwork Tue Apr 2 02:23:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 785190 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 87D25CD1288 for ; Tue, 2 Apr 2024 02:24:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B26641629; Tue, 2 Apr 2024 04:24:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B26641629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712024677; bh=imr6LLdepZU7O3oyZ8k24EkLEf4w7YVaQb5SkLhCvYg=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=O6qvTsZAeVH529aQc2TKk3x/iaderL14VJou8rTMzKgofyK44ZFVXdZWawFuxpXZE CNLrYJze06lPXB1etjwmYqNwAW2HecWLfpD8aq8OiD6GzDLVzYk6RsI7vA+iOnnVqb huzkNRivvK1fmNnzzo7rsqaoUJzOAsckg2lbZcio= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0AD8BF805C0; Tue, 2 Apr 2024 04:24:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 82048F805C7; Tue, 2 Apr 2024 04:24:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5219DF8056F; Tue, 2 Apr 2024 04:24:03 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (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 86B3DF8020D for ; Tue, 2 Apr 2024 04:24:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 86B3DF8020D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=VgIgjSw7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jE4abYjpLk0uJJOGLDua3UM5R6Y/l1SiLQ/gOybW0PH5pfDZYx9tmTQnIRMyQBj+CtSmQNQ76PHvynlhikP5z267i439Khzd7uzCfv5vk612fgTsQe5+9WkwFsrnCH6HfMGI/qBzH1bcXnZqyI+NXKFxyJhrA9z/l3iD440WmltT5hvtR3Fk1nBQ0WJYskIwp2Ze5bawYd3oJ7bQ2mYdQS1V/p43Fg6vtt14f3HjYp+U2XpmBhYBl/TW2pJblJtlObiJ6n54T1tcDh1+3YuuTRcXkv+CltUbci04a3wAT5oz+f6sZB7o6DD5mHG2kOlqFQqo8DyNQeJlEbmoDupp7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7/ucwcPvxY7Z60g819eDci6fkhK6+purnpVXXwICTZk=; b=cHTXfv5ZUvK+Uk5LGJor7Fy+Fjg6Xh6QErqw8ZTKhlP6WUtWGI4L+j+Hngjlu4Hgs26sOCl2CEtWKgEednOb48g681l6LG/q8ADPGd7q6zf1gBFXCut0KpJo37d1ViATXOM9gnNnKjPtcwts+UBRB12EdjpxdbSCEhM5NL4jU2RmZfyHmYsDwQc3MM9ogSQ0JVQ5S7aX9WaDQ5ylxgneYDL+kGtYl5tjNsDhv3LSICbsRmdrEdWZa3b70X+pKo1MM21nhil2tXqwaG+XF+mW1pE9NbvP2/2j7YuBvnQ5mqRCISakaT4jk9X2Y4zSEOx5tPlhHRcg2LW/YknFlKGmtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7/ucwcPvxY7Z60g819eDci6fkhK6+purnpVXXwICTZk=; b=VgIgjSw7/OFOjEhaU3nPw+hQYFWUcs7XznDSz3dd6eqGWwIpUgmPk8fKOjxKjF3N2unsWXcHcNgrexvilwRIPgIobM8zfHB1iUItNRRRza8fp1xVioNfA3aWdS1oz8EYi0wgi+NwSO0U+kjIru7KiU1uqoKLOrZ6h31YiY+pU5w= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB5959.jpnprd01.prod.outlook.com (2603:1096:604:d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Tue, 2 Apr 2024 02:23:54 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Tue, 2 Apr 2024 02:23:54 +0000 Message-ID: <871q7obiyt.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown Cc: Linux-ALSA , Khanh Le In-Reply-To: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> References: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/5] ASoC: rsnd: cleanup regmap table Date: Tue, 2 Apr 2024 02:23:54 +0000 X-ClientProxiedBy: TYCP286CA0146.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::11) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB5959:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZZXKDVNsDSqFLuFp3PGvIB59u9BaYA3OlzuVygAUIml3t+j63D9GETQ8rATc4haH0WVw87HP3JRu0DN4kgDITZyDlNq5l0f2jv4VDpxBwzpD3VsAgC9/TbEg2OYApS3GmquZHpOHWUmco0s5+BPPzZJT/tiGfcaCull5509EnDOy5xGaaQZ3imeXCZ6qK3onzntq5hreOqVmBB0e1sNoCx7xrnPW4QAXSjqjM4aLJtb90zXgciPGy6+vP/j2UOxPg+ed3DlFrr4UiCqqemV7NS1BssVh7iYzcFbP9GJFnnghMqx67iejm12V+k3QuAk4tJFRUieHjycz2IF7amQO8iDAQIXblgt1j5bvh36XxHsD96DF6xNrQvpYLnE+kstTKsFi6tOmbDauNur9btZzIc8URFApHjCCCM7bpgBwA8QVJQszoR26QeUIjonupWjRj2S+LNA4zo57YvQ1axmIvDhk5rvQhKAAQxWHBfwEUGi6+klXfuBh3vhbRdU7U1arqYB5P6aTWiTSAOCb7oo7FqNz+dF8IM52PImncTrZob8NzLQE8L3Z8h1chJG3LMZU7CmXefRNqVUsJqfjMgb11u+0BAviYCFOBExGrjzkbzwyWuBIHyeC95SEI2SoW0AcV8cFmWZq+pojpCEJEr7aJLRIjYkevBI9a3jvNtvMvvbQ7U/vHKIX5b3YY8YgeEmYwasE9S5yE1QzHFaUBGUrzmfdx/OYhrqn0WxLEzMdXY8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(52116005)(1800799015)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rFsAI9xGAJwxH9qo2ds57/AvR0dIwKQEBUkr3PSoabqiEbPFYmjm/waqtKsRcqSYde+3NqWEWI1LWYOnbxZB8I9F3sBkBf7bU3EylPzBaOJ/dezaWDrIbvq7wnOTay06Im4KnGYczY5jIIjPpozxDFaDSwcwCqyrdyPeDPNBHr3TIJguBnhpQ2Vv3JavJzb2/LjOr7eU07LHoydoHrJg7hcqJKZHunfOj3Rm07Qw87+csb/QX3NhTdIwT+5bOM8QnJT45e0Tu2ozN/bHGtc84pnGkWf83afvTXmTmOhF1cgcZ4QWl/l6mVwXSWrfoYFDirSl9Xdq6G/GZ6SjUVIzfkLe0dWgtkzWud0MR+m5eiVqxE/WGL97ukP2hZBhyE8wg2bu7Meb2+eKQevV+doWRULZ41+mIyffFYaYkMgiXBTbrxKgPY0DgOkF66n9rVLSLYrT1bvbcbQMtiK2YqvY9s0fB2WiEnZq7XOB56M01syKRPamNXh9Szti782CbL3Yn2XzJoXhUYNe/t7T7kU1+d0TSFQg2IoIzQ2Nc0JNwKG9CIBsBbR1U5oAbL3VO7EhhLr/meo/xUd47RUxpdxx8383zwoJJBTNL4NTgFYPvqyxc8m0f/e9a64ZPUmNii4krMAFhBpdwZfZvU1GwDd6Z5o3fXaUBhAQqzwjqMeDFpWM4g76ppj6Ojs5qkqT3KlF/ARY0VDqxg9Wtys4tdJF0OXNfhGLUh/5GxjcwtDrBWnSExSLY+AnP6nWt0SSs4QP9WZ7VhlFq3awMmtxTRubenN3nwYAv60Xei/5m60ZC64ZYMEMvDvdyiMBHMi68OW6DZP1RVIN7ScjN40rjM9Y0pVPGY7vS2CTry/87TyO46qIn6eUhNpClmHaJLKV4EbbdYfq/n3ZSVLNHHj5m1WY9dLNApRreFgCvUAOvkHx5A3EHdhtmjpy8K5jm6reN3sWoVdhhUx5vVQrk4VNXx1lBjXZxzOU87bsLkzujtd/oHagqBbiDyYH++aKvzsSlvvITcHmAxy0hg4d/6eMaEAqimKrYObF/mqEsPT72peMocjAtfexAcXs5G+Ec+wWOiDCVFzJIWr3KeVYX/9o/Pmd/x2rhOwiwRicL6nYSsbl72QfnxqkYmxVaJ3klaXua79iBEDwP3pyW554xpGnNPvRtRNYwmoTK/NVcLeOCBOTkEKv9t3PNxr/a/B3EVSDDwzFswG02bVIFk57RSgZ5KE35ngTkvC+SKNK6hDbsUtwu7rOwDMrqytFJscuKy3jaFbb2ZuVLEmzK8tzehhehx5Gnz0wqqK9jxzx+t1zoh4hzeO8o1jhurBdPHS3wUx/TVKKlq4pBkfjPEELyoJayxugGiM2XzuGQq0X1Hpt3MouxYXwxzSE8emuRGbIQpZ5B8hCMB4997xnu8MCSb1AfHSumS+WR7R6jsb6C7/Ygj59BFoJ5KuLxvooYM85w4fwT29wN3/HM7R/yVBOkXIOMNGDDC1tL0ibbz05+JcRztQZ+vMl4fK4QbrWFpEGeC49wwqKtGmKnekrw80NrEQhHeSbF1n/BGrrWcKtyVjdcyrgkCL1cFLvj946A0EE4fQ9QzJltkLPAPRiovU9En6Hy3WoQl14bkUIuSwwpO1QnovuWYo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a59d40d-b686-4b91-53ac-08dc52bbf19b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 02:23:54.7632 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rgjlR8Pv+0940BKLF4+hQ4yol8sDHm+U9BARFmKU4G7SfhHX+olni+P6ZjwfcQ0cJbQOE/epGdJev+IkCyoQMVgOKbzbxzKPWeJKfo1dAkQqjeY0ofnLtz6GaAgddlA6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5959 Message-ID-Hash: CXFC6TB53UVFSTKCVKBC75NL6Q4GZVPN X-Message-ID-Hash: CXFC6TB53UVFSTKCVKBC75NL6Q4GZVPN X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: R-Car Sound is using almost same register mapping on each generation, therefore we can share it. Here indicates some memo/comments. SSI/SSIU/SCU have multi channels (SSI0 - SSI9 etc), but ADG is single, so, we don't need to have multi channel settings for it - rsnd_gen_regmap_init(..., 10, ..ADG, ...); + rsnd_gen_regmap_init(..., 1, ..ADG, ...); Gen4 added new SSI_BUSIF, but it is not used Gen4 calls rsnd_gen_regmap_init() for SDMC, but the address is calculated by rsnd_gen4_dma_addr(). It needs physical address, but other info are not needed. use NULL conf for it. - rsnd_gen_regmap_init(..., 10, ..SDMC, conf_sdmc); + rsnd_gen_regmap_init(..., 1, ..SDMC, conf_null); Gen4 have only SSI0/SSIU0, we don't need to have multi channel settings. - rsnd_gen_regmap_init(..., 10, ..SSI, ...); + rsnd_gen_regmap_init(..., 1, ..SSI, ...); SSI_MODE2 address is different between Gen2/3 and Gen4, but it is not used on Gen4. Thus we can share same regmap table. Gen2/3 : 0x808 Gen4 : 0xa0c Signed-off-by: Kuninori Morimoto Tested-by: Khanh Le --- sound/soc/sh/rcar/gen.c | 517 +++++++++++++++++---------------------- sound/soc/sh/rcar/rsnd.h | 1 - 2 files changed, 226 insertions(+), 292 deletions(-) diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 86bdecc24956..e566712e5234 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -215,70 +215,220 @@ static int _rsnd_gen_regmap_init(struct rsnd_priv *priv, return 0; } +/* + * (A) : Gen4 is 0xa0c, but it is not used. + * see + * rsnd_ssiu_init() + */ +static const struct rsnd_regmap_field_conf conf_common_ssiu[] = { + RSND_GEN_S_REG(SSI_MODE0, 0x800), + RSND_GEN_S_REG(SSI_MODE1, 0x804), + RSND_GEN_S_REG(SSI_MODE2, 0x808), // (A) + RSND_GEN_S_REG(SSI_CONTROL, 0x810), + RSND_GEN_S_REG(SSI_SYS_STATUS0, 0x840), + RSND_GEN_S_REG(SSI_SYS_STATUS1, 0x844), + RSND_GEN_S_REG(SSI_SYS_STATUS2, 0x848), + RSND_GEN_S_REG(SSI_SYS_STATUS3, 0x84c), + RSND_GEN_S_REG(SSI_SYS_STATUS4, 0x880), + RSND_GEN_S_REG(SSI_SYS_STATUS5, 0x884), + RSND_GEN_S_REG(SSI_SYS_STATUS6, 0x888), + RSND_GEN_S_REG(SSI_SYS_STATUS7, 0x88c), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE1, 0x854), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE3, 0x85c), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE5, 0x894), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898), + RSND_GEN_S_REG(SSI_SYS_INT_ENABLE7, 0x89c), + RSND_GEN_S_REG(HDMI0_SEL, 0x9e0), + RSND_GEN_S_REG(HDMI1_SEL, 0x9e4), + RSND_GEN_M_REG(SSI_BUSIF0_MODE, 0x0, 0x80), + RSND_GEN_M_REG(SSI_BUSIF0_ADINR, 0x4, 0x80), + RSND_GEN_M_REG(SSI_BUSIF0_DALIGN, 0x8, 0x80), + RSND_GEN_M_REG(SSI_BUSIF1_MODE, 0x20, 0x80), + RSND_GEN_M_REG(SSI_BUSIF1_ADINR, 0x24, 0x80), + RSND_GEN_M_REG(SSI_BUSIF1_DALIGN, 0x28, 0x80), + RSND_GEN_M_REG(SSI_BUSIF2_MODE, 0x40, 0x80), + RSND_GEN_M_REG(SSI_BUSIF2_ADINR, 0x44, 0x80), + RSND_GEN_M_REG(SSI_BUSIF2_DALIGN, 0x48, 0x80), + RSND_GEN_M_REG(SSI_BUSIF3_MODE, 0x60, 0x80), + RSND_GEN_M_REG(SSI_BUSIF3_ADINR, 0x64, 0x80), + RSND_GEN_M_REG(SSI_BUSIF3_DALIGN, 0x68, 0x80), + RSND_GEN_M_REG(SSI_BUSIF4_MODE, 0x500, 0x80), + RSND_GEN_M_REG(SSI_BUSIF4_ADINR, 0x504, 0x80), + RSND_GEN_M_REG(SSI_BUSIF4_DALIGN, 0x508, 0x80), + RSND_GEN_M_REG(SSI_BUSIF5_MODE, 0x520, 0x80), + RSND_GEN_M_REG(SSI_BUSIF5_ADINR, 0x524, 0x80), + RSND_GEN_M_REG(SSI_BUSIF5_DALIGN, 0x528, 0x80), + RSND_GEN_M_REG(SSI_BUSIF6_MODE, 0x540, 0x80), + RSND_GEN_M_REG(SSI_BUSIF6_ADINR, 0x544, 0x80), + RSND_GEN_M_REG(SSI_BUSIF6_DALIGN, 0x548, 0x80), + RSND_GEN_M_REG(SSI_BUSIF7_MODE, 0x560, 0x80), + RSND_GEN_M_REG(SSI_BUSIF7_ADINR, 0x564, 0x80), + RSND_GEN_M_REG(SSI_BUSIF7_DALIGN, 0x568, 0x80), + RSND_GEN_M_REG(SSI_MODE, 0xc, 0x80), + RSND_GEN_M_REG(SSI_CTRL, 0x10, 0x80), + RSND_GEN_M_REG(SSI_INT_ENABLE, 0x18, 0x80), + RSND_GEN_S_REG(SSI9_BUSIF0_MODE, 0x48c), + RSND_GEN_S_REG(SSI9_BUSIF0_ADINR, 0x484), + RSND_GEN_S_REG(SSI9_BUSIF0_DALIGN, 0x488), + RSND_GEN_S_REG(SSI9_BUSIF1_MODE, 0x4a0), + RSND_GEN_S_REG(SSI9_BUSIF1_ADINR, 0x4a4), + RSND_GEN_S_REG(SSI9_BUSIF1_DALIGN, 0x4a8), + RSND_GEN_S_REG(SSI9_BUSIF2_MODE, 0x4c0), + RSND_GEN_S_REG(SSI9_BUSIF2_ADINR, 0x4c4), + RSND_GEN_S_REG(SSI9_BUSIF2_DALIGN, 0x4c8), + RSND_GEN_S_REG(SSI9_BUSIF3_MODE, 0x4e0), + RSND_GEN_S_REG(SSI9_BUSIF3_ADINR, 0x4e4), + RSND_GEN_S_REG(SSI9_BUSIF3_DALIGN, 0x4e8), + RSND_GEN_S_REG(SSI9_BUSIF4_MODE, 0xd80), + RSND_GEN_S_REG(SSI9_BUSIF4_ADINR, 0xd84), + RSND_GEN_S_REG(SSI9_BUSIF4_DALIGN, 0xd88), + RSND_GEN_S_REG(SSI9_BUSIF5_MODE, 0xda0), + RSND_GEN_S_REG(SSI9_BUSIF5_ADINR, 0xda4), + RSND_GEN_S_REG(SSI9_BUSIF5_DALIGN, 0xda8), + RSND_GEN_S_REG(SSI9_BUSIF6_MODE, 0xdc0), + RSND_GEN_S_REG(SSI9_BUSIF6_ADINR, 0xdc4), + RSND_GEN_S_REG(SSI9_BUSIF6_DALIGN, 0xdc8), + RSND_GEN_S_REG(SSI9_BUSIF7_MODE, 0xde0), + RSND_GEN_S_REG(SSI9_BUSIF7_ADINR, 0xde4), + RSND_GEN_S_REG(SSI9_BUSIF7_DALIGN, 0xde8), +}; + +static const struct rsnd_regmap_field_conf conf_common_scu[] = { + RSND_GEN_M_REG(SRC_I_BUSIF_MODE, 0x0, 0x20), + RSND_GEN_M_REG(SRC_O_BUSIF_MODE, 0x4, 0x20), + RSND_GEN_M_REG(SRC_BUSIF_DALIGN, 0x8, 0x20), + RSND_GEN_M_REG(SRC_ROUTE_MODE0, 0xc, 0x20), + RSND_GEN_M_REG(SRC_CTRL, 0x10, 0x20), + RSND_GEN_M_REG(SRC_INT_ENABLE0, 0x18, 0x20), + RSND_GEN_M_REG(CMD_BUSIF_MODE, 0x184, 0x20), + RSND_GEN_M_REG(CMD_BUSIF_DALIGN, 0x188, 0x20), + RSND_GEN_M_REG(CMD_ROUTE_SLCT, 0x18c, 0x20), + RSND_GEN_M_REG(CMD_CTRL, 0x190, 0x20), + RSND_GEN_S_REG(SCU_SYS_STATUS0, 0x1c8), + RSND_GEN_S_REG(SCU_SYS_INT_EN0, 0x1cc), + RSND_GEN_S_REG(SCU_SYS_STATUS1, 0x1d0), + RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1d4), + RSND_GEN_M_REG(SRC_SWRSR, 0x200, 0x40), + RSND_GEN_M_REG(SRC_SRCIR, 0x204, 0x40), + RSND_GEN_M_REG(SRC_ADINR, 0x214, 0x40), + RSND_GEN_M_REG(SRC_IFSCR, 0x21c, 0x40), + RSND_GEN_M_REG(SRC_IFSVR, 0x220, 0x40), + RSND_GEN_M_REG(SRC_SRCCR, 0x224, 0x40), + RSND_GEN_M_REG(SRC_BSDSR, 0x22c, 0x40), + RSND_GEN_M_REG(SRC_BSISR, 0x238, 0x40), + RSND_GEN_M_REG(CTU_SWRSR, 0x500, 0x100), + RSND_GEN_M_REG(CTU_CTUIR, 0x504, 0x100), + RSND_GEN_M_REG(CTU_ADINR, 0x508, 0x100), + RSND_GEN_M_REG(CTU_CPMDR, 0x510, 0x100), + RSND_GEN_M_REG(CTU_SCMDR, 0x514, 0x100), + RSND_GEN_M_REG(CTU_SV00R, 0x518, 0x100), + RSND_GEN_M_REG(CTU_SV01R, 0x51c, 0x100), + RSND_GEN_M_REG(CTU_SV02R, 0x520, 0x100), + RSND_GEN_M_REG(CTU_SV03R, 0x524, 0x100), + RSND_GEN_M_REG(CTU_SV04R, 0x528, 0x100), + RSND_GEN_M_REG(CTU_SV05R, 0x52c, 0x100), + RSND_GEN_M_REG(CTU_SV06R, 0x530, 0x100), + RSND_GEN_M_REG(CTU_SV07R, 0x534, 0x100), + RSND_GEN_M_REG(CTU_SV10R, 0x538, 0x100), + RSND_GEN_M_REG(CTU_SV11R, 0x53c, 0x100), + RSND_GEN_M_REG(CTU_SV12R, 0x540, 0x100), + RSND_GEN_M_REG(CTU_SV13R, 0x544, 0x100), + RSND_GEN_M_REG(CTU_SV14R, 0x548, 0x100), + RSND_GEN_M_REG(CTU_SV15R, 0x54c, 0x100), + RSND_GEN_M_REG(CTU_SV16R, 0x550, 0x100), + RSND_GEN_M_REG(CTU_SV17R, 0x554, 0x100), + RSND_GEN_M_REG(CTU_SV20R, 0x558, 0x100), + RSND_GEN_M_REG(CTU_SV21R, 0x55c, 0x100), + RSND_GEN_M_REG(CTU_SV22R, 0x560, 0x100), + RSND_GEN_M_REG(CTU_SV23R, 0x564, 0x100), + RSND_GEN_M_REG(CTU_SV24R, 0x568, 0x100), + RSND_GEN_M_REG(CTU_SV25R, 0x56c, 0x100), + RSND_GEN_M_REG(CTU_SV26R, 0x570, 0x100), + RSND_GEN_M_REG(CTU_SV27R, 0x574, 0x100), + RSND_GEN_M_REG(CTU_SV30R, 0x578, 0x100), + RSND_GEN_M_REG(CTU_SV31R, 0x57c, 0x100), + RSND_GEN_M_REG(CTU_SV32R, 0x580, 0x100), + RSND_GEN_M_REG(CTU_SV33R, 0x584, 0x100), + RSND_GEN_M_REG(CTU_SV34R, 0x588, 0x100), + RSND_GEN_M_REG(CTU_SV35R, 0x58c, 0x100), + RSND_GEN_M_REG(CTU_SV36R, 0x590, 0x100), + RSND_GEN_M_REG(CTU_SV37R, 0x594, 0x100), + RSND_GEN_M_REG(MIX_SWRSR, 0xd00, 0x40), + RSND_GEN_M_REG(MIX_MIXIR, 0xd04, 0x40), + RSND_GEN_M_REG(MIX_ADINR, 0xd08, 0x40), + RSND_GEN_M_REG(MIX_MIXMR, 0xd10, 0x40), + RSND_GEN_M_REG(MIX_MVPDR, 0xd14, 0x40), + RSND_GEN_M_REG(MIX_MDBAR, 0xd18, 0x40), + RSND_GEN_M_REG(MIX_MDBBR, 0xd1c, 0x40), + RSND_GEN_M_REG(MIX_MDBCR, 0xd20, 0x40), + RSND_GEN_M_REG(MIX_MDBDR, 0xd24, 0x40), + RSND_GEN_M_REG(MIX_MDBER, 0xd28, 0x40), + RSND_GEN_M_REG(DVC_SWRSR, 0xe00, 0x100), + RSND_GEN_M_REG(DVC_DVUIR, 0xe04, 0x100), + RSND_GEN_M_REG(DVC_ADINR, 0xe08, 0x100), + RSND_GEN_M_REG(DVC_DVUCR, 0xe10, 0x100), + RSND_GEN_M_REG(DVC_ZCMCR, 0xe14, 0x100), + RSND_GEN_M_REG(DVC_VRCTR, 0xe18, 0x100), + RSND_GEN_M_REG(DVC_VRPDR, 0xe1c, 0x100), + RSND_GEN_M_REG(DVC_VRDBR, 0xe20, 0x100), + RSND_GEN_M_REG(DVC_VOL0R, 0xe28, 0x100), + RSND_GEN_M_REG(DVC_VOL1R, 0xe2c, 0x100), + RSND_GEN_M_REG(DVC_VOL2R, 0xe30, 0x100), + RSND_GEN_M_REG(DVC_VOL3R, 0xe34, 0x100), + RSND_GEN_M_REG(DVC_VOL4R, 0xe38, 0x100), + RSND_GEN_M_REG(DVC_VOL5R, 0xe3c, 0x100), + RSND_GEN_M_REG(DVC_VOL6R, 0xe40, 0x100), + RSND_GEN_M_REG(DVC_VOL7R, 0xe44, 0x100), + RSND_GEN_M_REG(DVC_DVUER, 0xe48, 0x100), +}; + +static const struct rsnd_regmap_field_conf conf_common_adg[] = { + RSND_GEN_S_REG(BRRA, 0x00), + RSND_GEN_S_REG(BRRB, 0x04), + RSND_GEN_S_REG(BRGCKR, 0x08), + RSND_GEN_S_REG(AUDIO_CLK_SEL0, 0x0c), + RSND_GEN_S_REG(AUDIO_CLK_SEL1, 0x10), + RSND_GEN_S_REG(AUDIO_CLK_SEL2, 0x14), + RSND_GEN_S_REG(DIV_EN, 0x30), + RSND_GEN_S_REG(SRCIN_TIMSEL0, 0x34), + RSND_GEN_S_REG(SRCIN_TIMSEL1, 0x38), + RSND_GEN_S_REG(SRCIN_TIMSEL2, 0x3c), + RSND_GEN_S_REG(SRCIN_TIMSEL3, 0x40), + RSND_GEN_S_REG(SRCIN_TIMSEL4, 0x44), + RSND_GEN_S_REG(SRCOUT_TIMSEL0, 0x48), + RSND_GEN_S_REG(SRCOUT_TIMSEL1, 0x4c), + RSND_GEN_S_REG(SRCOUT_TIMSEL2, 0x50), + RSND_GEN_S_REG(SRCOUT_TIMSEL3, 0x54), + RSND_GEN_S_REG(SRCOUT_TIMSEL4, 0x58), + RSND_GEN_S_REG(CMDOUT_TIMSEL, 0x5c), +}; + +static const struct rsnd_regmap_field_conf conf_common_ssi[] = { + RSND_GEN_M_REG(SSICR, 0x00, 0x40), + RSND_GEN_M_REG(SSISR, 0x04, 0x40), + RSND_GEN_M_REG(SSITDR, 0x08, 0x40), + RSND_GEN_M_REG(SSIRDR, 0x0c, 0x40), + RSND_GEN_M_REG(SSIWSR, 0x20, 0x40), +}; + /* * Gen4 */ static int rsnd_gen4_probe(struct rsnd_priv *priv) { - static const struct rsnd_regmap_field_conf conf_ssiu[] = { - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898), - RSND_GEN_S_REG(SSI_SYS_STATUS0, 0x840), - RSND_GEN_S_REG(SSI_SYS_STATUS2, 0x848), - RSND_GEN_S_REG(SSI_SYS_STATUS4, 0x880), - RSND_GEN_S_REG(SSI_SYS_STATUS6, 0x888), - - RSND_GEN_S_REG(SSI_BUSIF0_MODE, 0x0), - RSND_GEN_S_REG(SSI_BUSIF0_ADINR, 0x4), - RSND_GEN_S_REG(SSI_BUSIF0_DALIGN, 0x8), - RSND_GEN_S_REG(SSI_BUSIF1_MODE, 0x20), - RSND_GEN_S_REG(SSI_BUSIF1_ADINR, 0x24), - RSND_GEN_S_REG(SSI_BUSIF1_DALIGN, 0x28), - RSND_GEN_S_REG(SSI_BUSIF2_MODE, 0x40), - RSND_GEN_S_REG(SSI_BUSIF2_ADINR, 0x44), - RSND_GEN_S_REG(SSI_BUSIF2_DALIGN, 0x48), - RSND_GEN_S_REG(SSI_BUSIF3_MODE, 0x60), - RSND_GEN_S_REG(SSI_BUSIF3_ADINR, 0x64), - RSND_GEN_S_REG(SSI_BUSIF3_DALIGN, 0x68), - RSND_GEN_S_REG(SSI_BUSIF4_MODE, 0x500), - RSND_GEN_S_REG(SSI_BUSIF4_ADINR, 0x504), - RSND_GEN_S_REG(SSI_BUSIF4_DALIGN, 0x508), - RSND_GEN_S_REG(SSI_BUSIF5_MODE, 0x520), - RSND_GEN_S_REG(SSI_BUSIF5_ADINR, 0x524), - RSND_GEN_S_REG(SSI_BUSIF5_DALIGN, 0x528), - RSND_GEN_S_REG(SSI_BUSIF6_MODE, 0x540), - RSND_GEN_S_REG(SSI_BUSIF6_ADINR, 0x544), - RSND_GEN_S_REG(SSI_BUSIF6_DALIGN, 0x548), - RSND_GEN_S_REG(SSI_BUSIF7_MODE, 0x560), - RSND_GEN_S_REG(SSI_BUSIF7_ADINR, 0x564), - RSND_GEN_S_REG(SSI_BUSIF7_DALIGN, 0x568), - RSND_GEN_S_REG(SSI_CTRL, 0x010), - RSND_GEN_S_REG(SSI_INT_ENABLE, 0x018), - RSND_GEN_S_REG(SSI_MODE, 0x00c), - RSND_GEN_S_REG(SSI_MODE2, 0xa0c), - }; - static const struct rsnd_regmap_field_conf conf_adg[] = { - RSND_GEN_S_REG(BRRA, 0x00), - RSND_GEN_S_REG(BRRB, 0x04), - RSND_GEN_S_REG(BRGCKR, 0x08), - RSND_GEN_S_REG(AUDIO_CLK_SEL0, 0x0c), - }; - static const struct rsnd_regmap_field_conf conf_ssi[] = { - RSND_GEN_S_REG(SSICR, 0x00), - RSND_GEN_S_REG(SSISR, 0x04), - RSND_GEN_S_REG(SSITDR, 0x08), - RSND_GEN_S_REG(SSIRDR, 0x0c), - RSND_GEN_S_REG(SSIWSR, 0x20), - }; - static const struct rsnd_regmap_field_conf conf_sdmc[] = { - RSND_GEN_M_REG(SSI_BUSIF, 0x0, 0x8000), - }; - int ret_adg = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_ADG, "adg", conf_adg); - int ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SSIU, "ssiu", conf_ssiu); - int ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SSI, "ssi", conf_ssi); - int ret_sdmc = rsnd_gen_regmap_init(priv, 10, RSND_GEN4_SDMC, "sdmc", conf_sdmc); + struct rsnd_regmap_field_conf conf_null[] = { }; + + /* + * ssiu: SSIU0 + * ssi : SSI0 + */ + int ret_ssiu = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SSIU, "ssiu", conf_common_ssiu); + int ret_ssi = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SSI, "ssi", conf_common_ssi); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_ADG, "adg", conf_common_adg); + int ret_sdmc = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SDMC, "sdmc", conf_null); return ret_adg | ret_ssiu | ret_ssi | ret_sdmc; } @@ -288,215 +438,17 @@ static int rsnd_gen4_probe(struct rsnd_priv *priv) */ static int rsnd_gen2_probe(struct rsnd_priv *priv) { - static const struct rsnd_regmap_field_conf conf_ssiu[] = { - RSND_GEN_S_REG(SSI_MODE0, 0x800), - RSND_GEN_S_REG(SSI_MODE1, 0x804), - RSND_GEN_S_REG(SSI_MODE2, 0x808), - RSND_GEN_S_REG(SSI_CONTROL, 0x810), - RSND_GEN_S_REG(SSI_SYS_STATUS0, 0x840), - RSND_GEN_S_REG(SSI_SYS_STATUS1, 0x844), - RSND_GEN_S_REG(SSI_SYS_STATUS2, 0x848), - RSND_GEN_S_REG(SSI_SYS_STATUS3, 0x84c), - RSND_GEN_S_REG(SSI_SYS_STATUS4, 0x880), - RSND_GEN_S_REG(SSI_SYS_STATUS5, 0x884), - RSND_GEN_S_REG(SSI_SYS_STATUS6, 0x888), - RSND_GEN_S_REG(SSI_SYS_STATUS7, 0x88c), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE1, 0x854), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE3, 0x85c), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE5, 0x894), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898), - RSND_GEN_S_REG(SSI_SYS_INT_ENABLE7, 0x89c), - RSND_GEN_S_REG(HDMI0_SEL, 0x9e0), - RSND_GEN_S_REG(HDMI1_SEL, 0x9e4), - - /* FIXME: it needs SSI_MODE2/3 in the future */ - RSND_GEN_M_REG(SSI_BUSIF0_MODE, 0x0, 0x80), - RSND_GEN_M_REG(SSI_BUSIF0_ADINR, 0x4, 0x80), - RSND_GEN_M_REG(SSI_BUSIF0_DALIGN, 0x8, 0x80), - RSND_GEN_M_REG(SSI_BUSIF1_MODE, 0x20, 0x80), - RSND_GEN_M_REG(SSI_BUSIF1_ADINR, 0x24, 0x80), - RSND_GEN_M_REG(SSI_BUSIF1_DALIGN, 0x28, 0x80), - RSND_GEN_M_REG(SSI_BUSIF2_MODE, 0x40, 0x80), - RSND_GEN_M_REG(SSI_BUSIF2_ADINR, 0x44, 0x80), - RSND_GEN_M_REG(SSI_BUSIF2_DALIGN, 0x48, 0x80), - RSND_GEN_M_REG(SSI_BUSIF3_MODE, 0x60, 0x80), - RSND_GEN_M_REG(SSI_BUSIF3_ADINR, 0x64, 0x80), - RSND_GEN_M_REG(SSI_BUSIF3_DALIGN, 0x68, 0x80), - RSND_GEN_M_REG(SSI_BUSIF4_MODE, 0x500, 0x80), - RSND_GEN_M_REG(SSI_BUSIF4_ADINR, 0x504, 0x80), - RSND_GEN_M_REG(SSI_BUSIF4_DALIGN, 0x508, 0x80), - RSND_GEN_M_REG(SSI_BUSIF5_MODE, 0x520, 0x80), - RSND_GEN_M_REG(SSI_BUSIF5_ADINR, 0x524, 0x80), - RSND_GEN_M_REG(SSI_BUSIF5_DALIGN, 0x528, 0x80), - RSND_GEN_M_REG(SSI_BUSIF6_MODE, 0x540, 0x80), - RSND_GEN_M_REG(SSI_BUSIF6_ADINR, 0x544, 0x80), - RSND_GEN_M_REG(SSI_BUSIF6_DALIGN, 0x548, 0x80), - RSND_GEN_M_REG(SSI_BUSIF7_MODE, 0x560, 0x80), - RSND_GEN_M_REG(SSI_BUSIF7_ADINR, 0x564, 0x80), - RSND_GEN_M_REG(SSI_BUSIF7_DALIGN, 0x568, 0x80), - RSND_GEN_M_REG(SSI_MODE, 0xc, 0x80), - RSND_GEN_M_REG(SSI_CTRL, 0x10, 0x80), - RSND_GEN_M_REG(SSI_INT_ENABLE, 0x18, 0x80), - RSND_GEN_S_REG(SSI9_BUSIF0_MODE, 0x48c), - RSND_GEN_S_REG(SSI9_BUSIF0_ADINR, 0x484), - RSND_GEN_S_REG(SSI9_BUSIF0_DALIGN, 0x488), - RSND_GEN_S_REG(SSI9_BUSIF1_MODE, 0x4a0), - RSND_GEN_S_REG(SSI9_BUSIF1_ADINR, 0x4a4), - RSND_GEN_S_REG(SSI9_BUSIF1_DALIGN, 0x4a8), - RSND_GEN_S_REG(SSI9_BUSIF2_MODE, 0x4c0), - RSND_GEN_S_REG(SSI9_BUSIF2_ADINR, 0x4c4), - RSND_GEN_S_REG(SSI9_BUSIF2_DALIGN, 0x4c8), - RSND_GEN_S_REG(SSI9_BUSIF3_MODE, 0x4e0), - RSND_GEN_S_REG(SSI9_BUSIF3_ADINR, 0x4e4), - RSND_GEN_S_REG(SSI9_BUSIF3_DALIGN, 0x4e8), - RSND_GEN_S_REG(SSI9_BUSIF4_MODE, 0xd80), - RSND_GEN_S_REG(SSI9_BUSIF4_ADINR, 0xd84), - RSND_GEN_S_REG(SSI9_BUSIF4_DALIGN, 0xd88), - RSND_GEN_S_REG(SSI9_BUSIF5_MODE, 0xda0), - RSND_GEN_S_REG(SSI9_BUSIF5_ADINR, 0xda4), - RSND_GEN_S_REG(SSI9_BUSIF5_DALIGN, 0xda8), - RSND_GEN_S_REG(SSI9_BUSIF6_MODE, 0xdc0), - RSND_GEN_S_REG(SSI9_BUSIF6_ADINR, 0xdc4), - RSND_GEN_S_REG(SSI9_BUSIF6_DALIGN, 0xdc8), - RSND_GEN_S_REG(SSI9_BUSIF7_MODE, 0xde0), - RSND_GEN_S_REG(SSI9_BUSIF7_ADINR, 0xde4), - RSND_GEN_S_REG(SSI9_BUSIF7_DALIGN, 0xde8), - }; - - static const struct rsnd_regmap_field_conf conf_scu[] = { - RSND_GEN_M_REG(SRC_I_BUSIF_MODE,0x0, 0x20), - RSND_GEN_M_REG(SRC_O_BUSIF_MODE,0x4, 0x20), - RSND_GEN_M_REG(SRC_BUSIF_DALIGN,0x8, 0x20), - RSND_GEN_M_REG(SRC_ROUTE_MODE0, 0xc, 0x20), - RSND_GEN_M_REG(SRC_CTRL, 0x10, 0x20), - RSND_GEN_M_REG(SRC_INT_ENABLE0, 0x18, 0x20), - RSND_GEN_M_REG(CMD_BUSIF_MODE, 0x184, 0x20), - RSND_GEN_M_REG(CMD_BUSIF_DALIGN,0x188, 0x20), - RSND_GEN_M_REG(CMD_ROUTE_SLCT, 0x18c, 0x20), - RSND_GEN_M_REG(CMD_CTRL, 0x190, 0x20), - RSND_GEN_S_REG(SCU_SYS_STATUS0, 0x1c8), - RSND_GEN_S_REG(SCU_SYS_INT_EN0, 0x1cc), - RSND_GEN_S_REG(SCU_SYS_STATUS1, 0x1d0), - RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1d4), - RSND_GEN_M_REG(SRC_SWRSR, 0x200, 0x40), - RSND_GEN_M_REG(SRC_SRCIR, 0x204, 0x40), - RSND_GEN_M_REG(SRC_ADINR, 0x214, 0x40), - RSND_GEN_M_REG(SRC_IFSCR, 0x21c, 0x40), - RSND_GEN_M_REG(SRC_IFSVR, 0x220, 0x40), - RSND_GEN_M_REG(SRC_SRCCR, 0x224, 0x40), - RSND_GEN_M_REG(SRC_BSDSR, 0x22c, 0x40), - RSND_GEN_M_REG(SRC_BSISR, 0x238, 0x40), - RSND_GEN_M_REG(CTU_SWRSR, 0x500, 0x100), - RSND_GEN_M_REG(CTU_CTUIR, 0x504, 0x100), - RSND_GEN_M_REG(CTU_ADINR, 0x508, 0x100), - RSND_GEN_M_REG(CTU_CPMDR, 0x510, 0x100), - RSND_GEN_M_REG(CTU_SCMDR, 0x514, 0x100), - RSND_GEN_M_REG(CTU_SV00R, 0x518, 0x100), - RSND_GEN_M_REG(CTU_SV01R, 0x51c, 0x100), - RSND_GEN_M_REG(CTU_SV02R, 0x520, 0x100), - RSND_GEN_M_REG(CTU_SV03R, 0x524, 0x100), - RSND_GEN_M_REG(CTU_SV04R, 0x528, 0x100), - RSND_GEN_M_REG(CTU_SV05R, 0x52c, 0x100), - RSND_GEN_M_REG(CTU_SV06R, 0x530, 0x100), - RSND_GEN_M_REG(CTU_SV07R, 0x534, 0x100), - RSND_GEN_M_REG(CTU_SV10R, 0x538, 0x100), - RSND_GEN_M_REG(CTU_SV11R, 0x53c, 0x100), - RSND_GEN_M_REG(CTU_SV12R, 0x540, 0x100), - RSND_GEN_M_REG(CTU_SV13R, 0x544, 0x100), - RSND_GEN_M_REG(CTU_SV14R, 0x548, 0x100), - RSND_GEN_M_REG(CTU_SV15R, 0x54c, 0x100), - RSND_GEN_M_REG(CTU_SV16R, 0x550, 0x100), - RSND_GEN_M_REG(CTU_SV17R, 0x554, 0x100), - RSND_GEN_M_REG(CTU_SV20R, 0x558, 0x100), - RSND_GEN_M_REG(CTU_SV21R, 0x55c, 0x100), - RSND_GEN_M_REG(CTU_SV22R, 0x560, 0x100), - RSND_GEN_M_REG(CTU_SV23R, 0x564, 0x100), - RSND_GEN_M_REG(CTU_SV24R, 0x568, 0x100), - RSND_GEN_M_REG(CTU_SV25R, 0x56c, 0x100), - RSND_GEN_M_REG(CTU_SV26R, 0x570, 0x100), - RSND_GEN_M_REG(CTU_SV27R, 0x574, 0x100), - RSND_GEN_M_REG(CTU_SV30R, 0x578, 0x100), - RSND_GEN_M_REG(CTU_SV31R, 0x57c, 0x100), - RSND_GEN_M_REG(CTU_SV32R, 0x580, 0x100), - RSND_GEN_M_REG(CTU_SV33R, 0x584, 0x100), - RSND_GEN_M_REG(CTU_SV34R, 0x588, 0x100), - RSND_GEN_M_REG(CTU_SV35R, 0x58c, 0x100), - RSND_GEN_M_REG(CTU_SV36R, 0x590, 0x100), - RSND_GEN_M_REG(CTU_SV37R, 0x594, 0x100), - RSND_GEN_M_REG(MIX_SWRSR, 0xd00, 0x40), - RSND_GEN_M_REG(MIX_MIXIR, 0xd04, 0x40), - RSND_GEN_M_REG(MIX_ADINR, 0xd08, 0x40), - RSND_GEN_M_REG(MIX_MIXMR, 0xd10, 0x40), - RSND_GEN_M_REG(MIX_MVPDR, 0xd14, 0x40), - RSND_GEN_M_REG(MIX_MDBAR, 0xd18, 0x40), - RSND_GEN_M_REG(MIX_MDBBR, 0xd1c, 0x40), - RSND_GEN_M_REG(MIX_MDBCR, 0xd20, 0x40), - RSND_GEN_M_REG(MIX_MDBDR, 0xd24, 0x40), - RSND_GEN_M_REG(MIX_MDBER, 0xd28, 0x40), - RSND_GEN_M_REG(DVC_SWRSR, 0xe00, 0x100), - RSND_GEN_M_REG(DVC_DVUIR, 0xe04, 0x100), - RSND_GEN_M_REG(DVC_ADINR, 0xe08, 0x100), - RSND_GEN_M_REG(DVC_DVUCR, 0xe10, 0x100), - RSND_GEN_M_REG(DVC_ZCMCR, 0xe14, 0x100), - RSND_GEN_M_REG(DVC_VRCTR, 0xe18, 0x100), - RSND_GEN_M_REG(DVC_VRPDR, 0xe1c, 0x100), - RSND_GEN_M_REG(DVC_VRDBR, 0xe20, 0x100), - RSND_GEN_M_REG(DVC_VOL0R, 0xe28, 0x100), - RSND_GEN_M_REG(DVC_VOL1R, 0xe2c, 0x100), - RSND_GEN_M_REG(DVC_VOL2R, 0xe30, 0x100), - RSND_GEN_M_REG(DVC_VOL3R, 0xe34, 0x100), - RSND_GEN_M_REG(DVC_VOL4R, 0xe38, 0x100), - RSND_GEN_M_REG(DVC_VOL5R, 0xe3c, 0x100), - RSND_GEN_M_REG(DVC_VOL6R, 0xe40, 0x100), - RSND_GEN_M_REG(DVC_VOL7R, 0xe44, 0x100), - RSND_GEN_M_REG(DVC_DVUER, 0xe48, 0x100), - }; - static const struct rsnd_regmap_field_conf conf_adg[] = { - RSND_GEN_S_REG(BRRA, 0x00), - RSND_GEN_S_REG(BRRB, 0x04), - RSND_GEN_S_REG(BRGCKR, 0x08), - RSND_GEN_S_REG(AUDIO_CLK_SEL0, 0x0c), - RSND_GEN_S_REG(AUDIO_CLK_SEL1, 0x10), - RSND_GEN_S_REG(AUDIO_CLK_SEL2, 0x14), - RSND_GEN_S_REG(DIV_EN, 0x30), - RSND_GEN_S_REG(SRCIN_TIMSEL0, 0x34), - RSND_GEN_S_REG(SRCIN_TIMSEL1, 0x38), - RSND_GEN_S_REG(SRCIN_TIMSEL2, 0x3c), - RSND_GEN_S_REG(SRCIN_TIMSEL3, 0x40), - RSND_GEN_S_REG(SRCIN_TIMSEL4, 0x44), - RSND_GEN_S_REG(SRCOUT_TIMSEL0, 0x48), - RSND_GEN_S_REG(SRCOUT_TIMSEL1, 0x4c), - RSND_GEN_S_REG(SRCOUT_TIMSEL2, 0x50), - RSND_GEN_S_REG(SRCOUT_TIMSEL3, 0x54), - RSND_GEN_S_REG(SRCOUT_TIMSEL4, 0x58), - RSND_GEN_S_REG(CMDOUT_TIMSEL, 0x5c), - }; - static const struct rsnd_regmap_field_conf conf_ssi[] = { - RSND_GEN_M_REG(SSICR, 0x00, 0x40), - RSND_GEN_M_REG(SSISR, 0x04, 0x40), - RSND_GEN_M_REG(SSITDR, 0x08, 0x40), - RSND_GEN_M_REG(SSIRDR, 0x0c, 0x40), - RSND_GEN_M_REG(SSIWSR, 0x20, 0x40), - }; - int ret_ssiu; - int ret_scu; - int ret_adg; - int ret_ssi; - - ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSIU, "ssiu", conf_ssiu); - ret_scu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SCU, "scu", conf_scu); - ret_adg = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_ADG, "adg", conf_adg); - ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSI, "ssi", conf_ssi); - if (ret_ssiu < 0 || - ret_scu < 0 || - ret_adg < 0 || - ret_ssi < 0) - return ret_ssiu | ret_scu | ret_adg | ret_ssi; - - return 0; + /* + * ssi : SSI0 - SSI9 + * ssiu: SSIU0 - SSIU9 + * scu : SRC0 - SRC9 etc + */ + int ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSI, "ssi", conf_common_ssi); + int ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSIU, "ssiu", conf_common_ssiu); + int ret_scu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SCU, "scu", conf_common_scu); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN2_ADG, "adg", conf_common_adg); + + return ret_ssi | ret_ssiu | ret_scu | ret_adg; } /* @@ -505,30 +457,13 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv) static int rsnd_gen1_probe(struct rsnd_priv *priv) { - static const struct rsnd_regmap_field_conf conf_adg[] = { - RSND_GEN_S_REG(BRRA, 0x00), - RSND_GEN_S_REG(BRRB, 0x04), - RSND_GEN_S_REG(BRGCKR, 0x08), - RSND_GEN_S_REG(AUDIO_CLK_SEL0, 0x0c), - RSND_GEN_S_REG(AUDIO_CLK_SEL1, 0x10), - }; - static const struct rsnd_regmap_field_conf conf_ssi[] = { - RSND_GEN_M_REG(SSICR, 0x00, 0x40), - RSND_GEN_M_REG(SSISR, 0x04, 0x40), - RSND_GEN_M_REG(SSITDR, 0x08, 0x40), - RSND_GEN_M_REG(SSIRDR, 0x0c, 0x40), - RSND_GEN_M_REG(SSIWSR, 0x20, 0x40), - }; - int ret_adg; - int ret_ssi; - - ret_adg = rsnd_gen_regmap_init(priv, 9, RSND_GEN1_ADG, "adg", conf_adg); - ret_ssi = rsnd_gen_regmap_init(priv, 9, RSND_GEN1_SSI, "ssi", conf_ssi); - if (ret_adg < 0 || - ret_ssi < 0) - return ret_adg | ret_ssi; + /* + * ssi : SSI0 - SSI8 + */ + int ret_ssi = rsnd_gen_regmap_init(priv, 9, RSND_GEN1_SSI, "ssi", conf_common_ssi); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN1_ADG, "adg", conf_common_adg); - return 0; + return ret_adg | ret_ssi; } /* diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index da716b1f52e4..e063286cc328 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -200,7 +200,6 @@ enum rsnd_reg { SSI_SYS_INT_ENABLE5, SSI_SYS_INT_ENABLE6, SSI_SYS_INT_ENABLE7, - SSI_BUSIF, HDMI0_SEL, HDMI1_SEL, SSI9_BUSIF0_MODE, From patchwork Tue Apr 2 02:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 785937 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 C3B45CD1288 for ; Tue, 2 Apr 2024 02:24:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 22D492366; Tue, 2 Apr 2024 04:24:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 22D492366 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712024697; bh=mhvyh3S28pgY0XczHMG/53UGAM6cbsEXfsT9F6ywXFA=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e4VGCr72M/jAWMsJ5yBUJK2YNQWnVgOHaXdIItUrPbn4BfQ5KqvNt/zFrUDa1Rf8Y y2/RSQBPJmNTpt6bvcwTjE0Cd7BR5HpCaQYRP4KdlGjJCVL7NpgfsUmEk3VzaGsQxv 2TNKkmXy6IHmO0IiC/3BhmKnSPHbatFdy8BPr+xQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 618DBF805F1; Tue, 2 Apr 2024 04:24:20 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A3FEDF805F1; Tue, 2 Apr 2024 04:24:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2C41AF80589; Tue, 2 Apr 2024 04:24:16 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (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 19A20F805D3 for ; Tue, 2 Apr 2024 04:24:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 19A20F805D3 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=QOSkQfFD ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QhfsvwZRAW3F5zLGsLi2bjsaQJzr7lc3NCwJLFJiXfnM4fVewv1frKrPVLkrX3vu/ZLssCRhKa+Ro4yYyvFeNaP7fNxtwMoF1fVV8RmLC2xnRvM2C/jz8HErxOdBYBB6p03NE4Pw/nNdlzDCWH9meDXqv7UaDL7oIm6/dR6zMo43YnUUXHUjySja8Ffty3bc3wts+XPqxCByR9oIu8v30Q1hbc6dDExg0GoXcwYCpXbxieT2FUArl4YMsVkhxxeAztpnwflrdxJ63nUQUA3JKkT6m8g4nGx7HVLTRUEjEApEaPMdIxIw8fMs2N7pIlYfobUCszjC5Bs89gSAHtiApQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8zqAoCmfvYyC/NbMep3oJx9Co9fwb0KRVN1FETga0Cs=; b=GJKIZ6GRrSShle+vI3U5Op3jmJKEOlHtzf5RxM1DZr514fTRDuDoMw+DGzpnXHCpmNMN+j4wdZRkysUbFOG+XNSXk1S1q4EHE5njXwWaGQpQN9RPStv/wFWjnulmPtb5a4lkJJUqH7MFUMEqFmc3D7wotmw4T26lnfsUSJXno0ve2olYTgRDx2w4Lw/gwmTcTKB17P9sOT0TNjdGfFDDWa9GfO7BxLMH3uuv3u8Q7T867Q6IF9E9gJ3yA+sDi4ijd2QVNtH1PLH8yYzqY0q2PjM0uYMHJYdhdC42bGLQm6Bni6JZhVAWs6oCAeAWru7QQ3xtKXYNIzn6tlkz9uTr4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8zqAoCmfvYyC/NbMep3oJx9Co9fwb0KRVN1FETga0Cs=; b=QOSkQfFDbn1y1Aq5+3vFmEPhDcvx6csJdUa1sNrspqz5poyBgcvMKAsL00b5JYaVBHqKlm+RDTiH7Nkk4Zd1V3Bmt6hi1s/w5aTS8DBtJq9oHuah8yV4t3NEBIVNWsgnn27QX6DQYZADe4mBRd/n+Y07YKXKk3SJCa0cIe2lvRo= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB5959.jpnprd01.prod.outlook.com (2603:1096:604:d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Tue, 2 Apr 2024 02:24:02 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Tue, 2 Apr 2024 02:24:02 +0000 Message-ID: <87zfuca4e6.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown Cc: Linux-ALSA , Khanh Le In-Reply-To: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> References: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/5] ASoC: rsnd: don't get resource from ID Date: Tue, 2 Apr 2024 02:24:01 +0000 X-ClientProxiedBy: TYCP286CA0100.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB5959:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: haKd0AZf+tegZYTL2DrahhDF51NfEBJbg03aaACaDxFBC50HnK/xoHtJDsgAmrshZOtuXJUk9ouMD2mDIGcM5mBaJV6xidQ1+fzRKOrqo3NLLdVTw1Ij1NTdVqLDXGQwDWVHsm2291rHYKjyuj23OMfGMnulvfQqExdk/A3dwHophC9LTHuhMqvbdZZSAAiC1QhKQFtaOSDR7xkKkazbznI7ZF89XiGz7bfTxs0XZhSttgYaByPQFuTdeEah9pScVkCTqKcJMUPzwF1qAV/yU50h3zjuXliuX3QwSNZGAuKhJFfr2QCJgPgGU9Mrw+VvIaKy2ENUvDrc9+zYxUnaNOLJVRk17QqS9MYWb5rQt8q78lV1yRgcWtY2TrvPAkXH0nNGUJc2uUO4qgg6ajxqO1BuM8Pl3aHfNbcV7z9/DWVagbQQlcju/6R0ryagthUEABWSCIxj6tImwRrA9FwhTSDKUrLhzjQB3yIsHXVPCQcm4M3s1XGUd5W4OKNUL8uCEolnKFo8teKuDsQZD8VW9J7lDBOEkP4MwLsETU/pFTGfsGwMwBMMm7bbjFBcJyAHFT1cMzb6d2TeF9q1leU43UY6Roa+OPdP3ByQeYzBrgSdVH/xdWzAGKJ9ZAdvwbXUMvOQMnLzbQp7zee6YcsqIPcGxCNgTMOLFapvkZmV/lz8EFD+B5Wr4vyLNsjX8Z3NXSgiTE6YGKH/vyDpnfPgIQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(52116005)(1800799015)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEuANLPMlxHzOvpV/Ookae9GNjZJA7pxLv3jpo2BYHNqvvbMrHTn11HIBqyeo1o0n5wFYQY/FzcuItgXFSMuWEBzJV08hJhWiVDtRMxAw5QJKzYA4x2NnSJtl3ubZ0OVAs2r3fGNVJEHJ+NVQVHNobNQoQCPzdAdbmCM4LbdeLz9pkmyU4YZog2bipe5CEDFPhtUsXbhGVCXrEtpWDLf+sAoTfrBCxiyHOGIEmF5KMnhs2NgOB+/3grKywnImq8k3tOIviObSlIKB0bOOrxaV97F5RHcXC/GxKZrP46QQqYCjW3HC7XMHP8I3EoNRNOQvaL4AWicUzEWdORRl6pvaxiZilNynR6/Iab03qS71PPqZUzmNRyDhA2Zfqb4aBRJzQP+vXBNq8IODQ3nLJnov+GgBUZ69YwtqENo+kYSctbFnNJtcG9K9XjO5C/BHZM2zxMaZohIQP+IVn3RZwMtWTDYldrkHcCD99p2FOaqOC3l75v3WnUp0+sZ5epS7VXPlxQrTWBjzaGbpyKyEY9Elb1mgeBJUOrTvWqiCnKyH5i6zVq1zSA79IwIhRqsCQwqqGOgWCjrx9JEa69UnnTTLpClOLj03ieBAH7/QRR8o9qhrg6viyhIX1HWYcJJV+ssot/rdOYnLkT2IgHZ3FwkHGegRI7T6QwB8ZgrNuCJotlSGp2i1MtzweYWB0N4tYuUW3h+baDhTQa3STS3BJ7sqc9iwLRVQCKb2yeq4Swq9xlghVknpy5DuqAM2IwIQZO3+nn6R6M9MGklLUB1mfHKpP/03I4hgzFaBcnpHLcvzI0891rrmUDPgmB/4Tmgh/jOGEN+mznQYvmdXA+VyLvmC4TNnkB8I7Xx97puJsoPa9SOPYienkw/QRU8bcHf6MIozwBzWozecb0Hb896bMVpkd1qReBanGrGo4F9B+HGWGql69bW1FEeXHZeRPXDabtoSc/xFi9Utg5ZMueJbIAKTpXbT0B2DcwjeIvjA7ILBD/A6G1jcBfa1lejb3R50sZUEyKCs32sSq1HZU3HuD0F6ROn49Yhlq54iEjoJi+sE/3ZmKOSW6YnjQeQhmiRtdo+cREhgwUlHSuWwiKN1E4siyxppOkY1/inGhm7WJHoDXOTD0Le+DogI86rE7btBp/rNfkCPb/yju/PFxENlojHNdhpWrnSAbiNrY/Iex6pErVeoN0ag1zQ0BQ4jrcrfY7HqNAVjlkLUZBhPbKWggyQCe/Qfi19jJ4GnzsMXrJHIIW2rOdPlFiTCvLE/D0y+lApkwLisuGFpbabmI7bPgsJzCr/wLiz0cU7TFYetWYZxWbyE3YVVsVtXd4GU+Vcuz/SfXO4yc5eMRMTDPNGOdubqQPGEuKcQi6jACBaAB2Ux3Kz8YO6MlGhAfdFq9PTTelpqoa9wyEBVCRMq86s906EIAo9AiBksk4pVfRpcovZkVZKGJYPv4sI5ZTFGPc5LENpwLoyPFyohtPwnhiD8sWKeiLM9oW+Vhigs05ULPnww5BPUb9DxQY5jaYEniukgngeadZurVGGAtcCyiurSgyL12dcK6YTrqcUpXHORnBDn/OZVT5+a+S4t9LLXmAtxaPHtwP15A3K5lSzO6y1bz5xbtJw/uBRlWPTr0AUnlQ1wfk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb47a454-aecd-4af9-0973-08dc52bbf5fc X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 02:24:02.0059 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SCwuSAIdSSiDIw+qwGKnRvfEJBcswl6FAzoN1vMkEVMl8nW9gAdw6Oj482braUM2rvinI6LTdFLzhDaBXhqGe+3/EvLkaznL84I078Rv9OL+SOfp3obH7DdfOJgNHHkH X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5959 Message-ID-Hash: 2OJD33J3ASS6X4QSUYL55G7QTXEH73UD X-Message-ID-Hash: 2OJD33J3ASS6X4QSUYL55G7QTXEH73UD X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: All SoC has reg-name, no need to support getting resource from ID any more. Remove it. To get physical address for DMA settings, it still need to know the index, but it is no longer fixed. This patch tidyup it. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/cmd.c | 2 +- sound/soc/sh/rcar/ctu.c | 2 +- sound/soc/sh/rcar/dma.c | 6 +++--- sound/soc/sh/rcar/dvc.c | 2 +- sound/soc/sh/rcar/gen.c | 22 ++++++++++------------ sound/soc/sh/rcar/mix.c | 2 +- sound/soc/sh/rcar/rsnd.h | 19 +++++-------------- sound/soc/sh/rcar/src.c | 6 +++--- sound/soc/sh/rcar/ssi.c | 2 +- sound/soc/sh/rcar/ssiu.c | 2 +- 10 files changed, 27 insertions(+), 38 deletions(-) diff --git a/sound/soc/sh/rcar/cmd.c b/sound/soc/sh/rcar/cmd.c index 329e6ab1b222..ec086d8e4d44 100644 --- a/sound/soc/sh/rcar/cmd.c +++ b/sound/soc/sh/rcar/cmd.c @@ -119,7 +119,7 @@ static void rsnd_cmd_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0x180 + rsnd_mod_id_raw(mod) * 0x20, 0x30); } #define DEBUG_INFO .debug_info = rsnd_cmd_debug_info diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index e39eb2ac7e95..a35fc5ef8770 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -284,7 +284,7 @@ static void rsnd_ctu_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0x500 + rsnd_mod_id_raw(mod) * 0x100, 0x100); } #define DEBUG_INFO .debug_info = rsnd_ctu_debug_info diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 1c494e521463..7b499eee5080 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -585,8 +585,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io, { struct rsnd_priv *priv = rsnd_io_to_priv(io); struct device *dev = rsnd_priv_to_dev(priv); - phys_addr_t ssi_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SSI); - phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SCU); + phys_addr_t ssi_reg = rsnd_gen_get_phy_addr(priv, RSND_BASE_SSI); + phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_BASE_SCU); int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod) || !!(rsnd_io_to_mod_ssiu(io) == mod); int use_src = !!rsnd_io_to_mod_src(io); @@ -666,7 +666,7 @@ rsnd_gen4_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod, int is_play, int is_from) { struct rsnd_priv *priv = rsnd_io_to_priv(io); - phys_addr_t addr = rsnd_gen_get_phy_addr(priv, RSND_GEN4_SDMC); + phys_addr_t addr = rsnd_gen_get_phy_addr(priv, RSND_BASE_SDMC); int id = rsnd_mod_id(mod); int busif = rsnd_mod_id_sub(mod); diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 16befcbc312c..f349d6ab9fe5 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -294,7 +294,7 @@ static void rsnd_dvc_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0xe00 + rsnd_mod_id(mod) * 0x100, 0x60); } #define DEBUG_INFO .debug_info = rsnd_dvc_debug_info diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index e566712e5234..d1f20cde66be 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -177,8 +177,6 @@ static int _rsnd_gen_regmap_init(struct rsnd_priv *priv, regc.name = name; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); - if (!res) - res = platform_get_resource(pdev, IORESOURCE_MEM, reg_id); if (!res) return -ENODEV; @@ -425,10 +423,10 @@ static int rsnd_gen4_probe(struct rsnd_priv *priv) * ssiu: SSIU0 * ssi : SSI0 */ - int ret_ssiu = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SSIU, "ssiu", conf_common_ssiu); - int ret_ssi = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SSI, "ssi", conf_common_ssi); - int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_ADG, "adg", conf_common_adg); - int ret_sdmc = rsnd_gen_regmap_init(priv, 1, RSND_GEN4_SDMC, "sdmc", conf_null); + int ret_ssiu = rsnd_gen_regmap_init(priv, 1, RSND_BASE_SSIU, "ssiu", conf_common_ssiu); + int ret_ssi = rsnd_gen_regmap_init(priv, 1, RSND_BASE_SSI, "ssi", conf_common_ssi); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_BASE_ADG, "adg", conf_common_adg); + int ret_sdmc = rsnd_gen_regmap_init(priv, 1, RSND_BASE_SDMC, "sdmc", conf_null); return ret_adg | ret_ssiu | ret_ssi | ret_sdmc; } @@ -443,10 +441,10 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv) * ssiu: SSIU0 - SSIU9 * scu : SRC0 - SRC9 etc */ - int ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSI, "ssi", conf_common_ssi); - int ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SSIU, "ssiu", conf_common_ssiu); - int ret_scu = rsnd_gen_regmap_init(priv, 10, RSND_GEN2_SCU, "scu", conf_common_scu); - int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN2_ADG, "adg", conf_common_adg); + int ret_ssi = rsnd_gen_regmap_init(priv, 10, RSND_BASE_SSI, "ssi", conf_common_ssi); + int ret_ssiu = rsnd_gen_regmap_init(priv, 10, RSND_BASE_SSIU, "ssiu", conf_common_ssiu); + int ret_scu = rsnd_gen_regmap_init(priv, 10, RSND_BASE_SCU, "scu", conf_common_scu); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_BASE_ADG, "adg", conf_common_adg); return ret_ssi | ret_ssiu | ret_scu | ret_adg; } @@ -460,8 +458,8 @@ static int rsnd_gen1_probe(struct rsnd_priv *priv) /* * ssi : SSI0 - SSI8 */ - int ret_ssi = rsnd_gen_regmap_init(priv, 9, RSND_GEN1_SSI, "ssi", conf_common_ssi); - int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_GEN1_ADG, "adg", conf_common_adg); + int ret_ssi = rsnd_gen_regmap_init(priv, 9, RSND_BASE_SSI, "ssi", conf_common_ssi); + int ret_adg = rsnd_gen_regmap_init(priv, 1, RSND_BASE_ADG, "adg", conf_common_adg); return ret_adg | ret_ssi; } diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c index 1de0e085804c..e724103a2e8d 100644 --- a/sound/soc/sh/rcar/mix.c +++ b/sound/soc/sh/rcar/mix.c @@ -259,7 +259,7 @@ static void rsnd_mix_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0xd00 + rsnd_mod_id(mod) * 0x40, 0x30); } #define DEBUG_INFO .debug_info = rsnd_mix_debug_info diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index e063286cc328..45cf21320280 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -20,20 +20,11 @@ #include #include -#define RSND_GEN1_SRU 0 -#define RSND_GEN1_ADG 1 -#define RSND_GEN1_SSI 2 - -#define RSND_GEN2_SCU 0 -#define RSND_GEN2_ADG 1 -#define RSND_GEN2_SSIU 2 -#define RSND_GEN2_SSI 3 - -#define RSND_GEN4_ADG 0 -#define RSND_GEN4_SSIU 1 -#define RSND_GEN4_SSI 2 -#define RSND_GEN4_SDMC 3 - +#define RSND_BASE_ADG 0 +#define RSND_BASE_SSI 1 +#define RSND_BASE_SSIU 2 +#define RSND_BASE_SCU 3 // for Gen2/Gen3 +#define RSND_BASE_SDMC 3 // for Gen4 reuse #define RSND_BASE_MAX 4 /* diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 3241a1bdc9ea..8822d50b6d86 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -606,13 +606,13 @@ static void rsnd_src_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, rsnd_mod_id(mod) * 0x20, 0x20); seq_puts(m, "\n"); - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0x1c0, 0x20); seq_puts(m, "\n"); - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SCU, 0x200 + rsnd_mod_id(mod) * 0x40, 0x40); } #define DEBUG_INFO .debug_info = rsnd_src_debug_info diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 0a46aa1975fa..8d2a86383ae0 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -1049,7 +1049,7 @@ static void rsnd_ssi_debug_info(struct seq_file *m, seq_printf(m, "chan: %d\n", ssi->chan); seq_printf(m, "user: %d\n", ssi->usrcnt); - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SSI, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SSI, rsnd_mod_id(mod) * 0x40, 0x40); } #define DEBUG_INFO .debug_info = rsnd_ssi_debug_info diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c index 17bd8cc86dd0..665e8b2db579 100644 --- a/sound/soc/sh/rcar/ssiu.c +++ b/sound/soc/sh/rcar/ssiu.c @@ -413,7 +413,7 @@ static void rsnd_ssiu_debug_info(struct seq_file *m, struct rsnd_dai_stream *io, struct rsnd_mod *mod) { - rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SSIU, + rsnd_debugfs_mod_reg_show(m, mod, RSND_BASE_SSIU, rsnd_mod_id(mod) * 0x80, 0x80); } #define DEBUG_INFO .debug_info = rsnd_ssiu_debug_info From patchwork Tue Apr 2 02:24:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 785189 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 BEEE7CD1288 for ; Tue, 2 Apr 2024 02:25:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D68B523D6; Tue, 2 Apr 2024 04:25:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D68B523D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712024718; bh=2lWNtk02+KG24CiDtdD97MfK3INjyYbowMj4JPnwLRo=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=AMpI0pt6HqoWTS1pKdd6hDX4PyBN6PU8Nw34of2aRIuzL/aWu5khzzr+B2W83FkPt nMxzdVI+wmoKwFroyWrdvdS3W0B6pTAYhp9sorolvd0DkXpe4eEU1z53g5nBYnIHTO 85w0/xSDX5SagqZtTsBhgCrWJ2JV0y9bviqyvdQQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A0189F80603; Tue, 2 Apr 2024 04:24:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C5C07F805AA; Tue, 2 Apr 2024 04:24:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9721F8058C; Tue, 2 Apr 2024 04:24:20 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::700]) (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 13BE2F80588 for ; Tue, 2 Apr 2024 04:24:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 13BE2F80588 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=e1DqH8zD ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fkxj/16aCtImDUmXPlpi0sVS/kVNb5roG2ZRjQYipRIeyAMeM0bxikMPip6h50rFlyZpi0O2dpKOT3ZPOibKLlpdtzhJfxTacu7ADoIEbUZbSMkfkasCLjWJ3sk5EhbIFYGOzlXwU12SCn7Cm/jbAXhs3sCxC29K2Dxji2UH70wHV1lBVE1x0GicBC3ywpkI3C8qi/35yhobXsjpXz8MFgdvGGFIAsbhJUXU+RH/jSQFNarubqpUDV10XFd3wKG980YAhD2QjDshFt3VXQtF1BE/19YFtZ2VRkiOIjhX8f4TXcbNihyns/S/HZoUYV5mvQKZSC68QYnQBPGv8axHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=orD9JULd8gZB1HLcn3gMSsTpzHeM6sW2XxzS/XYoDQ0=; b=iyJ+MHSsc3NxasElOkG4I4sCH6IyL3aGQ7NJyyiAYGAmrJCmanS/o3tllmBzldH/t7ATJ4rcW3UDFACYQAVhN0lW56D4363tn9q25IAia3eoPADr4LMjdGXdOrDH45+DlObJSM5rpZx8ppDSAwasu8UGfaHhAj0xyt7tVHCP4w+M29jsnsQpVM8aLFsSwsA4RB4HF/leomWFerFXCtvhbykfWOjcpscWlwXlY+TN08vEEXM+Zu8Y36TBBES/MoSPlAddwxTxykiUCkQxU79uf5kX+VyK4i2wR3bZei+GEx88AnDnr02s4ugoghsPT64tTbQJtgKByzXKQ1KFnqwgSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=orD9JULd8gZB1HLcn3gMSsTpzHeM6sW2XxzS/XYoDQ0=; b=e1DqH8zDo54vwhGzeMwAESFYQLItyNhkSAVoW2klzSKlOK1ZnFU/UYgIq179y0ZPMIavN8vYp79rk6t/OiAebAzEwJ8CNZtI3H6mB7Up5Sle8rJnfHWQiwDx/D7V9KH4F5OLWr4AKOIcLa7ydXUGcMSdWICt2Ye2ZeMipz817T0= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TY3PR01MB11608.jpnprd01.prod.outlook.com (2603:1096:400:370::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 02:24:10 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Tue, 2 Apr 2024 02:24:09 +0000 Message-ID: <87y19wa4dy.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown Cc: Linux-ALSA , Khanh Le In-Reply-To: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> References: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/5] ASoC: rsnd: rename rsnd_is_e3() to rsnd_is_gen3_e3() Date: Tue, 2 Apr 2024 02:24:09 +0000 X-ClientProxiedBy: TYWPR01CA0050.jpnprd01.prod.outlook.com (2603:1096:400:17f::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY3PR01MB11608:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IUaG//lSvF5Q1XiK99Ta6IgUHG/9YIfoUPDw46uVbKM3X2HqG6vmKrGeinT3WEAqjGTxHuEKBtXqw+tLhTmGENMYzlNBV+pmTD4Bd4xDM3BwKzIwWTkfrd1v35FLCM/aW3wqU4ma9wIbrgx8moyzNyyGmmtT9tAFmGXBQXSAxGnzyuxgbrJdcIbTG8S6M1i9pxrzu1VUDQafsEGp1l6EgPCWlyDwx8lGix9DSKBBgVZjphp6dEh2GzvqKKrjkmkBssnMzoAisCQIBubDa53Ur+lokANqM+00w01EnLdKrg7DR4yYmoFKbjMywFDg9TBvvlgM16pkTZqUlVzYRGRshJEuNP/U907XewsZp9gWtC6hHhc9f8q6/FS55NAdcCxQ2f/ofG7KGVTIAnfYYuV8BZmnXfJSldQpsOOCUYFMqaLjNymvNhEjNBDhi1NZ7WI2HVfTrV+hu0tgzQ/04ioqQaDn8/6dHEmypozIEnR78RBEwkenOeJMcu/BW3+CI6xGs3DiWCjqhya1jByklQp2PbCqZPeRS0e+XbMbb6ufhnCU5Ec7um+npET5wwl9aFOhUqSwFBzXdUPbgolPAGHUhvgKOALcwwU7eqBdTUYn4JDg3JqRw1BLwVE557Yqf/ZghwoqG3b4KGkQhIGt2cg7jxfOP3kTeHEpWlwzSFr8nNq1yiB6cxkNOHrLDvjliaiX9mfoEqwmZFBLZWjCyA0ADQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +jw2NHdJ6gQLFt3fzX5JoiZ39gG5SfNN/yzKegojJcTcqhdJ1gHZ/+x4+HapvhuGtBnHzTu3iZDNQRc3252ZUaAqlUsw5dtN+10ozJeXdWmhYowdVkOwWwV/cFH0ZXi50X9B/4J75xEyGumLwRZG7LZD42ko6YkxFlq26oOcGyvawf5AFf6DZVnvjOnNuFGbMciCJwoGM5Ef7dWLP8zp6OVC7bjF9XWovHEVvyB6lsAmkBDP/MpiKAGU9vn7ojWD2voMLpuKBGZRIjdA040+CF0dMkm96KsRCAiLpGqFtjMVW2kAlh2hjuIjb30M8GRTIrE2sEwqYJzVpUvWBAUSAqzKugIAXUM7g/8zPxoe9SG/hZUycC7PW3hWqzhy9IFnz08x+DIj0I8uqRzYvlLgi5EUJvcDA0vxaZSgeiwTpPcmlTf1bQSyRTXso8CkettF6jrLZFI4LQm6dDEZZlCZMDe48sx2ryydT065n+fP9Nxh6aQivSAy5DirbMcOJeG7doEWTLrI5qb1WXFVjPNAZtsJidG0MNbRAZ5GF9wBSUvMOR+7zyI+Mzt0JIQRLfgwfQguz9TzwgcOcBRwgZN0o/BtTC4s6fRJwRb/bANCDcxkuWxX50aKbk/6vX3r2EMtoX0UUDS86vvkona2Q9u1b8LcYAW9DMvwzZpexqx0ok8kbLlzCcQFr1hRZOKegrbjBSynQ3qLTFpdPbeoqTo1aRIETtVowRCKMYmNI4vK3SkUtusIv2G9QM+Mu86/wmvp//CHhcKsPJkt0FY9rU/WRFSXFnREf0A0wYoj9kLdQXfruYud/EBdIbpvd/qcQACizpDbq6So0NR2NTMhSf789c+aWR6cMuAev5fd00nO8sowIDdK+oOWAjm8a37VpnCK8FH8MPYsADODdpAxXXNfHIAsbgG5GDbsY067afW9EG7ZSjHCfHe6kFRQ4icCwbjE6owIFtyi6sezKKottn4xn6AqIwVsUZXQsF5QAA2AmFaRoK1VDvoIMAW7s6FZMuvcP+LpWJ366uFChJKjqMKikd1vIbN++BmylqPD5/n4kykNwU2soDhLl0dsRzmd7QkxorHwaQtiw1E5z1nVcoDj6/elGjPmQb9DGKSNzDSMGNBK9AMaFcNy38spVuf1i5ZZbxuQ7qasVi683d0SolGnzso39Q7d316r8o4pKSEfFJGvhBmHXPsaXcv0OZ8T9DnZiN33brXJpXwDtGCO5HfDshIG/fQ9LodpAkh2PHURYfYylhJG05T6pmAurot+y/XGDCcMLRWMoG+TUHPnUjjvRX92QJa8NEV/WWTiQfbj6tkdZc4ORq2bBzUGJE3A+Bb5fpwC8EfbepoedTo9W63yXaEXa/oTtJr71D40VI/IaEGha8XKxMmrTFmGfGn7JfomXbUgMHHBFmyhn4DhH6pOPjb4j/veFowp4eTxdVBMT41bIiM1Q+FYhYDUIF6EOlaCDHqJ61/PZQygmwHXymPW+boGIeLKFGk12Nfarl7aHuI5wJzAuFNKuA1vpb2GIqU3qXD9jPcfS8SH082GfGtLzJvQQAr7h7qkpuzWEcM8nuf7pV7vI+aBHjvLZpXcjksuc8VVDWR5itmL6F9h0NVDv/lRgO4Im1V+ecMQ+XPaZ2g= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebb0df50-bdf7-4393-ce5f-08dc52bbfa89 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 02:24:09.6563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oZZAglIoY5K+hfjM0ZjZwpb3ugr/7DauI3q/tVtpdn9INVnJHIyZTlB1OPY9Q9sg9FiKBYwtsTJJeLZYtR5EFoL7vV4bOrgnJEE8P6Xl7ASxPf9lHNP6p0KCu/AtQRZx X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11608 Message-ID-Hash: 5FA4X4GR25XSVMHJSRFUFETJCI64IHSK X-Message-ID-Hash: 5FA4X4GR25XSVMHJSRFUFETJCI64IHSK X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Renesas Sound driver is using rsnd_is_genX() macro to handling difference. We can use "grep rsnd_is_gen" to find-out difference for each SoC except rsnd_is_e3(). Let's put same rule for E3 as well. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/rsnd.h | 2 +- sound/soc/sh/rcar/src.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 45cf21320280..ff294aa2d640 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -703,7 +703,7 @@ struct rsnd_priv { #define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2) #define rsnd_is_gen3(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN3) #define rsnd_is_gen4(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN4) -#define rsnd_is_e3(priv) (((priv)->flags & \ +#define rsnd_is_gen3_e3(priv) (((priv)->flags & \ (RSND_GEN_MASK | RSND_SOC_MASK)) == \ (RSND_GEN3 | RSND_SOC_E)) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 8822d50b6d86..431e6d195b09 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -310,7 +310,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, /* * E3 need to overwrite */ - if (rsnd_is_e3(priv)) + if (rsnd_is_gen3_e3(priv)) switch (rsnd_mod_id(mod)) { case 0: case 4: From patchwork Tue Apr 2 02:24:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 785936 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 D4BE0CD1288 for ; Tue, 2 Apr 2024 02:25:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0592B238E; Tue, 2 Apr 2024 04:25:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0592B238E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712024731; bh=slNqMxuPq4l8l2zEnwsZFnXV9YmRIBN8eUtk/d3laPM=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UEo94QaiaWjBgyiFJzR8xr8GPvugQbh+3VTvxYHKZXynzCjx4TOXunYG+1PVlkxjO yR+i/EziabM38QfLLGsagC1RAeYRz2oSKTlNNcRzRNjrO97yuIPyK0ZWJVsNPgEGUq ri8Jl937BaWV2Ola4/HOwa/CQOC2bGwAhof+nvfE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E448EF8061A; Tue, 2 Apr 2024 04:24:30 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 1F443F8061B; Tue, 2 Apr 2024 04:24:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCFA3F805B3; Tue, 2 Apr 2024 04:24:25 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (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 38DD0F80236 for ; Tue, 2 Apr 2024 04:24:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 38DD0F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=lHzWPpIH ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iZBrODI7Gh/mxlIOgoLXBoX2hHzPJuaW6T62uSQiLHGL1ZHXnvx/BiaTONJchY5FvuBh90rAwfNHRNltBZFlDZTdyXPIJtHhoWapXZoBzhslTaa2IGYPg9MIL6D8FnpA0R87mTe6FzQKbt6FijtpIhuKBYOUx/jSdVaqs7Id7Qtuuv3MlbsQeLxuinXvlNdFDewR0Y4Yb9wCMtP6p++OU/Es9Vw95wJ5P1AUmxUKNXrouqxIHRuzZz1xMPH/a+Vcoyghryg42uxcKakJTQ5YqALrEvLtc+UYWCeL72C4a65p5MjHuCjByLinuOhjjqAS8UUnlp38iI4lWvDbcFMQ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sojclz7l8YFCgCR3Uj7LApNPiZsxG+qFeKQJAkMxdjU=; b=ItkeXp36APaqFcexf156GcnHBwtnoCB+vdxiH6qsVInAZrPvBpJm2H+yVVLPBuQF6Z7j/fd4Ur1Rpuhn6EFQBsMokt+AVqsLDl3sGoKLPnR5KabvlH+wGdu1nj8C5vmASljoX7slvmJfkULCXP8Noi2G5kYKXRJ/VozXjVRzkoiGihOCR8jOxK78yp+TCdylR1De4bR53HWb3BqG5ZreeBMoXYIat4ZRZGy96bFbBz2TuXFVkV9c+oFnC0SVP8XGFYiV1OyMPTpikodiIfCzlFl8ubnTiLcodtmN4MwPV/MnmK0Bld/Zge+uTUQu9odDufhUvV0p6fhZB3kccF4UKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sojclz7l8YFCgCR3Uj7LApNPiZsxG+qFeKQJAkMxdjU=; b=lHzWPpIHvNfccUzunHQxDb7SdCPiinEloAcQrC8/mPJjY1uJ902zil2vqfhkGpgzYiAf3L5Sg4wGi3IHpf2AOTV+tddtI8iqYxqtnsWz/6kNKkCxK4q2s5utvgFr4DXc4COqZoI9at+nRkgbsasdwuakSiU67fZv8W9srfKw+lA= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB5959.jpnprd01.prod.outlook.com (2603:1096:604:d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Tue, 2 Apr 2024 02:24:16 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Tue, 2 Apr 2024 02:24:15 +0000 Message-ID: <87wmpga4ds.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown Cc: Linux-ALSA , Khanh Le In-Reply-To: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> References: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: rsnd: R-Car Gen1/Gen2 exception Date: Tue, 2 Apr 2024 02:24:15 +0000 X-ClientProxiedBy: TY2PR0101CA0035.apcprd01.prod.exchangelabs.com (2603:1096:404:8000::21) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB5959:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YxXGby2iiF7nIoZTqgjM0rWmH4kaOI2+NKXoxKIRwlkYtU5h/c4zRse0WkeMK1IJLr3u4zXIp81RUGoMjitfHpkrxeG4cMtd+S50hJTnq6c+dTkEAPVOG+vVw0dCTU6/NYINvTMZ6w6JBvGtc5MF2Jp4pWjurhEBYYMv6tLLVpocWIrPhjxoT1lvdYVH3eZ9FtkwQEb1jcLr62CvvV54lh3KbMDmYNpH4EJwuu9ZjjLzJ1Q5Gs33EBAZvAfxf3ZqiUflBzZnPWqRsEDa8I1mvsQxOyhi2yHOPAkh4xk8kkRH8E/4tyYADlSsWdbkFYchggdBXNx1R6Punnz7x7ak1PQ4q5EMfn3oUBSN98b3TR/xRUMooA3ZW3QGzcMCvsRVqRRxN0qOf9UspTxGiA8E6ZRN7CdOJlHHvMd26fDpDBJ7I37aGFhZheM8ZAn1aFrD5Asf61gMHFs+VqHQqc4GDfhOn3SdvWyTsbIqLIe1L5XaJwaOtzMbtO4fv/qYb14OclCrVubwWjU3vDLMHFjLDuMrKx2XwMz/Q8rQd8BYNHL47SqcQ+vnNY4hw01B3YOaTNLHlADZ6+OTLizUEA2hoQMnezmyhvnBVESgppl1kCUFQmCVGiVj8De257Ni6CKmIzGniKGB0pLFFkxCeJoLMRmoMBSIH8+dN6wfRrNOmEJgPL7gaPdFrYqp/H8GkTxBKwSx101SVdacpCvxFhe5FZO7K3V3BPhLlKjtBlywE8A= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(52116005)(1800799015)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m48DlWlKWVxdmqBx6p/IOzQ7oHsCsIZNNbhAFrOzCtAl7U7dPwGHTwMotd97b6Boa7Qav/jv9L5D8CNhKReU+uIEeVnwBz9gFZF1qtSWRg5Rsv88CpMWX6m4alTY3K+6oEuIJsGiqaZ3NZqDPkElWApNgY6m7sEG2+wytCAC1MoDxOLi4I5ucC4At9+nnVB6YPWJW5gEZooXXsUD9U4AmRsG6eImiZHp0+4Q5VXBwq5a67USDdWxME4bdYJPXUMPtESHeRIq3hOvNOa1vBCGwRVqv+PMIFZt3mpsLP8jtvoN1TTWQ9C3rN7daDE8vcgHiUl+WAWvk9K+RY3wn9XYU7VThDTtHGn3DdimuhRaz34VGSmlWrlw4WASD4eeNUmklw029Zcur60VtVv2wG0AcmKpIhwbTG8W1xf4xof32U/tVKD9z2Q3pDWJSnhSqDf86JchyqWwPfESOTADrRdEfSuF7TxIxRR0b4SNdtI4+R7FwPs/aI4s8+DWlyY20kdqYVTIJriDVooCM6E3iwiy9Fsik91/S1NcuUTscSO/sul0QmI7ONH5oXsIKxnppjMMUj6L40xMYianhwT48Majh3iZkuBtF7MlKlgBKMMB21M3onOhnUjCCPgJZmnNOpXJeTJbdPWpQ1HUE56CYOesjctOUlEt2A0jpvV+pV0NhIb2N3CruW/4/88SUhIN9/nYpMkMMy+mC/8h2n5vR4p1/GD5WGJQyI/NWjrgcggq0HT5DJQDe/kdxbzP/iHiuXDAcWg1zYo6o7oTx0CPuIyunylUZdzrKdiS8T0EY/PnnTHEYihwRpxqrmkzxDXXQFyKg2b4tJJLR9I80exJymNSgWscylZwyI+zI+fUfIzLWhfXrzT262k/Wunz0Wj2Mur2RPykzqrG3oV2sb1Soa7eB/yf3RcxrNpKrVUTZt9EkWPHgyvNji1YV1BIIXneM91h+kt2OgHmyWIdAiX3xGUF7WFEfkQ8BH9BuuT7gz+VEcxGGZoHtOUxnkra9sXkC1xPOthXdp0oHk7dYz8TOK1ATxmHVDb07nnm3SpNPudxHs8Djd+UMK/P6oFeD9z8XqjFqwN+A9Xh2mUEn/KL1u9AFJohHYOtKQP+zsw7B9hRJELSlmLcYsQ0tJHb95cey2Dyu+6NDfT0JCKtxLQGz7dHMGvXKWm0QrZlc0y0wRCou3FsDzSuyxFPMTIx2H5vBvWkFdWekRfRJcjJ5vZFWC2BSI4aHNwH/3VwwoojM2ARhROVT4OTmzwkzYZqev48k0qiloxc6L5D82khrBmCUa7rlVZ8G5sf14hHoasSrD1RBB1DHubBUn/9zbsRvpveeZ/FMBkWpf3AxUVWUMh9cc/WbRDuw+j7gCT2CZidObmL+XTXQ3lNxKrgnAkrhP6OvSbnJlY+f1rm0F0aazmO7IhAfA4086EwUBolX9Xxe49+fW48mXYT1dOOXD4qACGGxPNeoy/UN72vmn1tl7610HFF0JUd8DhFFXz3Z///qJpNouEAgeJCcb7OL18E4RZtob33BehyHNM1D3BCcVvzcEuN9tXCF4CTy4YHWKYHYegFV708r5AS9K0eeJN7uefnZv8XyyXbRI6u3ukThhZLdh+OqfWkc1JUoOxQEtYDipXLCE4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c2f5c06-32ff-4e1c-32b2-08dc52bbfe43 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 02:24:15.9101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qAS9q8/SQ7vZKqob7LP9O9F9GmoK0SFXtTDqU6H97Z+UbDae9krMmb8RuYzZihJ0LRTSb8zHPpXVGpnKEZTrWVvMRrjDFEbTZSPXnN0ECEX03xI0K2yuXIHR/8ZXNgGD X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5959 Message-ID-Hash: DLW2CXAU3FIUIVINUNNRGPNKILEWYCZB X-Message-ID-Hash: DLW2CXAU3FIUIVINUNNRGPNKILEWYCZB X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Renesas Sound driver is using rsnd_is_genX() macro to handling difference. We can use "grep rsnd_is_gen" to find-out difference for each SoC today. In general, driver uses flag to handling SoC difference. But in Renesas Sound case, the differences are very specific, if you try to make it general, the code will become be very complicated. Some of them can use flag to handling, but we can find-out all diffence by using "grep rsnd_is_gen" today. It is not so good, but not so bad so far. So we will keep current style for a while. This patch cares Gen1/Gen2 exception by using negative handling to makes no more update for this part when we support Gen5 or later. - if (rsnd_is_gen3() || rsnd_is_gen4() || rsnd_is_gen5() || ...) + if (!rsnd_is_gen1() && !rsnd_is_gen2()) Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 0b1aa23c1189..6bc7027ed4db 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1512,7 +1512,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) continue; for_each_endpoint_of_node(ports, dai_np) { __rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i); - if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { + if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) { rdai = rsnd_rdai_get(priv, dai_i); rsnd_parse_connect_graph(priv, &rdai->playback, dai_np); @@ -1531,7 +1531,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) for_each_child_of_node(node, dai_np) { __rsnd_dai_probe(priv, dai_np, np, dai_i, dai_i); - if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { + if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) { rdai = rsnd_rdai_get(priv, dai_i); rsnd_parse_connect_simple(priv, &rdai->playback, dai_np); From patchwork Tue Apr 2 02:24:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 785188 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 0A213CD1288 for ; Tue, 2 Apr 2024 02:25:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5970D2365; Tue, 2 Apr 2024 04:25:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5970D2365 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1712024750; bh=RcuBCc1hI6mYn2nBjllBUwPIZ/snnQB5uJTo497fbyM=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e9FMvXb8nWlTHHI85N9hwm//dgXU/qy+sfH2jxwGZr08fssLx8xSZ64T7aLY2B0nX 2OXmgGLAyKqS/0772gI0Bc/o58Z4D93kELMmxFFLiz0ft3hGEugLBKcq4ch0FnML+Y 1cTkL7sJnzatNylk8xoSM8bcAeG88FfNR1UMkSO8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8B13EF80631; Tue, 2 Apr 2024 04:24:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B74C6F80635; Tue, 2 Apr 2024 04:24:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37DA6F805B2; Tue, 2 Apr 2024 04:24:33 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::700]) (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 C4816F8056F for ; Tue, 2 Apr 2024 04:24:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C4816F8056F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=fKcsiLz5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJI3gCmM19LGCFxXXXJEfyNt4yEhAhbuOY/JzAdIizOXqGy4YpRy9VYBSYW3cDib/RFrJgc6CBxW8ylM1zp1jMk+7ooFtHIeWKFKNRtSWreBVF5jQFxUPow8PIDxvPMy6RJsu6stUY7HOqggxvcQZIpHmeDhP68OuFCFpvl5baTcl6sRvkB1HuRRUWmNN3D16fBHgO09ezjE4AoHdV+v/n/z7vsNBjg1AwZHRegQtmQ3i4kH3PE/tn2umdpmUMejqccMhL3Hlqi7lmO3EoJHBqlF7yf9qSg9ke0A72X6a8NUL3bYTx0myeu/Widkou0A8PmZBOh5X8IfDU8eFLxTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LOnWMOL2z8ejzyivRcwq1uk6GGK4WxrOXuVBBwZVUjw=; b=ioUvAoxUksoMhDpZKxVEMcDQuhQBlwgFVhU1h8mCEZiufB8det79emKKYGL53C11QDI37J/ZNoFhmr2e4sYl1nGh+Q1sOMOh5UCdfCGqBrm7fmKawEDvM+pH72uDEej5AU5XnHBLuvQ40knEg/ahzLLy+vwPj656bMPffedYZdAi1NA5N49g34EfB+WwF2PZxII/UvsXb4nSBYMC88gKylGu3AFHKEJDEXNvhIMsZ2jAO8m9WnOPepLOyu0IYSusuZwWdvb7e+mTvFCD2V0nnvVNuLgKbTpg3RgurIajy3ki0+bbtlORjt7s0dYbTxPpqwo7MrXhri/10XosSpDMXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LOnWMOL2z8ejzyivRcwq1uk6GGK4WxrOXuVBBwZVUjw=; b=fKcsiLz5PT/O2KHNCRA5eFQrYRFPOqZqlAwkqLmLUH8iPPZhVwVZwBWAE9FGmq1BZzLj4SZjwqiobgq/PacD84x3wQ1kVhhRmmVpl4Jxfi/+h1HxYGJMqtv6x5ZYF8SB4Em1Zw/ipRoUlGSgvYof0xG87/KPIly2W7MAv/QCmLA= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TY3PR01MB11608.jpnprd01.prod.outlook.com (2603:1096:400:370::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 2 Apr 2024 02:24:23 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Tue, 2 Apr 2024 02:24:23 +0000 Message-ID: <87v850a4dl.wl-kuninori.morimoto.gx@renesas.com> To: Mark Brown Cc: Linux-ALSA , Khanh Le In-Reply-To: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> References: <8734s4bizh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/5] ASoC: rsnd: no exception for SCU Date: Tue, 2 Apr 2024 02:24:22 +0000 X-ClientProxiedBy: TYAPR03CA0024.apcprd03.prod.outlook.com (2603:1096:404:14::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY3PR01MB11608:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uc0LhtpPhZ7Ov1BIlmolmKL86Q1qiJVD2ydFGyhJWfn8MEAeY2RUkX2tVf4FeLgeNqCPUQ0UMQWC2DdVWs5nxd/R3yoJiqT8dGC1Iaz4A3PGm8r2eGkx1bol/Z39vYD2FXQLmzLAKIHThnSXlAXyPxnSfx8UePG4O8CaZvECDPqPOb1Dna2oJueTozmczJ4yh+dlWOxHhcvl94D71IPL7Sd++DQUkccyxnvSjsFmqNIW7uuvgKpKksKMztsISFk7Xu/DpoMoSmaelUM2IGp9LyB8y5oaSHhbZkr/rbbRWTDsRZhgCs+lINoxnEN2/oG6xWF+B5L3/pz5dLT+IoRlL0+vgVlH8ccvTAl1niU/7iCN09vTCMCNU56nSBGYnNnN9X6Lr3QEpEjMVH2VmcGZZPEcbImbH5nlMtxfl2UCib5RxclqZgts7DTLr/cpXLNQ1hGuV/LvtP5EIq1QuD7SFq8iKEcb1tuUSnmuyfi7x+Dpz0REvctteWeB/6/MxfnbWeHqxWJq5E2A3XlKzG0OzsTccdwSeaiHXkCw//QdmMnnTaP76dDoYzNEzzwIw6Vi5ymlC6YJfWe+0V7qjzWI41YHcra7REqlcR2dcU7zC0gjwN7EZW7QSPObKZPGBqMm//uoIs5olOhrOPyYkbV/KPR4Y/p94mDQiSuIb2gF9GDogx1RnFzd+Do5RFfxgBwsbiYewhVSPB7bARgQGFPipmPtksmy6oJ1EUHpfezBAsI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +OHQI6dFHhCxzxZ636Mxd0slS0i5Idl519gkDd7JsBsDQ6xZEJdZX8f1Fiy5QDdugvZkJIGTX1OcWli2KyUhKwa+35+GeiK5S+Q7qMie/Ujwt0UAnnRoWyl+Ps2Obb5lHIRn74oILGTCZb5qzlhQCWZmR0eXc2z3dpB9jMBjdse8holm+CHRj3hkg0Na+e4o+OGVkFx6m6I3eSPqtEbyXaz8FN9WiVJfrTlZWPrEG36KlcXyshwbdcahuhK2AV+5r7lmGUjwZy3yhyk01nnHj2pC7ebckpWfySDiVe1SPpEwH9+YmCvZOYgJayZAKqzqlEpMSiRYYpEBuqzJmj7eLEyR1I3KAPR5qQy40CDbywpWrh/k20G7pTwQYoOV/D/XmjqTxvkjnN9NAR3cIEtYjTxcdUa+zysWyKnQZvE07lQi4juL25jor4e/kLlppnzjc/zHIxoZ2Fbf50EX09EJDE+AbokENktBTrO5iLkRJm7dRcs6kVjCkHAEbncOzRdcH3BZytoUnFNcXtoAJ2Dc0mPaAfgZhvZVn3yLULLicnSXXATeTeyMO6wM+2cJtnZgzwomCHPnwPm9NXH79FZXwddTP6VlR7/rKbImTwYknE+lpB3dadxwUFHl/ZEhJLtWFtsHV7tQAycz9AQ45vBo5wLwahTUqcSy1Rqkv0PfCBIFusbeqi74eog1oZ3V7h7IJLa3CYgcMlOocDR4RGFbw/jJBd/YWpxiqDlPCjYM9x7FN6ovsL/IQr7jT8J9/UCwX+s483qMmRYPmxlnTDIzVCDv/fSSl0ppzqaA2jtTjKAKGLRr1tveUqyQ3uPg9/Gr1EVcy8ejYfKCDPF2SU8zvplFTHLqlGyJ6/xNlyjCqbF+gSMux+a9grwlNtGjg3HfqYgguxPtFORTKc23fdD18N69wKw7lTTiGZY317ZIrLXYsjzEqvSenYo7ELBpJ7FKssh4qL+CSUo6+RLBqrYeu4p4MnHlRIeZLKEz+Ypw3UK8tkmgcRL7BebcHelrDF63cH43/23A260hQT1MbEO4PM9I+psWQQN3vLnB9wcEQ5eMCTW6AifsGILd98+3itliWtHq5jKSaj1ODkg3UOs3n72y+F0HRhbCIjij9ga2Uq2JgmMS15cdFk5pxIo9xAPMnJXE5L/yo4rEjSF2p4134F4o2PdjM+Ko96S12BPl9fcrBiN08lSh4Z5ugZsgQwuIDkiogchGSiBdxSTcRMykQkduFv4p6Eqh/Naci+Zcd1dAMqi/kLa25bFQ+cGX6pBByL7l3gl4cV9rs0QU/1q3ozveYNwjmZsJbkaErgfadC2uAQBoHNM/CEFOXRotS378BA3p/jc4FtQFgMGrSPxOwWbm2374tSz9rfpjMQ9Mz/5dsUh75k6qcYviNKnBx3nSRJ872B6ErSwesVUJPMvdo/O24vwDXZ1sdEVlK5xq8Ra6r/jWY6D5wsg43b/x2vD6yZFpxoMKaLw6FrulLE7v2ZxlU9llW0spXVDyvKNyPBPRPjp/zMkJJhABC2cxoGIZmhZdM9E9Zv4aKwwgWcnfL+Ze128sA5LuBF8nBWvzpRGQIxMv60RLZy6bdmWkMP7TdRDvFB4FEZpDVuyGBIB/grPE7+qSB5EV7j5HHE+FOSw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7d57da2-c2e0-4be7-ebdb-08dc52bc0259 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2024 02:24:22.8628 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m4enaUGZcQmPtE0lflpUi7Vk7COEXhAoHHB19EPq62chxUvY1AxK6aS9JaLOGACk6XLy+iajLRuCJ4+RogdtLMlsO9BBppuXOrNmjk73MAtvBoJB2PPmqPO9WMYVA932 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11608 Message-ID-Hash: UOKD4F3EL3ECIYFYYRN2HM5KMTTBUC3A X-Message-ID-Hash: UOKD4F3EL3ECIYFYYRN2HM5KMTTBUC3A X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: R-Car Gen1 and Gen4 doesn't have SCU, and current driver checks Gen1 (only) on each devices (A). But these drivers are assuming it might be not enabled after that (B). /* This driver doesn't support Gen1 at this point */ (A) if (rsnd_is_gen1(priv)) return 0; (B) node = rsnd_src_of_node(priv); if (!node) return 0; /* not used is not error */ Gen4 DT doesn't have these device settings. (A) check doesn't work for it, but (B) check handling it. Gen1 DT doesn't have these device settings either, and (A) is handling it, but (B) only is very enough. (A) is no longer needed. This patch removes (A) Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/cmd.c | 4 ---- sound/soc/sh/rcar/ctu.c | 4 ---- sound/soc/sh/rcar/dvc.c | 4 ---- sound/soc/sh/rcar/mix.c | 4 ---- sound/soc/sh/rcar/src.c | 4 ---- 5 files changed, 20 deletions(-) diff --git a/sound/soc/sh/rcar/cmd.c b/sound/soc/sh/rcar/cmd.c index ec086d8e4d44..8d9a1e345a22 100644 --- a/sound/soc/sh/rcar/cmd.c +++ b/sound/soc/sh/rcar/cmd.c @@ -157,10 +157,6 @@ int rsnd_cmd_probe(struct rsnd_priv *priv) struct rsnd_cmd *cmd; int i, nr; - /* This driver doesn't support Gen1 at this point */ - if (rsnd_is_gen1(priv)) - return 0; - /* same number as DVC */ nr = priv->dvc_nr; if (!nr) diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index a35fc5ef8770..a26ec7b780cd 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -323,10 +323,6 @@ int rsnd_ctu_probe(struct rsnd_priv *priv) char name[CTU_NAME_SIZE]; int i, nr, ret; - /* This driver doesn't support Gen1 at this point */ - if (rsnd_is_gen1(priv)) - return 0; - node = rsnd_ctu_of_node(priv); if (!node) return 0; /* not used is not error */ diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index f349d6ab9fe5..da91dd301aab 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -331,10 +331,6 @@ int rsnd_dvc_probe(struct rsnd_priv *priv) char name[RSND_DVC_NAME_SIZE]; int i, nr, ret; - /* This driver doesn't support Gen1 at this point */ - if (rsnd_is_gen1(priv)) - return 0; - node = rsnd_dvc_of_node(priv); if (!node) return 0; /* not used is not error */ diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c index e724103a2e8d..024d91cc8748 100644 --- a/sound/soc/sh/rcar/mix.c +++ b/sound/soc/sh/rcar/mix.c @@ -295,10 +295,6 @@ int rsnd_mix_probe(struct rsnd_priv *priv) char name[MIX_NAME_SIZE]; int i, nr, ret; - /* This driver doesn't support Gen1 at this point */ - if (rsnd_is_gen1(priv)) - return 0; - node = rsnd_mix_of_node(priv); if (!node) return 0; /* not used is not error */ diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 431e6d195b09..e7f86db0d94c 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -652,10 +652,6 @@ int rsnd_src_probe(struct rsnd_priv *priv) char name[RSND_SRC_NAME_SIZE]; int i, nr, ret; - /* This driver doesn't support Gen1 at this point */ - if (rsnd_is_gen1(priv)) - return 0; - node = rsnd_src_of_node(priv); if (!node) return 0; /* not used is not error */