All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Povišer" <povik@cutebit.org>
To: Rob Herring <robh@kernel.org>
Cc: "Martin Povišer" <povik+lin@cutebit.org>,
	"Hector Martin" <marcan@marcan.st>,
	"Sven Peter" <sven@svenpeter.dev>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Mark Kettenis" <kettenis@openbsd.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC
Date: Thu, 14 Apr 2022 19:52:36 +0200	[thread overview]
Message-ID: <A9849767-1A50-4C57-AE40-3DD7FB475130@cutebit.org> (raw)
In-Reply-To: <85DF53F6-74BA-4D8D-8E8E-DFD67B24DA19@cutebit.org>


> On 14. 4. 2022, at 19:23, Martin Povišer <povik@cutebit.org> wrote:
> 
>> 
>> On 14. 4. 2022, at 17:43, Rob Herring <robh@kernel.org> wrote:
>> 
>> On Tue, Apr 12, 2022 at 12:22:03AM +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 <povik+lin@cutebit.org>
>>> ---
>>> 
>>> 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 = <AIC_IRQ 0xffffffff 0>,
>>> <AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>;
>> 
>> 
>> BTW, just use '-1'. dtc takes negative values (and other expressions).
> 
> Ha! <-1> didn’t work for me but <(-1)> does.
> 
>> 
>>> 
>>> 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
>> 
>> We should make this case work. It is less fragile IMO as it doesn't 
>> depend on the provider's translation of cells.
> 
> Then I may send some patch to that end.

Turns out there’s no need. Passing in <0> in place of a phandle reference
looks like what we want:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/of/base.c?h=v5.18-rc2#n1334

(Confirmed by testing to do the right thing with the IRQs.)

Martin

WARNING: multiple messages have this Message-ID (diff)
From: "Martin Povišer" <povik@cutebit.org>
To: Rob Herring <robh@kernel.org>
Cc: "Martin Povišer" <povik+lin@cutebit.org>,
	"Hector Martin" <marcan@marcan.st>,
	"Sven Peter" <sven@svenpeter.dev>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Mark Kettenis" <kettenis@openbsd.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC
Date: Thu, 14 Apr 2022 19:52:36 +0200	[thread overview]
Message-ID: <A9849767-1A50-4C57-AE40-3DD7FB475130@cutebit.org> (raw)
In-Reply-To: <85DF53F6-74BA-4D8D-8E8E-DFD67B24DA19@cutebit.org>


> On 14. 4. 2022, at 19:23, Martin Povišer <povik@cutebit.org> wrote:
> 
>> 
>> On 14. 4. 2022, at 17:43, Rob Herring <robh@kernel.org> wrote:
>> 
>> On Tue, Apr 12, 2022 at 12:22:03AM +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 <povik+lin@cutebit.org>
>>> ---
>>> 
>>> 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 = <AIC_IRQ 0xffffffff 0>,
>>> <AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>;
>> 
>> 
>> BTW, just use '-1'. dtc takes negative values (and other expressions).
> 
> Ha! <-1> didn’t work for me but <(-1)> does.
> 
>> 
>>> 
>>> 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
>> 
>> We should make this case work. It is less fragile IMO as it doesn't 
>> depend on the provider's translation of cells.
> 
> Then I may send some patch to that end.

Turns out there’s no need. Passing in <0> in place of a phandle reference
looks like what we want:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/of/base.c?h=v5.18-rc2#n1334

(Confirmed by testing to do the right thing with the IRQs.)

Martin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-04-14 17:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 22:22 [PATCH v2 0/2] Apple ADMAC driver Martin Povišer
2022-04-11 22:22 ` Martin Povišer
2022-04-11 22:22 ` [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC Martin Povišer
2022-04-11 22:22   ` Martin Povišer
2022-04-14 15:43   ` Rob Herring
2022-04-14 15:43     ` Rob Herring
2022-04-14 17:23     ` Martin Povišer
2022-04-14 17:23       ` Martin Povišer
2022-04-14 17:52       ` Martin Povišer [this message]
2022-04-14 17:52         ` Martin Povišer
2022-04-11 22:22 ` [PATCH v2 2/2] dmaengine: apple-admac: Add Apple ADMAC driver Martin Povišer
2022-04-11 22:22   ` Martin Povišer
2022-04-20 12:40   ` Vinod Koul
2022-04-20 12:40     ` Vinod Koul
2022-04-20 13:41     ` Martin Povišer
2022-04-20 13:41       ` Martin Povišer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A9849767-1A50-4C57-AE40-3DD7FB475130@cutebit.org \
    --to=povik@cutebit.org \
    --cc=alyssa@rosenzweig.io \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=kettenis@openbsd.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=povik+lin@cutebit.org \
    --cc=robh@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.