[alsa-devel] ASoC: Device tree binding to dummy codec

jonsmirl at gmail.com jonsmirl at gmail.com
Mon Jul 28 15:49:27 CEST 2014


On Mon, Jul 28, 2014 at 8:54 AM, jonsmirl at gmail.com <jonsmirl at gmail.com> wrote:
> On Mon, Jul 28, 2014 at 7:20 AM, Mark Brown <broonie at kernel.org> wrote:
>> On Mon, Jul 28, 2014 at 08:24:39AM +0200, Lars-Peter Clausen wrote:
>>> Cc ASoC maintainers.
>>
>> Jon, you should really know to CC maintainers.
>
> Are the all CC'd now? I thought the ALSA list was sufficient.
>
> So how do I set this hardware up?
>
> on-chip codec - it is ADC/DAC with FIFIO directly attached. There is
> no separate bus. on-chip codec supports things like mic1, mic2, line
> in, line out, hp out. Most boards populate only a subset of the jacks.
> Right now the device driver makes a dummy codec and internally creates
> a card and links everything together.
> http://git.elopez.com.ar/linux/src/abc050fbbaa5302b76ac585954cd207961fc9159/sound/soc/sunxi/sunxi-codec.c?at=sunxi-codec
>
> Then someone came along and wanted to add a MAX9768. We're stuck
> because the way the driver is built it doesn't support the external
> MAX9768 codec driver.  MAX9768 is just an amp with I2C control of
> volume.
>
> So how should the device tree look for no external amp? Right now
> there is just a device node and the driver makes a card/dummy-codec
> internally.
>
> How should the device tree look when there is an external amp?  Maybe
> this amp should just be a chip of the device node?

Maybe something like this.....

i2c1: i2c at 01c2b000 {
   pinctrl-names = "default";
   pinctrl-0 = <&i2c1_pins_a>;
   status = "okay";

   max9768: max9768 at 36 {
      compatible = "max,9768";
      reg = <0x36>;
   };
};

codec: codec at 01c22c00 {
   compatible = "allwinner,sun7i-a20-codec";
   reg = <0x01c22c00 0x40>;
   interrupts = <0 30 4>;
   clocks = <&pll2 0>, <&apb0_gates 0>, <&codec_clk>;
   clock-names = "pll", "apb", "codec";
   dmas = <&dma 0 19>, <&dma 0 19>;
   dma-names = "rx", "tx";
   widgets = "Mic1 Jack", "Headphone Jack";
   external-amp = <&max9768>
   status = "okay";
};

If external amp is missing I just bind to my internal dummy-codec.


>
> How should the various jack populations be handled in the device tree?
>
> --
> Jon Smirl
> jonsmirl at gmail.com



-- 
Jon Smirl
jonsmirl at gmail.com


More information about the Alsa-devel mailing list