Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1490412imn; Sun, 31 Jul 2022 08:59:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fsJm00GAkW6JXaL1LzMXUXS1MOe7Jbm8ZpdAbnF55ir3YpIEyp45eaXaUB7KU01MAiudC X-Received: by 2002:a17:90b:3c0e:b0:1f4:d764:99f8 with SMTP id pb14-20020a17090b3c0e00b001f4d76499f8mr7436793pjb.91.1659283162352; Sun, 31 Jul 2022 08:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659283162; cv=none; d=google.com; s=arc-20160816; b=vJ7kNLnReeRuYtiy7/S1cFKOy+V7wucEtJf3CLK+CEvSw34JFeCSg/DaaPLjtoxlmK rksYZyqPIIeFi3tI4tsd8UgSX3vpBQE31Fm6FNUJlukElPgs8LUQs24GodBhD5Z+Jh49 +OuKNcJeBNCzbgGLfbWjwE9D6xZHXEcgi/cVXffPphueoavS2yYoTmC4naWh8YewPdPI 18wLtQYIzFaDJwNQiQ9jc6Sc5y3lipGI43L+Sq3CbIz3OFrMo87NqF9HsFThE1mJXY14 ekTJix57rqgRDmx/M0MkwuiBxhYiXWnqR3l6dGOOwpg99iLXq+B4WGwDNQyeweST4Cjd HRYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:newsgroups:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=Pm70wOZ03VXNHptqqKztur9HBFdEzMrOdB65wWGGB6w=; b=L0TumDL5P+jocJcHdjkrnhyhgre+QjtIyosp/IZBIJs+fkgeImMswgV0NIfza3OYNz WshKENM1v//Y+sYpkmsdJH2OdbMCUviqkPe9DazL96MXEoeKvHkv/CzSRYCKHesKz0Gt h6rKgNjo/oq5u1mqttc3oRKuCCR0u0dE1A5+vnst6t87Sp0tkG5/xQcr9Vnu6SqdV1Xe M5bWZAzmB7CLJEZqhjThSQUJZXJkiba6TkP88B0MAEwaeDULqjGNuzl3NmL6BEIotD2g cyrSxHbw/CZ+l+Ut5Pr8lCKSyVKddd9wGKUsChxqO+UUNVxvU/fF6hjnpN05yjumxkov J+qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020a170902f55200b0016d5629a668si5823516plf.258.2022.07.31.08.59.08; Sun, 31 Jul 2022 08:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235943AbiGaPlh (ORCPT + 99 others); Sun, 31 Jul 2022 11:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbiGaPlf (ORCPT ); Sun, 31 Jul 2022 11:41:35 -0400 Received: from smtp.smtpout.orange.fr (smtp-12.smtpout.orange.fr [80.12.242.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D71F1E0B9 for ; Sun, 31 Jul 2022 08:41:33 -0700 (PDT) Received: from [192.168.1.18] ([90.11.190.129]) by smtp.orange.fr with ESMTPA id IB4IoW8sbLFqbIB4IoU93a; Sun, 31 Jul 2022 17:41:31 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 31 Jul 2022 17:41:31 +0200 X-ME-IP: 90.11.190.129 Message-ID: Date: Sun, 31 Jul 2022 17:41:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 3/3] ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform Content-Language: fr To: V sujith kumar Reddy , broonie@kernel.org, alsa-devel@alsa-project.org Cc: Sunil-kumar.Dommati@amd.com, Charles Keepax , ssabakar@amd.com, Ajit Kumar Pandey , venkataprasad.potturu@amd.com, Meng Tang , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , open list , Liam Girdwood , Yang Yingliang , Jia-Ju Bai , Arnd Bergmann , Akihiko Odaki , Vijendar.Mukunda@amd.com, =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Geert Uytterhoeven , Dan Carpenter Newsgroups: gmane.linux.alsa.devel,gmane.linux.kernel References: <20220707161142.491034-1-Vsujithkumar.Reddy@amd.com> <20220707161142.491034-4-Vsujithkumar.Reddy@amd.com> From: Christophe JAILLET In-Reply-To: <20220707161142.491034-4-Vsujithkumar.Reddy@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, this patch has already reached -next, but a few nit below. Le 07/07/2022 à 18:11, V sujith kumar Reddy a écrit : > Add i2s and dmic support for Rembrandt platform, > Add machine support for nau8825, max98360 and rt5682s,rt1019 codec > in legacy driver for rembrandt platform. > Here codec is in a slave mode. > > Signed-off-by: V sujith kumar Reddy > --- > sound/soc/amd/acp/Kconfig | 11 + > sound/soc/amd/acp/Makefile | 2 + > sound/soc/amd/acp/acp-i2s.c | 137 ++++++++- > sound/soc/amd/acp/acp-legacy-mach.c | 32 +++ > sound/soc/amd/acp/acp-mach-common.c | 86 +++++- > sound/soc/amd/acp/acp-mach.h | 6 + > sound/soc/amd/acp/acp-pci.c | 6 + > sound/soc/amd/acp/acp-platform.c | 16 +- > sound/soc/amd/acp/acp-rembrandt.c | 401 +++++++++++++++++++++++++++ > sound/soc/amd/acp/amd.h | 62 ++++- > sound/soc/amd/acp/chip_offset_byte.h | 28 ++ > 11 files changed, 781 insertions(+), 6 deletions(-) > create mode 100644 sound/soc/amd/acp/acp-rembrandt.c > [...] > diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c > new file mode 100644 > index 000000000000..2b57c0ca4e99 > --- /dev/null > +++ b/sound/soc/amd/acp/acp-rembrandt.c > @@ -0,0 +1,401 @@ > +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) > +// > +// This file is provided under a dual BSD/GPLv2 license. When using or > +// redistributing this file, you may do so under either license. These lines are useless. There is already a SPDX-License-Identifier just above. > +// > +// Copyright(c) 2022 Advanced Micro Devices, Inc. > +// > +// Authors: Ajit Kumar Pandey > +// V sujith kumar Reddy > +/* > + * Hardware interface for Renoir ACP block > + */ > + [...] > +static int rembrandt_audio_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct acp_chip_info *chip; > + struct acp_dev_data *adata; > + struct resource *res; > + > + chip = dev_get_platdata(&pdev->dev); > + if (!chip || !chip->base) { > + dev_err(&pdev->dev, "ACP chip data is NULL\n"); > + return -ENODEV; > + } > + > + if (chip->acp_rev != ACP6X_DEV) { > + dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); > + return -ENODEV; > + } > + > + rmb_acp_init(chip->base); Should rmb_acp_deinit() be called if an error occurs below? Or a devm_add_action_or_reset() + .remove() simplification? (this is called in the .remove() function) > + > + adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); > + if (!adata) > + return -ENOMEM; > + > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acp_mem"); > + if (!res) { > + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); > + return -ENODEV; > + } > + > + adata->acp_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); > + if (!adata->acp_base) > + return -ENOMEM; > + > + res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "acp_dai_irq"); > + if (!res) { > + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); > + return -ENODEV; > + } > + > + adata->i2s_irq = res->start; > + adata->dev = dev; > + adata->dai_driver = acp_rmb_dai; > + adata->num_dai = ARRAY_SIZE(acp_rmb_dai); > + adata->rsrc = &rsrc; > + > + adata->machines = snd_soc_acpi_amd_rmb_acp_machines; > + acp_machine_select(adata); > + > + dev_set_drvdata(dev, adata); > + acp6x_enable_interrupts(adata); > + acp_platform_register(dev); > + > + return 0; > +} > + > +static int rembrandt_audio_remove(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct acp_dev_data *adata = dev_get_drvdata(dev); > + struct acp_chip_info *chip; > + > + chip = dev_get_platdata(&pdev->dev); > + if (!chip || !chip->base) { > + dev_err(&pdev->dev, "ACP chip data is NULL\n"); > + return -ENODEV; > + } These tests and dev_err and return look useless. The same is already tested at the biginning of the probe and if it fails, the probe will fail, right? > + > + rmb_acp_deinit(chip->base); > + > + acp6x_disable_interrupts(adata); > + acp_platform_unregister(dev); > + return 0; > +} [...]