From patchwork Mon Apr 11 22:22:03 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: 12809728 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 3F321C433F5 for ; Mon, 11 Apr 2022 22:23:45 +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=msB86jaYAKcxc33FNR/o9ZtEbEsAc6vJ98tG1Ygc/Q8=; b=pbPNyT6EqPxNbm isLg1Ju75nnquybLZ2hgR+YurwnuqbJZuNqsF3qG8mGxCQpCpWaKBpn99q1bTmBNbQsaV80Y6Ul3R HyssIy6WnY7YPtr3qj5SbWoMjnqJSfKY4DxHlIcOUFinlAl3SBuwS0rBIa5gCZzJ0SrQP8543S5SN jqR1njI1KE0e0uMuuRg082u+13bXKVLlg5RL1yZRN+ISdMs1jRQezJVMg+HkzUbBDplel/H50I+qI MCTMMDnXvq9BI4siDtTZ82+/nGozhbpVlHZiaGZpDfPmdOEXjwiwI4XZJ077q2ewSZwU2qICURxXM radXqMObJw1C/2ZJNh/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne2Qc-00Afje-4l; Mon, 11 Apr 2022 22:22:34 +0000 Received: from [2a03:3b40:fe:f0::1] (helo=hutie.ust.cz) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne2QW-00Afd3-S9 for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2022 22:22:32 +0000 From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1649715729; bh=EJZTC/ClSFKyr/qub0lf6Q+PSSWH+Yce7kdkcf2d4vY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DCTjTMULcjbFUSOvZ8DpPqsy4YspOWq5V0XcpueglHW4vK03njzDfMUHLbVb902HB VDcU5HQub2U9RQbFqUzjPzHwEn61ljMeRbGMDnsW9u0yRxW2cS0OUom50mYhdgAa9C AlK8biOu4kczo/F+wldczavCD0cFaNn7i3tv1tx0= To: Hector Martin , Sven Peter , Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Kettenis , =?utf-8?q?Martin_Povi=C5=A1er?= Subject: [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC Date: Tue, 12 Apr 2022 00:22:03 +0200 Message-Id: <20220411222204.96860-2-povik+lin@cutebit.org> In-Reply-To: <20220411222204.96860-1-povik+lin@cutebit.org> References: <20220411222204.96860-1-povik+lin@cutebit.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_152229_093542_EA55A274 X-CRM114-Status: GOOD ( 12.91 ) 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 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 --- After the v1 discussion, I dropped the apple,internal-irq-destination property and instead the index of the usable interrupt is now signified by prepending -1 entries to the interrupts= list. This works when I do it like this: interrupt-parent = <&aic>; interrupts = , ; I would find it neat to do it like this: interrupts-extended = <0xffffffff>, <&aic AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>; but unfortunately the kernel doesn't pick up on it: [ 0.767964] apple-admac 238200000.dma-controller: error -6: IRQ index 0 not found [ 0.773943] apple-admac 238200000.dma-controller: error -6: IRQ index 1 not found [ 0.780154] apple-admac 238200000.dma-controller: error -6: IRQ index 2 not found [ 0.786367] apple-admac 238200000.dma-controller: error -6: IRQ index 3 not found [ 0.788592] apple-admac 238200000.dma-controller: error -6: no usable interrupt .../devicetree/bindings/dma/apple,admac.yaml | 68 +++++++++++++++++++ 1 file changed, 68 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..bbd5eaf5f709 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/apple,admac.yaml @@ -0,0 +1,68 @@ +# 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 + +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 single cell with channel number. + + dma-channels: + maximum: 24 + + interrupts: + minItems: 1 + maxItems: 4 + +required: + - compatible + - reg + - '#dma-cells' + - dma-channels + - interrupts + +additionalProperties: false + +examples: + - | + #include + #include + + admac: dma-controller@238200000 { + compatible = "apple,t8103-admac", "apple,admac"; + reg = <0x38200000 0x34000>; + dma-channels = <24>; + interrupt-parent = <&aic>; + interrupts = , + ; + #dma-cells = <1>; + };