diff mbox series

[2/4] ASoC: meson: axg-fifo: add fifo depth to the bindings documentation

Message ID 20191218172420.1199117-3-jbrunet@baylibre.com (mailing list archive)
State Accepted
Commit fb522dbb4531c14193115a09905c6c31b37dbfc5
Headers show
Series ASoC: meson: axg-fifo: fix depth handling | expand

Commit Message

Jerome Brunet Dec. 18, 2019, 5:24 p.m. UTC
Add a new property with the depth of the fifo in bytes. This is useful
since some instance of the fifo, even on the same SoC, may have different
depth. The depth is useful is set some parameters of the fifo.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Mark Brown Dec. 18, 2019, 5:50 p.m. UTC | #1
On Wed, Dec 18, 2019 at 06:24:18PM +0100, Jerome Brunet wrote:

> Add a new property with the depth of the fifo in bytes. This is useful
> since some instance of the fifo, even on the same SoC, may have different
> depth. The depth is useful is set some parameters of the fifo.

Can't we figure this out from the compatible strings?  They look SoC
specific (which is good).  That means we don't need to add new
properties for each quirk that separates the variants.
Jerome Brunet Dec. 18, 2019, 6:13 p.m. UTC | #2
On Wed 18 Dec 2019 at 18:50, Mark Brown <broonie@kernel.org> wrote:

> On Wed, Dec 18, 2019 at 06:24:18PM +0100, Jerome Brunet wrote:
>
>> Add a new property with the depth of the fifo in bytes. This is useful
>> since some instance of the fifo, even on the same SoC, may have different
>> depth. The depth is useful is set some parameters of the fifo.
>
> Can't we figure this out from the compatible strings?  They look SoC
> specific (which is good).  That means we don't need to add new
> properties for each quirk that separates the variants.

I don't think it would be appropriate in this case:

If I take the example of TODDR fifos on the SM1 SoC;
All the TODDR fifo on this SoC are compatible with the same driver and use:

compatible = "amlogic,sm1-toddr", "amlogic,axg-toddr";

However instance A on this SoC has a 8192B fifo while instance B, C and D
have 256B fifo. Same goes for the other SoC and also FRDDR fifos.

To store this difference using compatible I would have to add 1 compatible
string for each "A" instance of each FRDDR and TODDR of each SoC. At the
moment this would be 6 more compatible string for something that is really a
parameter ... This also shows that fifo depth is something the HW
manufacturer can tweak easily for each instances.

It would not scale which is why I went for a property.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
index 3080979350a0..fa4545ed81ca 100644
--- a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
+++ b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
@@ -17,6 +17,9 @@  Required properties:
   * "arb" : memory ARB line (required)
   * "rst" : dedicated device reset line (optional)
 - #sound-dai-cells: must be 0.
+- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
+  		      is useful for determining certain configuration such
+		      as the flush threshold of the fifo
 
 Example of FRDDR A on the A113 SoC:
 
@@ -27,4 +30,5 @@  frddr_a: audio-controller@1c0 {
 	interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
 	clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
 	resets = <&arb AXG_ARB_FRDDR_A>;
+	fifo-depth = <512>;
 };