From patchwork Mon Mar 11 11:13:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13588609 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D8E2EC54E58 for ; Mon, 11 Mar 2024 11:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jx6TKURZnTtiViRim9xg1X15JeCGcpzeXGF/dT99+tY=; b=RgGXTKTEa2fi0L A8F9KQO5TjXb9h8qtK7wn4SRj8BOiwwb2rqBTFIRhYo7AzTczvHzkNvvU47y3BMr+gbj/9nDUD9Cr 0Vg2S6aORFMDsn4tfyiwHYiRQSVqYLQkivO7OinktPCO+lVDKl5VsJTE5jGj7ZTES2NwLw183tSd8 Tg/jlh1kaw2bGoonsXjx4s0HqjtBU6HgKPSI8m+aQg0FdCFbHvEPq4JXvJd6+yM8FrpeINnyhcrxF MUaYNvI5fce9N1OU+ULjwEE/uHdRsfBCu6ufZbWeKG+7PMwqu+cjXviLWxnc9Q8D4FxgHmDl77Ouz eAJ4T0YHP3hp5hww2kaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjdcU-00000001EKH-0hf2; Mon, 11 Mar 2024 11:15:02 +0000 Received: from mail-ve1eur01on062c.outbound.protection.outlook.com ([2a01:111:f400:fe1f::62c] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjdcL-00000001EBM-3JcQ for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2024 11:14:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oPK5leh7gLQEuREzNWsrpaT/mWabDVhi6GMH2cuhzwopwCGGFw+a3EkNSlz4/B3NCobon6mXYma8frgEDCOBwLbOV3CWSARqZwwSAeATQnh4XfSvDSFEvkjSYUdG9xtxkNIvW75pi/oJgk1b8Dswt9ZrrzZDRROQ3CG8H9/FJrJrQVxA9K1J0pE9q2xj3oX6pecUoDk75uSY63NvetdhT4gf5+3341MKzYR9K0zqVeqNKhybUAtGm3z2DWydXFtkYNz2CdLCCnCiSnA6VJ5zcUc+j+UHcHc/WiZMiuRzYkBYs7YKnUOwTHkJtxFsqxQHztjfru1Izwl16dkWs8PdYg== 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=CaP8RKoyNqXGxOJY7gl5KarHmyUtzc3rg//cAW3HNCo=; b=iq3ibI5wSZf5nil4X85qGqHYbfm01Rsq3WxFvz/0cTxDItEnL9ztgqrpcPK2l6fap9EOwsYU2ugCXlnd3HAQI8QbOLGM6SjBeN8ZkbeICDKbsamL39468ciaaT+6BARyLXUmTQOL7M+GPVY5bqutxbYBEhnCUQ2QFTZRn0kjCEk34+s/nXmf9m1x7CbMph145hzMnkmxhV24Rhg+HJkwqxwC2lWq615gdiLRa3KVcDHOXQb7QLx3pB9WJdYG01K38ww/bUFXnFu/JX1K9iYS7PL2K6ZAM1HFrT8tqhWiUPiZ6po0xbQW5sJCfsAm8cofe0RbBUhhCxKdLiIqu1Fmrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CaP8RKoyNqXGxOJY7gl5KarHmyUtzc3rg//cAW3HNCo=; b=drjX1bWpf/zQ90NB+Oc1YxpbXRy2FGwE9eyv8zAWXIqexI+WDxMC5U9R7W4UGVJZqBW2XupnEG0QClzCvfgakrvr/Aya+zrlp17zLbCCPBTk582jWpqQDB41SDJefcHhdYXORMG1JRzKCn77ImBrCVOgf9GlfQblIy8nSd4LaDw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by DU2PR04MB9145.eurprd04.prod.outlook.com (2603:10a6:10:2f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Mon, 11 Mar 2024 11:14:44 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::4bee:acb0:401a:3a01]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::4bee:acb0:401a:3a01%7]) with mapi id 15.20.7362.035; Mon, 11 Mar 2024 11:14:44 +0000 From: Chancel Liu To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Chancel Liu Subject: [PATCH v3 5/5] ASoC: fsl: imx-rpmsg: Update to correct DT node Date: Mon, 11 Mar 2024 20:13:49 +0900 Message-ID: <20240311111349.723256-6-chancel.liu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240311111349.723256-1-chancel.liu@nxp.com> References: <20240311111349.723256-1-chancel.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0032.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::23) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|DU2PR04MB9145:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b05619b-2107-46fb-c346-08dc41bc74a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fdd5Ajd84kqY8vyNDiO7Gu6jjRISWKMdsHKBlYj1WBB5PPbBah3tOxRBBnXa8YbujafhjrXmTYY9HD4YYaBwC/WmiLUMc6q4CDR7U9Sav+gKzT7lUNlGw5j8JyI+6919LpImQU/Hpt89+juNggub52jpFTCbzNdl9T8nzh1wDNqWleFtiGbC5I3KV0PTnYvku3xhA2kEVGcgiXGFoV3u3o7SkVnQHZ+fhaj8FFMc7WuZl4eeuakwnwMbG03m71rP6q4VgBnygLVRF6esEUYCRP+MlOuRDtSiHRVuDNEbJCVAbDEN40A+P8Si9hRelRw/qE+hfFWtig4YJQd+MtqpzsHiaC/5HJvMtNGrwuSlq3fr07CtR7DJMsePt9W/C8rvwEV+Oh14h7Nbzh0IzIArkhEaSEhPrAv0dZ0FHAO01Ax1iNhBw17kqf+cBG+RwOt2lNs2ZexSkKeb0vellS+XMQWh3bPAlU9D9DwS3PJ26KR/xJ9cPnraS5flLRJcs0rALnWftTPfsw0ZzFBNDVSGtwSaXNl5Q20oq/k8wr5WrWWj6pSCTFO99sTGq9trc/WqFRBkLo7Grd3JaDrp+MCBKr8CzbluyLpHlfQ3KmwIk43CMOwBcrnOm2dVuI76ijXW6UJtlrvZLt5o+ZsdqxABqIBidRH1JXGQ97bhg7jJzcZ9nSc6DRwfzezr7LGaKiglJGn0ZfXUrF85pBSJugvY80uRtBXgtay/e8Y91rV/O1k= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(52116005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k+2Nn6xXQUS4FO0aD2iI5ySlMvQX0UPzSJHbchMzlMrZMlslI5MavC37eUF5p/zw+NxlVTnnLn07AXk762Yz4EumL6v4aiO3ZbBQ09dppkkrAZzab/gjluNvEHUQcfrrUUfZryFJGxv7Y0WXCv9yeaf2TpIajPoN1EiQE9xBH0QPp6hPQlqoYAhLBAV3kJMnePnxVbWCeLNO1FQ4g2lurduCRvncJGuuGiRGgqNDZaLZJTveS+6JlmSh0JdAD4XX7fszMJqHBSvs1WLofKgQlGS2i6uuXBGdwcLXUm70iTt7QKlXRpcEmmPEjyDbkrdx6JigLZ0HncjosKUSmYK25Ru5jfsktgOc0Gqp1R03fEZvDn175coewp9VzVRI6tUOgY7fcSh2kvc/MrUGdpn9SGCIB0U4RJENxJ8+Cv6hvcSn1gZb0gNSNXVFoevkwhgwiaMTHJAK7SYjEWcoHGMbY2o3R8hNuAUK1b0/uCh7Wmvz0arfSK9xSC53WFKGSgjYmyxGAESXVKaUMf9ND2JYNjVMz9lzix+/5vkUCT3ITrUT5qTYZokGsJ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107-46fb-c346-08dc41bc74a6 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2024 11:14:44.8279 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TnuXlIR2zjIQh3anNEhtsjIHWIjTVyVNRh4xKyeptACaOtoEGdyQXBOOOnUirX85gpYtRcznypCd1GGwMRDv7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9145 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240311_041453_960539_72622AC9 X-CRM114-Status: GOOD ( 16.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to support register and unregister rpmsg sound card through remoteproc platform device for card to probe is registered in imx-audio-rpmsg. ASoC machine driver no longer can get DT node of ASoC CPU DAI device through parent device. ASoC machine driver can get DT node of ASoC CPU DAI device with rpmsg channel name acquired from platform specific data. Signed-off-by: Chancel Liu --- sound/soc/fsl/imx-rpmsg.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index e5bd63dab10c..0f1ad7ad7d27 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -108,10 +108,8 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card) static int imx_rpmsg_probe(struct platform_device *pdev) { struct snd_soc_dai_link_component *dlc; - struct device *dev = pdev->dev.parent; - /* rpmsg_pdev is the platform device for the rpmsg node that probed us */ - struct platform_device *rpmsg_pdev = to_platform_device(dev); - struct device_node *np = rpmsg_pdev->dev.of_node; + struct snd_soc_dai *cpu_dai; + struct device_node *np = NULL; struct of_phandle_args args; const char *platform_name; struct imx_rpmsg *data; @@ -127,10 +125,6 @@ static int imx_rpmsg_probe(struct platform_device *pdev) goto fail; } - ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0); - if (ret) - dev_warn(&pdev->dev, "no reserved DMA memory\n"); - data->dai.cpus = &dlc[0]; data->dai.num_cpus = 1; data->dai.platforms = &dlc[1]; @@ -152,6 +146,23 @@ static int imx_rpmsg_probe(struct platform_device *pdev) */ data->dai.ignore_pmdown_time = 1; + data->dai.cpus->dai_name = pdev->dev.platform_data; + cpu_dai = snd_soc_find_dai(data->dai.cpus); + if (!cpu_dai) { + ret = -EPROBE_DEFER; + goto fail; + } + np = cpu_dai->dev->of_node; + if (!np) { + dev_err(&pdev->dev, "failed to parse CPU DAI device node\n"); + ret = -ENODEV; + goto fail; + } + + ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0); + if (ret) + dev_warn(&pdev->dev, "no reserved DMA memory\n"); + /* Optional codec node */ ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args); if (ret) { @@ -170,7 +181,6 @@ static int imx_rpmsg_probe(struct platform_device *pdev) data->sysclk = clk_get_rate(clk); } - data->dai.cpus->dai_name = dev_name(&rpmsg_pdev->dev); if (!of_property_read_string(np, "fsl,rpmsg-channel-name", &platform_name)) data->dai.platforms->name = platform_name; else