sun8i-a33-codec.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Allwinner SUN8I audio codec
  2. ------------------------------------
  3. On Sun8i-A33 SoCs, the audio is separated in different parts:
  4. - A DAI driver. It uses the "sun4i-i2s" driver which is
  5. documented here:
  6. Documentation/devicetree/bindings/sound/sun4i-i2s.txt
  7. - An analog part of the codec which is handled as PRCM registers.
  8. See Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
  9. - An digital part of the codec which is documented in this current
  10. binding documentation.
  11. - And finally, an audio card which links all the above components.
  12. The simple-audio card will be used.
  13. See Documentation/devicetree/bindings/sound/simple-card.txt
  14. This bindings documentation exposes Sun8i codec (digital part).
  15. Required properties:
  16. - compatible: must be "allwinner,sun8i-a33-codec"
  17. - reg: must contain the registers location and length
  18. - interrupts: must contain the codec interrupt
  19. - clocks: a list of phandle + clock-specifer pairs, one for each entry
  20. in clock-names.
  21. - clock-names: should contain followings:
  22. - "bus": the parent APB clock for this controller
  23. - "mod": the parent module clock
  24. Here is an example to add a sound card and the codec binding on sun8i SoCs that
  25. are similar to A33 using simple-card:
  26. sound {
  27. compatible = "simple-audio-card";
  28. simple-audio-card,name = "sun8i-a33-audio";
  29. simple-audio-card,format = "i2s";
  30. simple-audio-card,frame-master = <&link_codec>;
  31. simple-audio-card,bitclock-master = <&link_codec>;
  32. simple-audio-card,mclk-fs = <512>;
  33. simple-audio-card,aux-devs = <&codec_analog>;
  34. simple-audio-card,routing =
  35. "Left DAC", "Digital Left DAC",
  36. "Right DAC", "Digital Right DAC";
  37. simple-audio-card,cpu {
  38. sound-dai = <&dai>;
  39. };
  40. link_codec: simple-audio-card,codec {
  41. sound-dai = <&codec>;
  42. };
  43. soc@1c00000 {
  44. [...]
  45. audio-codec@1c22e00 {
  46. #sound-dai-cells = <0>;
  47. compatible = "allwinner,sun8i-a33-codec";
  48. reg = <0x01c22e00 0x400>;
  49. interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
  50. clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
  51. clock-names = "bus", "mod";
  52. };
  53. };