Audio codec device tree entries

Grant Likely grant.likely at secretlab.ca
Thu Oct 25 01:28:42 EST 2007


On 10/24/07, Timur Tabi <timur at freescale.com> wrote:
> Jon Smirl wrote:
>
> > What I meant was that there is no attempt to describe how the codec is
> > connected to the external world. Those connections are described in
> > the fabric driver.
>
> Hmmm, I'm not sure I'm okay with that.  We can always add properties to those
> nodes if it's necessary.  However, now you're basically defining some parts of
> the board layout in the DTS, and some parts in the fabric driver.  On PowerPC
> platforms, the fabric driver is supposed to get board layout information from
> the device tree.

No, not always; if the description is too complex (like gpio's for
instance) then it is perfectly valid to build the knowledge into the
platform code.  It should be avoided; but the device tree doesn't need
to describe *everything*.

>
> > i2s at 2200 {           // PSC2
> >      compatible = "fsl,mpc5200b-psc-i2s","fsl,mpc5200-psc-i2s";
> >      cell-index = <1>;
> >      reg = <2200 100>;
> >      interrupts = <2 2 0>;
> >      interrupt-parent = <&mpc5200_pic>;
> >      codec2: i2s-codec at 2 {
>
> This should probably be codec0, since it's the first code on this I2S bus.
>
> >            compatible = "wolson,wm8750";
> >            reg = <2>;
> >            i2c-handle = <&i2c at 3d00>;
> >      };
> > };
> >
> > i2c at 3d00 {
> >      compatible = "fsl,mpc5200b-i2c", "fsl,mpc5200-i2c", "fsl-i2c";
> >      #address-cells = <1>;
> >      #size-cells = <0>;
> >      cell-index = <0>;
> >      reg = <3d00 40>;
> >      interrupts = <2 f 0>;
> >      interrupt-parent = <&mpc5200_pic>;
> >      fsl5200-clocking;
> > }
>
> My vote is for this version.  In fact, I think it *has* to be this way.  If
> you're using a CS4270 codec (as I am), the I2C interface is *optional*.  So I
> want the I2S node to point to the I2C node if it exists.

It doesn't have to be this way.  If the codec does not have a control
interface, then it can happily be a child of the i2s node.  But if it
*does*; don't break convention by separating it from it's control
interface.

I strongly recommend following the lead of ethernet phys and mdio busses here.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195



More information about the Linuxppc-dev mailing list