[alsa-devel] ASoC: new ac97 bus and codec clock

Robert Jarzmik robert.jarzmik at free.fr
Wed Jun 20 21:36:59 CEST 2018


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

> Does AC97 specify a common programming model? That's were a common
> compatible is used (though experience has proven things like
> "generic-ehci" are don't work).
If regmap is enough "common programming model" then yes. If you think of a
common layout of AC97 registers and a common dynamics to program them across all
ac97 controllers, then no, as far as I'm aware it does not.

>> If the purpose for this compatible string is to filter the child nodes which are
>> only ac97 codecs, so that the ac97 framework can act upon them (ie. acquire the
>> clock for example), then wm9713 is too specific ... That won't work for another
>> device with an Analog Devices AD1835 for example.

> Are there ID registers? If so, then just construct a compatible string
> from them and just find the compatible child node. See USB bindings
> for an example using VID/PID.
There is an AC97 ID register, yes, a key as VID/PID is a key for USB.

So my example, where the id is 0x574d4c13, would become :

ac97: sound at 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";

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

Once we have converged on this example, I will post the patches for the binding,
and the adaptation of the ac97 bus of course. Gives me a better chance to shoot
in the right direction first :)

Cheers.

-- 
Robert


More information about the Alsa-devel mailing list