Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Rob Herring <robh+dt@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Daniel Mack <zonque@gmail.com>
Subject: Re: ASoC: new ac97 bus and codec clock
Date: Wed, 20 Jun 2018 16:52:16 +0200	[thread overview]
Message-ID: <8736xhqzmn.fsf@belgarion.home> (raw)
In-Reply-To: <CAL_JsqLn2t-zFi8xrig_63OD-SBq8d0jZctih38sZ4cAnRoe6g@mail.gmail.com> (Rob Herring's message of "Tue, 19 Jun 2018 11:56:41 -0600")

Rob Herring <robh+dt@kernel.org> writes:

> Like PCI, USB, SDIO, etc., you need to define an AC97 bus binding
> which defines child node structure, compatible formatting (if you can
> base compatibles on something like VID/PID), and addressing (reg and
> unit-address formats). Then once you define child nodes, you can add
> whatever sideband connections you need. The AC97 core should be able
> to populate struct device_node if there are any matching child
> devices.
Ok, I thing I understand.

So the device-tree will look like :
ac97: sound@40500000 {
      	compatible = "marvell,pxa270-ac97";
	reg = < 0x40500000 0x1000 >;
	interrupts = <14>;
	reset-gpios = <&gpio 95 GPIO_ACTIVE_HIGH>;
	#sound-dai-cells = <1>;
	pinctrl-names = "default";
	pinctrl-0 = < &pinctrl_ac97_default >;
	clocks = <&clks CLK_AC97>, <&clks CLK_AC97CONF>;
	clock-names = "AC97CLK", "AC97CONFCLK";

        wm9713@0 {
        	reg = <0>; /* Codex index (between 0 and 3) */
                compatible = "ac97-codec";
                clocks = <&fixed_wm9713_clock>;
                clock-names = "ac97_clk";
        }
};

And the function ac97_codec_add() will :
 - scan the device-tree ac97 controller childs
 - match one if its reg equals (in our case wm9713@0)
 - set codec->dev.of_node to the matched one

> It gets a bit more complicated if you need to do things like
> enable power or de-assert resets to discover the devices. Sounds like
> that might be the next person's problem in this case. :)
Yeah ... Crossing fingers that won't be me :)

Cheers.

-- 
Robert

  reply	other threads:[~2018-06-20 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-17 20:03 ASoC: new ac97 bus and codec clock Robert Jarzmik
2018-06-19 15:02 ` Mark Brown
2018-06-19 17:56   ` Rob Herring
2018-06-20 14:52     ` Robert Jarzmik [this message]
2018-06-20 15:10       ` Rob Herring
2018-06-20 17:04         ` Robert Jarzmik
2018-06-20 17:16           ` Rob Herring
2018-06-20 19:36             ` Robert Jarzmik
2018-06-20 20:00               ` Rob Herring
2018-06-27 11:23             ` Mark Brown

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=8736xhqzmn.fsf@belgarion.home \
    --to=robert.jarzmik@free.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=zonque@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox