Revisited, audio codec device tree entries.

Jon Smirl jonsmirl at gmail.com
Mon Nov 19 05:10:10 EST 2007


I've been trying to write ALSA SOC code supporting audio codecs and
device trees.

This looks ok for the main device tree entires. Codecs are hung off
from their controlling bus. It may still need a little tweaking.

		ac97 at 2200 {		// PSC2
			compatible = "mpc5200b-psc-ac97","mpc5200-psc-ac97";
			cell-index = <1>;
			reg = <2200 100>;
			interrupts = <2 2 0>;
			interrupt-parent = <&mpc5200_pic>;
			codec at 0 {
				compatible = "idt,stac9766";
				reg = <0>;
			};
		};

		i2c at 3d40 {
			compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
			reg = <3d40 40>;
			interrupts = <2 10 0>;
			interrupt-parent = <&mpc5200_pic>;
			fsl5200-clocking;

			codec at 15 {
				compatible = "ti,tas5504";
				reg = <15>;
				i2s-handle = <i2s at 2400>;
			};
		};
		
		i2s at 2400 {		// PSC4
			compatible = "mpc5200b-psc-i2s","mpc5200-psc-i2s";
			cell-index = <1>;
			reg = <2400 100>;
			interrupts = <2 3 0>;
			interrupt-parent = <&mpc5200_pic>;
		};

In the ALSA SOC model the i2s, codec and ac97 drivers are all generic.
A fabric driver tells specifically how a generic codec is wired into
the board. What I haven't been able figure out is how to load the
right fabric driver.

It is starting to make more sense to me that fabric driver actually
does represent a physical device - the cluster of wires. David Gibson
made a proposal that a fabric node wrap the codec node. That doesn't
work very well with the i2c bus where the bus code is walking down the
nodes and triggering the instantiation of the i2c drivers.

But what about putting the fabric node inside the codec node?

			codec at 15 {
				compatible = "ti,tas5504";
				reg = <15>;
				i2s-handle = <i2s at 2400>;
				codec-fabric {
					compatible = "digispeaker,fabric"
				};
			};

			codec at 0 {
				compatible = "idt,stac9766";
				reg = <0>;
				codec-fabric {
					compatible = "efika,fabric"
				};
			};

This sort of makes sense, the ac97/i2c bus is connected to the codec,
which is then connected to the fabric.

The example used in the ALSA doc of an ac97 chip needing a fabric
driver was a case where the ac97 chip has an external amp. The fabric
driver uses a GPIO to turn the amp on/off with suspend/resume.


-- 
Jon Smirl
jonsmirl at gmail.com



More information about the Linuxppc-dev mailing list