From patchwork Tue Sep 27 11:34:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 12990475 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 C3DBBC07E9D for ; Tue, 27 Sep 2022 11:36:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C8C9D1F1; Tue, 27 Sep 2022 13:35:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C8C9D1F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664278558; bh=g6EgBQsu7Hx6HNkg4vQlyFT638t277ViWzx84i/23rI=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=EHI0vb6ZnR+l1lTANr4RjmoXne+yGbAJyWlU5MWo4RGvcz7Os8wLy3+9/iRhJxgfR J/JmTIc5FJSLLTTUff1ZA6B1SMgYP3tQ92x2B/7/MFxxuiZbAioQoBeLPfPl8fh9Ld rJ9bLShnJVegoTOcbRx9fMWtOQA1/dX7ik2w74YQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4D515F80166; Tue, 27 Sep 2022 13:35:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9AA3F800AA; Tue, 27 Sep 2022 13:35:06 +0200 (CEST) Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) (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 7DA47F800AA for ; Tue, 27 Sep 2022 13:35:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7DA47F800AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="Nwr09I/s" From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1664278499; bh=nOoQhB339U5GGM36GHbGtBpVI5SaHkuDid0bhw4EnqY=; h=From:To:Cc:Subject:Date; b=Nwr09I/sqmPoJufDCxfV0CwuwcAg026CaPqliB8Oe3lX+CrBM0UrVDJPUK2yi5mTE v8fnko6E1l8dZp8T5Rv3h2rT8UYSLLgRUxfPi9FagnEeKVon6MGyq6OGD8EimtcO5k Zj2oZ7LspQSEulDJ4+BhsWOy2A8fK2xIZGoe8o6g= To: Liam Girdwood , Mark Brown Subject: [PATCH 1/3] ASoC: apple: mca: Trigger, not deassert, the peripheral reset Date: Tue, 27 Sep 2022 13:34:24 +0200 Message-Id: <20220927113426.49724-1-povik+lin@cutebit.org> MIME-Version: 1.0 Cc: =?utf-8?q?Martin_Povi=C5=A1er?= , alsa-devel@alsa-project.org, asahi@lists.linux.dev, Philipp Zabel , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Replace the deassertion of the peripheral's shared reset with the triggering of a pulse on it. This is what we should have been using all along as the platform's custom is not leaving the reset asserted on unused peripherals. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer --- Cc: Philipp Zabel sound/soc/apple/mca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 69643524796e..75925bfcf754 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -995,7 +995,7 @@ static void apple_mca_release(struct mca_data *mca) if (!IS_ERR_OR_NULL(mca->pd_dev)) dev_pm_domain_detach(mca->pd_dev, true); - reset_control_assert(mca->rstc); + reset_control_rearm(mca->rstc); } static int apple_mca_probe(struct platform_device *pdev) @@ -1049,12 +1049,12 @@ static int apple_mca_probe(struct platform_device *pdev) DL_FLAG_RPM_ACTIVE); if (!mca->pd_link) { ret = -EINVAL; - /* Prevent an unbalanced reset assert */ + /* Prevent an unbalanced reset rearm */ mca->rstc = NULL; goto err_release; } - reset_control_deassert(mca->rstc); + reset_control_reset(mca->rstc); for (i = 0; i < nclusters; i++) { struct mca_cluster *cl = &clusters[i]; From patchwork Tue Sep 27 11:34:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 12990476 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 7F02DC07E9D for ; Tue, 27 Sep 2022 11:36:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2EBDA84C; Tue, 27 Sep 2022 13:35:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2EBDA84C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664278585; bh=6ZLd7SiG0U7egjWJYJ+G3LfpGkZQIbA/6DsNXQhV9IA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=r+WB/i5rQoGhUV+ZeBDWwHLLcG+XuEtlpLKOXvTq9cFOvcrfxfJuv8XcwllYYuv/V MCfO1fNrl/LvKll+KQkXtYsS+qXT7QmRV0cp6//bJNfsucds2b0+HjQoxbJcZbpIiK H/X1LOuggUvMrBr0zSUiY7eetf31IhVv+uFwn65M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 07B24F804D0; Tue, 27 Sep 2022 13:35:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32920F80496; Tue, 27 Sep 2022 13:35:07 +0200 (CEST) Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) (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 0B591F8025E for ; Tue, 27 Sep 2022 13:35:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0B591F8025E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="TdnRyzkT" From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1664278499; bh=E6uzsBYVZvDKj1HzGMPEUTFj/LsUV+qoai7hTKUpGS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TdnRyzkTL3T68jSbosljBlber57jYv7P01BI8UvAXOC/timh4FZIMdsfcRwDjUkoW uiLpHwrOe5hrIhtZD0QT2MtkDQl0eSgop2twqhkwRi1Chq3aYOcwpmY2Jp1BQ26N08 aeHZf/OjIVEdY9CBrfyJX2ZSatY6bPwumdHRtAX8= To: Liam Girdwood , Mark Brown Subject: [PATCH 2/3] ASoC: apple: mca: Remove stale release of DMA channels Date: Tue, 27 Sep 2022 13:34:25 +0200 Message-Id: <20220927113426.49724-2-povik+lin@cutebit.org> In-Reply-To: <20220927113426.49724-1-povik+lin@cutebit.org> References: <20220927113426.49724-1-povik+lin@cutebit.org> MIME-Version: 1.0 Cc: =?utf-8?q?Martin_Povi=C5=A1er?= , alsa-devel@alsa-project.org, asahi@lists.linux.dev, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The commit 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") shuffled around with the requesting and releasing of DMA channels. It left behind stale release calls from within apple_mca_release, remove those now. Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") Signed-off-by: Martin Povišer --- sound/soc/apple/mca.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 75925bfcf754..7ca653987b78 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -970,18 +970,11 @@ static const struct snd_soc_component_driver mca_component = { static void apple_mca_release(struct mca_data *mca) { - int i, stream; + int i; for (i = 0; i < mca->nclusters; i++) { struct mca_cluster *cl = &mca->clusters[i]; - for_each_pcm_streams(stream) { - if (IS_ERR_OR_NULL(cl->dma_chans[stream])) - continue; - - dma_release_channel(cl->dma_chans[stream]); - } - if (!IS_ERR_OR_NULL(cl->clk_parent)) clk_put(cl->clk_parent); From patchwork Tue Sep 27 11:34:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 12990477 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 4D54CC54EE9 for ; Tue, 27 Sep 2022 11:36:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5A28D82C; Tue, 27 Sep 2022 13:35:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5A28D82C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664278609; bh=LUW6qsWIEHusQY1XjJ2NLqgzENneXnRIXz+N61I5uLs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pceDqMOwm1ePKQzaNzkKNIHWIOlFdSbagdgUr3fdU/SlZMUTa+sEo44T7lVeE38/7 MeqrQO5XTYi1nNOQOkDBA4DoYXdZKgV3o2r7Mo3d9G1m++l62W1gch8m+7JkQW1Y3O 0lQoynofma+qrfo73K7CulMZV8WZFTHtA5V2CZZc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6DA11F80539; Tue, 27 Sep 2022 13:35:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 428A0F800AA; Tue, 27 Sep 2022 13:35:08 +0200 (CEST) Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) (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 06D8BF8024C for ; Tue, 27 Sep 2022 13:35:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 06D8BF8024C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="epQhjYPm" From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1664278500; bh=5V2FNZPR/FdcUVzzKFU8iKVMDZyNajtosOiBMcFQsT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=epQhjYPmlZqP/1YEmMW5V9o7ox8YLE07sN5IT+3c4uucytmQspASsFu3ECdKzHBZM 8JSIcd4NQFQEypJvmQGjxIizfiCept4da+QPhxsjQAU/aGKhWHHKbEpOeYuqerB1XH X4SwHtoQ81W4y2TV0HWLPL19lYsg1MOs4PqsE6/w= To: Liam Girdwood , Mark Brown Subject: [PATCH 3/3] ASoC: apple: mca: Adjust timing of component unregister Date: Tue, 27 Sep 2022 13:34:26 +0200 Message-Id: <20220927113426.49724-3-povik+lin@cutebit.org> In-Reply-To: <20220927113426.49724-1-povik+lin@cutebit.org> References: <20220927113426.49724-1-povik+lin@cutebit.org> MIME-Version: 1.0 Cc: =?utf-8?q?Martin_Povi=C5=A1er?= , alsa-devel@alsa-project.org, asahi@lists.linux.dev, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On removal of the driver, the ASoC component should be unregistered first, before we start releasing any of the other resources. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer --- sound/soc/apple/mca.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 7ca653987b78..24381c42eb54 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -1129,8 +1129,8 @@ static int apple_mca_probe(struct platform_device *pdev) } } - ret = devm_snd_soc_register_component(&pdev->dev, &mca_component, - dai_drivers, nclusters * 2); + ret = snd_soc_register_component(&pdev->dev, &mca_component, + dai_drivers, nclusters * 2); if (ret) { dev_err(&pdev->dev, "unable to register ASoC component: %d\n", ret); @@ -1148,6 +1148,7 @@ static int apple_mca_remove(struct platform_device *pdev) { struct mca_data *mca = platform_get_drvdata(pdev); + snd_soc_unregister_component(&pdev->dev); apple_mca_release(mca); return 0; }