2022-04-22 18:50:16

by Martin Povišer

[permalink] [raw]
Subject: [PATCH v3 0/2] Apple ADMAC driver

Hi all,

this is v3 of driver for Audio DMA Controller on recent Apple SoCs.

Changes since v3:
(link: https://lore.kernel.org/dmaengine/[email protected]/ )
- in binding, make 'interrupts' fixed length and add a comment
- do not use devm allocation on descriptors
- use platform_get_irq_optional to not log errors in the course of looking for
an usable interrupt
- make channel no. unsigned

Changes since v1:
(link: https://lore.kernel.org/dmaengine/[email protected]/ )
- in binding, drop 'apple,internal-irq-destination' in favor of
prepending entries to 'interrupts'
- drop admac_peek/poke helpers
- use special versions of dev_err/WARN_ON where desirable, fix %pad
formatter invocation
- bring implementation of terminate_all up to dmaengine spec, add
device_synchronize
- minor fixes (comments, formatting)

Thanks,
Martin

Martin Povišer (2):
dt-bindings: dma: Add Apple ADMAC
dmaengine: apple-admac: Add Apple ADMAC driver

.../devicetree/bindings/dma/apple,admac.yaml | 75 ++
MAINTAINERS | 2 +
drivers/dma/Kconfig | 8 +
drivers/dma/Makefile | 1 +
drivers/dma/apple-admac.c | 818 ++++++++++++++++++
5 files changed, 904 insertions(+)
create mode 100644 Documentation/devicetree/bindings/dma/apple,admac.yaml
create mode 100644 drivers/dma/apple-admac.c

--
2.33.0


2022-04-22 20:10:16

by Martin Povišer

[permalink] [raw]
Subject: [PATCH v3 1/2] dt-bindings: dma: Add Apple ADMAC

Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio
samples on SoCs from the "Apple Silicon" family.

Signed-off-by: Martin Povišer <[email protected]>
---
.../devicetree/bindings/dma/apple,admac.yaml | 75 +++++++++++++++++++
1 file changed, 75 insertions(+)
create mode 100644 Documentation/devicetree/bindings/dma/apple,admac.yaml

diff --git a/Documentation/devicetree/bindings/dma/apple,admac.yaml b/Documentation/devicetree/bindings/dma/apple,admac.yaml
new file mode 100644
index 000000000000..ab8a4ec7779f
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/apple,admac.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/apple,admac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple Audio DMA Controller (ADMAC)
+
+description: |
+ Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio samples
+ on SoCs from the "Apple Silicon" family.
+
+ The controller has been seen with up to 24 channels. Even-numbered channels
+ are TX-only, odd-numbered are RX-only. Individual channels are coupled to
+ fixed device endpoints.
+
+maintainers:
+ - Martin Povišer <[email protected]>
+
+allOf:
+ - $ref: "dma-controller.yaml#"
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,t6000-admac
+ - apple,t8103-admac
+ - const: apple,admac
+
+ reg:
+ maxItems: 1
+
+ '#dma-cells':
+ const: 1
+ description:
+ Clients specify a single cell with channel number.
+
+ dma-channels:
+ maximum: 24
+
+ interrupts:
+ minItems: 4
+ maxItems: 4
+ description:
+ Interrupts that correspond to the 4 IRQ outputs of the controller. Usually
+ only one of the controller outputs will be connected as an usable interrupt
+ source. The remaining interrupts will be left without a valid value, e.g.
+ in an interrupts-extended list the disconnected positions will contain
+ an empty phandle reference <0>.
+
+required:
+ - compatible
+ - reg
+ - '#dma-cells'
+ - dma-channels
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/apple-aic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ admac: dma-controller@238200000 {
+ compatible = "apple,t8103-admac", "apple,admac";
+ reg = <0x38200000 0x34000>;
+ dma-channels = <24>;
+ interrupts-extended = <0>,
+ <&aic AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>;
+ #dma-cells = <1>;
+ };
--
2.33.0

2022-04-26 02:56:43

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] dt-bindings: dma: Add Apple ADMAC

On Wed, 20 Apr 2022 21:07:54 +0200, Martin Povišer wrote:
> Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio
> samples on SoCs from the "Apple Silicon" family.
>
> Signed-off-by: Martin Povišer <[email protected]>
> ---
> .../devicetree/bindings/dma/apple,admac.yaml | 75 +++++++++++++++++++
> 1 file changed, 75 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/dma/apple,admac.yaml
>

Reviewed-by: Rob Herring <[email protected]>