From patchwork Tue Nov 12 02:39:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13871674 Received: from OS0P286CU010.outbound.protection.outlook.com (mail-japanwestazon11011002.outbound.protection.outlook.com [40.107.74.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBD51433BE for ; Tue, 12 Nov 2024 02:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.74.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731379190; cv=fail; b=nBYW6mRyCWLP4jrZx75E54u36NwYZZruTJ9hMUbK6WbtjjZkZq1Yhqlc7WsvhqY9ujiI2UoyTrWNzcfzO+CTvdgQxENls03g/8AXVmqKICGkM62+B6SJ3v+QnRqcRUasVX02Kv7F9RmVi5WxDyDiHleITKGRwbG+r9oN+BTDX9I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731379190; c=relaxed/simple; bh=dS+Y/3fLlsln6rMVjBQEevc37pqGd0xL25Ii9oFQQZY=; h=Message-ID:From:Subject:To:Cc:Content-Type:Date:MIME-Version; b=ixD9s1bFYzY30K+vxx0oOCOUCBhXyDE/IE08CNO/Sq6sQ6MCjk1bfi7xk1dVbzrdwhQJjQ8FXTcjjk8x6o0R1hMqc06fcVnAf7EtiAFp99wzp9aRub9eZ1R7uJp65Ig2KdtpjXDhOCW/3wTk954llPtL3n6rMKK8EAWuX+zBK0A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=Z04LTxbB; arc=fail smtp.client-ip=40.107.74.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="Z04LTxbB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XGoCxTsyjwjDr4dOqLD7M355JgGLLDULf+d+ZfOdKn8GW8qzoz/rKsBH9jFLnX0XPCptq2lnpl7HphqA3oq44HupiZ4d7OPrS0m2238YGFQosG3WlB/RGfPDcT5S01wxcCMWhe/v7gF4Db88wm3Pw0DeXz+3hIV4cpI5WFJ34+OUffJOcxIg6tIKvDpBAC1lwgUAHNHAa55nTPON0Kx6XgkN4MhQa/ryudwiNqN3ZS6MTmn55fKSXafckmLcE48yJO+/PvZeVcAA8I2AGz8/iAWc8vfeXsF6Ym9rSYskovAn2y5awNYOAEnA1u7LxsnMzx7PJrKSvaKd4HOKXMM1dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kNTCHmYWkjuF5Bp7JlwsyJXgDsAWGoPANsLBPIQcDGA=; b=sfSkImtSvnvmQvnIJWzQ8sAcjHN4gAaehPu2zfSpEnmpwaN7AVZh1VCHhW3SrkJF+UItfL2wgApqqcXMhU7PLwFSg4cvaKcH+6rCdKqBed6YGJ7cN/8K/nhdqTSn84rLACQjQQxvYr6NjlKKSRktmxqK0Sm/r7dbA7FNj6q9i0zOu85yQLp40mBHoE8Esyb/jVVhNXuDOkvGqqbSCUj/dT5SYwgrGB2yaEQOsxzxjgghHGLlCAltaWG0Y7nb7DdeHWOVnRbNg2n3/0iYqXDP4zTsNSGDoN28r220ICtwfB29E+qD6GnYHgppy4FDt9GVHHhkFa0EQoMh6PI4MIuhsg== 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=kNTCHmYWkjuF5Bp7JlwsyJXgDsAWGoPANsLBPIQcDGA=; b=Z04LTxbBj0JnbgP6Lq0L00KxtRCRR5P+2CYpc7IGieYONx9oStZ57nEviZHY2uJBOdHAG7gin6qFh/aHjHPACrsToBqQawIw62sKZRsJ7RyqlbpeTdrZ8iGQm2v9/gcZaQ7GnBYoN9JIpvgD1XVzSUw3iucDuiO6TVQJ/lYUY68= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYAPR01MB6012.jpnprd01.prod.outlook.com (2603:1096:402:38::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Tue, 12 Nov 2024 02:39:44 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%7]) with mapi id 15.20.8137.027; Tue, 12 Nov 2024 02:39:44 +0000 Message-ID: <87msi5maz3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] ASoC: simple-card-utils: care simple_util_dai for dummy DAI User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: linux-sound@vger.kernel.org Date: Tue, 12 Nov 2024 02:39:44 +0000 X-ClientProxiedBy: TYCP286CA0056.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYAPR01MB6012:EE_ X-MS-Office365-Filtering-Correlation-Id: c4c51831-805a-4919-f848-08dd02c34448 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: ccdPX3zqdcXHi5/dxJDtWTu3d7i78x0GFguwKTI0I/tOHP6rzlxfaS6G4sxOAwvm1TpT6Nsz8+60uo9AluSRllbYNSI8cDo+LF9GPoq3xMbvnak2gOOnWqq+emNzJUeOd7i1QAotCoTlVR6I9/UL2wBHuGrqAMXrqKO991e5TDjCrsKdveE/v3aDb9nYALlGuBx0FaCtlxObaT6OGW/MTn6Ifju9v6LtdASK3IJru12U246P9K9DKWZ8AiBoVxIWZ+cvXhfQi+KAECsksHEEbwF+4h8FAZ/cIfdt3gGHQDGm8y7+pPOwu5d89R9vSytkzfLZMbE0GwuDpISGy5azpTsR5OP13yQZ+Da4tsSkedR8pUsICvelh0PIpY0q3ajF1yUjbJtZDHM1HHenmX62py/nJ7mwRPh3xeWqMeT8Z/ufMzltINNVjWeC4WN8fdp2IJD0LxyVkuINjQ7smY8bVFpUF0SznDvlVDXfF7jpX9x+LPsoY0g9cX0gEAfdMIt/7l0tSTnHgOLFfZw1Jl0wXBF/+ytQy3Wa1Go6yTt/t4Ga0mJh0uyoReLm0GXHcL83Dc12n0PP63Kw0NmlIIXNLEHOY+7oULsyShjnLo3q52a1nMNfUYGDpFKgn9uYW2toqPlyG1FMwjRYJ/P4+1BRsd44bEzvYGGlYaI/nS3BxMllGb6d12Pc6js1wVcW9R/rrIS+kJs4Ub8WDCsTc1N5uK/TYRIBGuz8vWMf2eXDkh84/ZAbxLDVXzMsNjKzgWaEOegZ6ET9QWC6knspld1DVZOmzA72lKTeLTv2w8iqVF3qUv8+j5MXygSxO34yA4Lh+6XlLL/t4XJNJG/b1x5dMJJ05KITKupvG4PAKAdx0VidkKnu3930DQIDVhiFqvC9TmRIde76pJ9JzDSOxTaSKdyk3BmqwPXltmNEBfOwiVWfjIl/yz2rQKYedm6fcxeKskQBBLsiVNswlPmh2yO0yS7QeSmjtSi0A341pA0kxAB6Rp8IJjcUsASGIM0j2O5nMlXS7EufiXZsSVbKNnXvEwOb+fMX73JdH4uTLb4eYQ202hzFxVgIS1i6bf8MHOlZeFScKgespGnxblDC21EFW3WU4JzzEc/jrTuL0QNh+DCQDZkfcXGNzxDsn1T2imSEEBsfrWgNvqqpLpJ27/pszI88azUCUO4mKd4rnBltt+oV2XdnxJZhi/OK43RZrovBDuZKJPa72aqhNNVH/xjb4eKDi/jf3oPix6MbYIWuIbzMVjVfciUDL35LrSq0/Q5tlYrpg9zbvPEcFj0GZTzgikCcIP/KuR9e37hxPaLbVDrBC3qJEx2HUsJImOvLS5o666bl0Rn1Tx/CwBO791/9PC9/TqTTHcW3PrF85Adlbtg= 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:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9egw9U6qDWKYOpt8yMsjHzfJ8tZVvRbMCHu4n+GqYtNrvR9xpMkurux75n5RMpJqkIGKpkHp4jhIOpdjBotAIwXMpzUihT6OekMFyPvJLCHzQ02nmGA0Lmw9l9T6z6LcAR7Aoe/ucJysn9o0gMgpJBL7IYdjE1lTVP9HlF10BpJVUXsKfj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F8Tx68OA1F+UWqb2sIEBBLdfzYSgFr6OSTg2xDNi0Oi+YJJQ9oYq+K03nFYgnB54S4DTWyuHY1dSPg8tj00tUgm9QInxfCYLwB7ujV9j4As2PGRFMyp7ZKa5Ywx+xbWzq3OqFAb29RSoIJkajWsEBO0Bc2Q8ysGgbqScTg90l9q8TJooo19DRkNwlK2hLmQt44ulyekwWdc0C6ay17UC1bBo7fr+oAM6JCdAokivlDp/sr/EDGLH+98FsBmPuosGjZVqXzJGCZga9vYAdn/NaGKGgcPDM7KOTuTHHVl4HnbqE4JXWLyKsreyIl6vwFnLXxcbJZi6oNp/Fz82KbNLPcPXGSKD1dVHBhuVRcrw7dTR4UXsUSXKRKSuUyDwnRZP2+HVbm+zihlMU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4c51831-805a-4919-f848-08dd02c34448 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 02:39:44.5250 (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: F0GNNvZQvSHXRtCGhwgU2SeJKpmIFC7gCoHB+1Tdjlv8IDFQOT5xJcsZbVc00/Iyfi94uvPy/AW8v+EywYjBUciIX3dUARxL85zm7xBJolWur+Xu4esdmaUDQrpYRlr3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB6012 Simple Card Utils has simple_util_dai which is paired to snd_soc_dai, and assmus that CPU/Codec DAI and its paired simple_util_dai are same order for CPU/Codec simple_util_dai[0] <--> snd_soc_dai[0] simple_util_dai[1] <--> snd_soc_dai[1] ... So, it is using same index in for_each loop. (X) gets simple_util_dai (Y) gets snd_soc_dai (Y) for_each_rtd_cpu_dais(.., i, ..) { (X)(A) udai = simple_props_to_dai_cpu(.., i); } (X) for_each_prop_dai_cpu(.., i, ...) { (Y) dai = snd_soc_rtd_to_cpu(.., i); ... } But current Simple Card Utils didn't have simple_util_dai for dummy DAI. So above (A) will get NULL pointer in such case. This patch cares simple_util_dai for dummy DAI. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card-utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index d47c372228b34..24b371f320663 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -858,6 +858,10 @@ int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix) } EXPORT_SYMBOL_GPL(simple_util_init_aux_jacks); +static struct simple_util_dai dummy_util_dais = { + .name = "dummy_util_dais", +}; + int simple_util_init_priv(struct simple_util_priv *priv, struct link_info *li) { @@ -929,6 +933,7 @@ int simple_util_init_priv(struct simple_util_priv *priv, dai_link[i].cpus = &snd_soc_dummy_dlc; dai_props[i].num.cpus = dai_link[i].num_cpus = 1; + dai_props[i].cpu_dai = &dummy_util_dais; } if (li->num[i].codecs) { @@ -951,6 +956,7 @@ int simple_util_init_priv(struct simple_util_priv *priv, dai_link[i].codecs = &snd_soc_dummy_dlc; dai_props[i].num.codecs = dai_link[i].num_codecs = 1; + dai_props[i].codec_dai = &dummy_util_dais; } if (li->num[i].platforms) {