Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1024437pxb; Fri, 15 Apr 2022 18:43:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEPc3zb8+E/hCKh6nqgTwJZV+v7y5V3lLm/0CXgNbtV+Raj/uJmccT5gOqju7AOib01TNj X-Received: by 2002:a17:902:c792:b0:158:ba0c:cf6d with SMTP id w18-20020a170902c79200b00158ba0ccf6dmr1682627pla.131.1650073421175; Fri, 15 Apr 2022 18:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650073421; cv=none; d=google.com; s=arc-20160816; b=f27A23w1jv+ARroazLvkugQZ2Uy6Jpts+AXp7yna/PXDjjsVUDNkgc9K91/Stijl7d cgCGtFsM59l15GROlycsPUUOK3BhdKlnziUw5WMRgRzB6aucbGtUDCHoRWGjkuTPEQUs 8JJ8n1k6gdqD9QCqQgx4ig4RZXrGUw8MwKPd2TJL+EDmdyI1j9WENdqEmzljcuQjBLfU 9hAACaxadbzT1p4HcanOaHk8c19uLY45EWtDNbdOmxR3KZKeUmTDE/2yVwVruEKMVFAt +qwY6zCSuJShmeQ72RZqn8cSzPS8lN+Sb3rQ/3kNXEkDjW54lYugPm/SRq+D/Co6xt6V PN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=K/5Wq1Coy5UPF41OrOzi6vwncUsz5ByKlFemTpBp7mY=; b=YshgtE+hmPlRvSoRshrI4DHb6n3g+okO+KX1Q/VNzrxHtrSza54owS5vXaOnghgJKd JdMkA8kFkPhF7k9S3Y/Y9Ggo1TeumkvX6zUmVSR6mm4/tJNUAl0uTW787BBv1pliYTGj 2GOu7IM0NmWARJjf/6aCmXXYUpWH1HKSugjI8Fp6JYXtrKqtP0kmzIRgt491JH+FQtkK AuyCaYp/1Y+JYYfhpjzONjRtyXCdBfWD/a+NSNZkkXcRTX6k3kHgkpgiHVyfpQPvdGRT mvFJsK3FPjV0NWvSB2cfJEpiXaD72QO/WjRlSKv6DHtwomuyQOmao1gl94obcaRZZWfV rMdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b="hHDv4/Yn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i12-20020a655b8c000000b0039fa98f15bdsi2998328pgr.342.2022.04.15.18.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b="hHDv4/Yn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cutebit.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2CBA2129254; Fri, 15 Apr 2022 18:08:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245577AbiDNR0M (ORCPT + 99 others); Thu, 14 Apr 2022 13:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244561AbiDNR0L (ORCPT ); Thu, 14 Apr 2022 13:26:11 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A690EBC86D; Thu, 14 Apr 2022 10:23:43 -0700 (PDT) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1649957019; bh=K/5Wq1Coy5UPF41OrOzi6vwncUsz5ByKlFemTpBp7mY=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=hHDv4/Ynbqnqn0H/mQ1PdwX3ZHXaSri9w1/fC7gnILTEIs2KrwouTQnFXGDfmVetG q9E/sLo550tFhbSI98Qpj7/kwq4FuU4xgcqhXAx5RukKiTbL3Z0BS/8opuXBG8uiJU BX5rZcrhJOCWRDZchqFZAqlnh9URYk9oFjaqn0A0= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC From: =?utf-8?Q?Martin_Povi=C5=A1er?= In-Reply-To: Date: Thu, 14 Apr 2022 19:23:38 +0200 Cc: =?utf-8?Q?Martin_Povi=C5=A1er?= , Hector Martin , Sven Peter , Vinod Koul , Krzysztof Kozlowski , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Kettenis Content-Transfer-Encoding: quoted-printable Message-Id: <85DF53F6-74BA-4D8D-8E8E-DFD67B24DA19@cutebit.org> References: <20220411222204.96860-1-povik+lin@cutebit.org> <20220411222204.96860-2-povik+lin@cutebit.org> To: Rob Herring X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 > On 14. 4. 2022, at 17:43, Rob Herring wrote: >=20 > On Tue, Apr 12, 2022 at 12:22:03AM +0200, Martin Povi=C5=A1er wrote: >> Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio >> samples on SoCs from the "Apple Silicon" family. >>=20 >> Signed-off-by: Martin Povi=C5=A1er >> --- >>=20 >> 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=3D list. This works when I = do >> it like this: >>=20 >> interrupt-parent =3D <&aic>; >> interrupts =3D , >> ; >=20 >=20 > BTW, just use '-1'. dtc takes negative values (and other expressions). Ha! <-1> didn=E2=80=99t work for me but <(-1)> does. >=20 >>=20 >> I would find it neat to do it like this: >>=20 >> interrupts-extended =3D <0xffffffff>, >> <&aic AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>; >>=20 >> but unfortunately the kernel doesn't pick up on it: >>=20 >> [ 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 >=20 > We should make this case work. It is less fragile IMO as it doesn't=20 > depend on the provider's translation of cells. Then I may send some patch to that end. >>=20 >> .../devicetree/bindings/dma/apple,admac.yaml | 68 = +++++++++++++++++++ >> 1 file changed, 68 insertions(+) >> create mode 100644 = Documentation/devicetree/bindings/dma/apple,admac.yaml >>=20 >> 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=C5=A1er >> + >> +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 >=20 > I'm now confused why this is variable. Put -1 entries on the end if=20 > that's why it is variable. That=E2=80=99s why. Fixed length it is then. >=20 > This needs some description about there being 1 of 4 outputs being=20 > connected. OK. Description there will be. >> + >> +required: >> + - compatible >> + - reg >> + - '#dma-cells' >> + - dma-channels >> + - interrupts >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include >> + #include >> + >> + admac: dma-controller@238200000 { >> + compatible =3D "apple,t8103-admac", "apple,admac"; >> + reg =3D <0x38200000 0x34000>; >> + dma-channels =3D <24>; >> + interrupt-parent =3D <&aic>; >> + interrupts =3D , >> + ; >> + #dma-cells =3D <1>; >> + }; >> --=20 >> 2.33.0 >>=20 >>=20 Martin