From nobody Fri Apr 3 00:51:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 604FEC6FA86 for ; Sun, 18 Sep 2022 09:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbiIRJ7o (ORCPT ); Sun, 18 Sep 2022 05:59:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiIRJ7X (ORCPT ); Sun, 18 Sep 2022 05:59:23 -0400 Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11303E08; Sun, 18 Sep 2022 02:59:19 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663495156; bh=ksK/iiTdEFt0yUmhNmHJ0UbHdl5qCLakkzptRrVKPZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DwqofZlil1USt0Vhrq8Q81lX+Uo757ecItAyK9vr9wszT/JkD3IbAxV06te8Ngf/l /z8I7qpYhAjyC5J4cF8nE7PK8agNYmuOtSmPvvB/5/TyFrKQAd1AJem7gX1fU3FLTq CvpaQIjiJ4W0IY/pd1preR319acBgM2ntP5OXNsY= To: Hector Martin , Sven Peter , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Philipp Zabel Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH 1/4] dt-bindings: dma: apple,admac: Add reset Date: Sun, 18 Sep 2022 11:58:42 +0200 Message-Id: <20220918095845.68860-2-povik+lin@cutebit.org> In-Reply-To: <20220918095845.68860-1-povik+lin@cutebit.org> References: <20220918095845.68860-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the SoCs there is usually a shared audio reset line, so add a property for that. Signed-off-by: Martin Povi=C5=A1er Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/dma/apple,admac.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/apple,admac.yaml b/Docum= entation/devicetree/bindings/dma/apple,admac.yaml index 3b1e667f7ea0..97282469e4af 100644 --- a/Documentation/devicetree/bindings/dma/apple,admac.yaml +++ b/Documentation/devicetree/bindings/dma/apple,admac.yaml @@ -56,6 +56,9 @@ properties: power-domains: maxItems: 1 =20 + resets: + maxItems: 1 + required: - compatible - reg --=20 2.33.0 From nobody Fri Apr 3 00:51:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1BEFC54EE9 for ; Sun, 18 Sep 2022 10:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbiIRKAO (ORCPT ); Sun, 18 Sep 2022 06:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbiIRJ7X (ORCPT ); Sun, 18 Sep 2022 05:59:23 -0400 Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1906AE66; Sun, 18 Sep 2022 02:59:19 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663495157; bh=qnGOJumwtyGpUE/bizuGjZuhRpU7ggZcgLNtbjRUrfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oBBDa2YCU2I+FScSOWbiZpral4VSrn39yrKx56wL1+HzZz/kNHuKx8AKAhQiBr1hu 4oBaDqSyIMyqvasbVic7HbH/Z6q2/rWfMKN3i3ab196E1+keC/USx09nKgZdfJjuBr haEe6xRQPo/BIgAqiI4RW6jM4OEx6UiIfQEqAcVI= To: Hector Martin , Sven Peter , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Philipp Zabel Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH 2/4] arm64: dts: apple: Add ADMAC resets on t8103/t600x Date: Sun, 18 Sep 2022 11:58:43 +0200 Message-Id: <20220918095845.68860-3-povik+lin@cutebit.org> In-Reply-To: <20220918095845.68860-1-povik+lin@cutebit.org> References: <20220918095845.68860-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's a shared reset for the ADMAC and MCA peripherals. The MCA node already describes it, and being a shared reset it is important we describe it on the ADMAC node too. Signed-off-by: Martin Povi=C5=A1er --- arch/arm64/boot/dts/apple/t600x-die0.dtsi | 1 + arch/arm64/boot/dts/apple/t8103.dtsi | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t600x-die0.dtsi b/arch/arm64/boot/dt= s/apple/t600x-die0.dtsi index 639c90e108a7..0b8958a8db77 100644 --- a/arch/arm64/boot/dts/apple/t600x-die0.dtsi +++ b/arch/arm64/boot/dts/apple/t600x-die0.dtsi @@ -181,6 +181,7 @@ admac: dma-controller@39b400000 { <0>; iommus =3D <&dart_sio_0 2>, <&dart_sio_1 2>; power-domains =3D <&ps_sio_adma>; + resets =3D <&ps_audio_p>; }; =20 mca: mca@39b600000 { diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/app= le/t8103.dtsi index 51bc901482db..358906a9274d 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -249,6 +249,7 @@ admac: dma-controller@238200000 { #dma-cells =3D <1>; iommus =3D <&dart_sio 2>; power-domains =3D <&ps_sio_adma>; + resets =3D <&ps_audio_p>; }; =20 mca: i2s@238400000 { --=20 2.33.0 From nobody Fri Apr 3 00:51:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2966C32771 for ; Sun, 18 Sep 2022 10:00:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbiIRKAC (ORCPT ); Sun, 18 Sep 2022 06:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbiIRJ7X (ORCPT ); Sun, 18 Sep 2022 05:59:23 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 193EFFFD; Sun, 18 Sep 2022 02:59:19 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663495157; bh=gaKj0Ci5FD63deotj130sKbZ5bE1yUtuVtF+Ah5tT40=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IDTxXvLfZNDc4JOl0JP8m6l4wQRFooeggzLjK21+aezGO81b0Fdv+LjxPvbhUncL3 DpJuT/7miSTKMNJvw4594YyjbRWpDVGJLW8BeZq0JP2VTtbGz7BWOaIW4f4HpFpTs8 l28P27O2tz/HQNoFKme3dvax7zeTQWWDkxIpvNm8= To: Hector Martin , Sven Peter , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Philipp Zabel Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH 3/4] dmaengine: apple-admac: Do not use devres for IRQs Date: Sun, 18 Sep 2022 11:58:44 +0200 Message-Id: <20220918095845.68860-4-povik+lin@cutebit.org> In-Reply-To: <20220918095845.68860-1-povik+lin@cutebit.org> References: <20220918095845.68860-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is in advance of adding support for triggering the reset signal to the peripheral, since registering the IRQ handler will have to be sequenced with it. Signed-off-by: Martin Povi=C5=A1er --- drivers/dma/apple-admac.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c index d1f74a3aa999..7d1b76678032 100644 --- a/drivers/dma/apple-admac.c +++ b/drivers/dma/apple-admac.c @@ -96,6 +96,7 @@ struct admac_data { struct device *dev; __iomem void *base; =20 + int irq; int irq_index; int nchannels; struct admac_chan channels[]; @@ -724,12 +725,7 @@ static int admac_probe(struct platform_device *pdev) =20 if (irq < 0) return dev_err_probe(&pdev->dev, irq, "no usable interrupt\n"); - - err =3D devm_request_irq(&pdev->dev, irq, admac_interrupt, - 0, dev_name(&pdev->dev), ad); - if (err) - return dev_err_probe(&pdev->dev, err, - "unable to register interrupt\n"); + ad->irq =3D irq; =20 ad->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ad->base)) @@ -774,17 +770,29 @@ static int admac_probe(struct platform_device *pdev) tasklet_setup(&adchan->tasklet, admac_chan_tasklet); } =20 - err =3D dma_async_device_register(&ad->dma); + err =3D request_irq(irq, admac_interrupt, 0, dev_name(&pdev->dev), ad); if (err) - return dev_err_probe(&pdev->dev, err, "failed to register DMA device\n"); + return dev_err_probe(&pdev->dev, err, + "unable to register interrupt\n"); + + err =3D dma_async_device_register(&ad->dma); + if (err) { + dev_err_probe(&pdev->dev, err, "failed to register DMA device\n"); + goto free_irq; + } =20 err =3D of_dma_controller_register(pdev->dev.of_node, admac_dma_of_xlate,= ad); if (err) { dma_async_device_unregister(&ad->dma); - return dev_err_probe(&pdev->dev, err, "failed to register with OF\n"); + dev_err_probe(&pdev->dev, err, "failed to register with OF\n"); + goto free_irq; } =20 return 0; + +free_irq: + free_irq(ad->irq, ad); + return err; } =20 static int admac_remove(struct platform_device *pdev) @@ -793,6 +801,7 @@ static int admac_remove(struct platform_device *pdev) =20 of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&ad->dma); + free_irq(ad->irq, ad); =20 return 0; } --=20 2.33.0 From nobody Fri Apr 3 00:51:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55B24C54EE9 for ; Sun, 18 Sep 2022 09:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbiIRJ7x (ORCPT ); Sun, 18 Sep 2022 05:59:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbiIRJ7X (ORCPT ); Sun, 18 Sep 2022 05:59:23 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19229F4F; Sun, 18 Sep 2022 02:59:19 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663495158; bh=LrJPTCNgJnKyYQZq+jzf17tmj1SfmkEssly/2yyWLXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VQt1bFhxVZIgI0lk3VKPibjdw92XIuzyJf5Jh1JYuWIUcFaOQY88E6ksD5tsdb/L2 BmCIssV4FXl+DOq6rKXgZOoPSLQlYA7go+QjyqoDyACc6+9/ya1FQ5kc07+kKd88fW EcJCpUC3bu8jkmmPw005ZxDPT0SckNd2qaABSlHc= To: Hector Martin , Sven Peter , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Philipp Zabel Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH 4/4] dmaengine: apple-admac: Trigger shared reset Date: Sun, 18 Sep 2022 11:58:45 +0200 Message-Id: <20220918095845.68860-5-povik+lin@cutebit.org> In-Reply-To: <20220918095845.68860-1-povik+lin@cutebit.org> References: <20220918095845.68860-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a reset domain is attached to the device, obtain a shared reference to it and trigger it. Typically on a chip the ADMAC controller will share a reset domain with the MCA peripheral. Signed-off-by: Martin Povi=C5=A1er --- drivers/dma/apple-admac.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c index 7d1b76678032..317ca76ccafd 100644 --- a/drivers/dma/apple-admac.c +++ b/drivers/dma/apple-admac.c @@ -12,8 +12,9 @@ #include #include #include -#include +#include #include +#include =20 #include "dmaengine.h" =20 @@ -95,6 +96,7 @@ struct admac_data { struct dma_device dma; struct device *dev; __iomem void *base; + struct reset_control *rstc; =20 int irq; int irq_index; @@ -732,6 +734,10 @@ static int admac_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(ad->base), "unable to obtain MMIO resource\n"); =20 + ad->rstc =3D devm_reset_control_get_optional_shared(&pdev->dev, NULL); + if (IS_ERR(ad->rstc)) + return PTR_ERR(ad->rstc); + dma =3D &ad->dma; =20 dma_cap_set(DMA_PRIVATE, dma->cap_mask); @@ -770,10 +776,17 @@ static int admac_probe(struct platform_device *pdev) tasklet_setup(&adchan->tasklet, admac_chan_tasklet); } =20 - err =3D request_irq(irq, admac_interrupt, 0, dev_name(&pdev->dev), ad); + err =3D reset_control_reset(ad->rstc); if (err) return dev_err_probe(&pdev->dev, err, - "unable to register interrupt\n"); + "unable to trigger reset\n"); + + err =3D request_irq(irq, admac_interrupt, 0, dev_name(&pdev->dev), ad); + if (err) { + dev_err_probe(&pdev->dev, err, + "unable to register interrupt\n"); + goto free_reset; + } =20 err =3D dma_async_device_register(&ad->dma); if (err) { @@ -792,6 +805,8 @@ static int admac_probe(struct platform_device *pdev) =20 free_irq: free_irq(ad->irq, ad); +free_reset: + reset_control_rearm(ad->rstc); return err; } =20 @@ -802,6 +817,7 @@ static int admac_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&ad->dma); free_irq(ad->irq, ad); + reset_control_rearm(ad->rstc); =20 return 0; } --=20 2.33.0