diff mbox series

[2/3] arm64: dts: meson-axg: s400: add dmic codec

Message ID 20180831150218.8307-3-jbrunet@baylibre.com (mailing list archive)
State Accepted
Headers show
Series arm64: dts: meson-axg: add pdm support | expand

Commit Message

Jerome Brunet Aug. 31, 2018, 3:02 p.m. UTC
There are 7 digital mics on the MIC daughter board attached
to the s400 board, so add the digital microphone codec to
its DTS

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Fabio Estevam Sept. 1, 2018, 9:24 p.m. UTC | #1
Hi Jerome,

On Fri, Aug 31, 2018 at 12:02 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> There are 7 digital mics on the MIC daughter board attached
> to the s400 board, so add the digital microphone codec to
> its DTS
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> index ff64c429d432..f3e16cbbc61e 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> @@ -86,6 +86,15 @@
>                 sound-name-prefix = "DIT";
>         };
>
> +       dmics: audio-codec@3 {

You pass @3 without a corresponding reg = <3>, which causes dtc
warnings with W=1.
Jerome Brunet Sept. 3, 2018, 9:57 a.m. UTC | #2
On Sat, 2018-09-01 at 18:24 -0300, Fabio Estevam wrote:
> Hi Jerome,
> 
> On Fri, Aug 31, 2018 at 12:02 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> > There are 7 digital mics on the MIC daughter board attached
> > to the s400 board, so add the digital microphone codec to
> > its DTS
> > 
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> > index ff64c429d432..f3e16cbbc61e 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> > +++ b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
> > @@ -86,6 +86,15 @@
> >                 sound-name-prefix = "DIT";
> >         };
> > 
> > +       dmics: audio-codec@3 {
> 
> You pass @3 without a corresponding reg = <3>, which causes dtc
> warnings with W=1.

Hi Fabio,

Thanks for pointing this out.
Martin also raised concerns about this but, unfortunately, we did not get to the
bottom of it:

https://lkml.kernel.org/r/
90780f5a6b974ee9a4f9f9f2580fc83ef6bdd805.camel@baylibre.com

In a nutshell, I numbered nodes (w/o a reg prop) to keep generic names as
suggested in the DT spec.

The idea came after working on sound cards, if you check
Documentation/devicetree/bindings/sound/simple-card.txt, you'll see this kind of
numbering is even in documentation examples.

This is used by arch/arm/boot/dts/armada-370-db.dts. This is just an example I
picked randomly, I'm not trying to single out the marvell folks here (or ASoC
simple card). I'm actually doing exactly the same kind of multi link stuff on
the amlogic cards.

This looks to be a wide spread practice. Running `make dtbs W=1` on ARM and
ARM64 arch, I've seen dozen of 'node has a unit name, but no reg property'
examples, on things like clocks, buttons, leds, pinctrl, etc ...

that being said, section 2.2.1 of the DT specs says:

" If the node has no reg property, the @unit-address must be omitted and the
node-name alone differentiates the node from other nodes at the same level in
the tree "

So apparently, this is used but not ok ?
Maybe we should simply replace the '@' with a '-' everywhere this occurs ?

If possible, I'd like to get the opinion of the DT gurus about this issue.
Cheers

Jerome
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
index ff64c429d432..f3e16cbbc61e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
@@ -86,6 +86,15 @@ 
 		sound-name-prefix = "DIT";
 	};
 
+	dmics: audio-codec@3 {
+		#sound-dai-cells = <0>;
+		compatible = "dmic-codec";
+		num-channels = <7>;
+		wakeup-delay-ms = <50>;
+		status = "okay";
+		sound-name-prefix = "MIC";
+	};
+
 	emmc_pwrseq: emmc-pwrseq {
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;