xref: /freebsd/sys/contrib/device-tree/Bindings/sound/axentia,tse850-pcm5142.txt (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1c66ec88fSEmmanuel VadotDevicetree bindings for the Axentia TSE-850 audio complex
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotRequired properties:
4c66ec88fSEmmanuel Vadot  - compatible: "axentia,tse850-pcm5142"
5c66ec88fSEmmanuel Vadot  - axentia,cpu-dai: The phandle of the cpu dai.
6c66ec88fSEmmanuel Vadot  - axentia,audio-codec: The phandle of the PCM5142 codec.
7c66ec88fSEmmanuel Vadot  - axentia,add-gpios: gpio specifier that controls the mixer.
8c66ec88fSEmmanuel Vadot  - axentia,loop1-gpios: gpio specifier that controls loop relays on channel 1.
9c66ec88fSEmmanuel Vadot  - axentia,loop2-gpios: gpio specifier that controls loop relays on channel 2.
10c66ec88fSEmmanuel Vadot  - axentia,ana-supply: Regulator that supplies the output amplifier. Must
11c66ec88fSEmmanuel Vadot    support voltages in the 2V - 20V range, in 1V steps.
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel VadotThe schematics explaining the gpios are as follows:
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadot               loop1 relays
16c66ec88fSEmmanuel Vadot   IN1 +---o  +------------+  o---+ OUT1
17c66ec88fSEmmanuel Vadot            \                /
18c66ec88fSEmmanuel Vadot             +              +
19c66ec88fSEmmanuel Vadot             |   /          |
20c66ec88fSEmmanuel Vadot             +--o  +--.     |
21c66ec88fSEmmanuel Vadot             |  add   |     |
22c66ec88fSEmmanuel Vadot             |        V     |
23c66ec88fSEmmanuel Vadot             |      .---.   |
24c66ec88fSEmmanuel Vadot   DAC +----------->|Sum|---+
25c66ec88fSEmmanuel Vadot             |      '---'   |
26c66ec88fSEmmanuel Vadot             |              |
27c66ec88fSEmmanuel Vadot             +              +
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot   IN2 +---o--+------------+--o---+ OUT2
30c66ec88fSEmmanuel Vadot               loop2 relays
31c66ec88fSEmmanuel Vadot
32*aa1a8ff2SEmmanuel VadotThe 'loop1' gpio pin controls two relays, which are either in loop position,
33c66ec88fSEmmanuel Vadotmeaning that input and output are directly connected, or they are in mixer
34c66ec88fSEmmanuel Vadotposition, meaning that the signal is passed through the 'Sum' mixer. Similarly
35c66ec88fSEmmanuel Vadotfor 'loop2'.
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel VadotIn the above, the 'loop1' relays are inactive, thus feeding IN1 to the mixer
38c66ec88fSEmmanuel Vadot(if 'add' is active) and feeding the mixer output to OUT1. The 'loop2' relays
39c66ec88fSEmmanuel Vadotare active, short-cutting the TSE-850 from channel 2. IN1, IN2, OUT1 and OUT2
40c66ec88fSEmmanuel Vadotare TSE-850 connectors and DAC is the PCB name of the (filtered) output from
41c66ec88fSEmmanuel Vadotthe PCM5142 codec.
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel VadotExample:
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel Vadot	&ssc0 {
46c66ec88fSEmmanuel Vadot		#sound-dai-cells = <0>;
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot	};
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot	&i2c {
51c66ec88fSEmmanuel Vadot		codec: pcm5142@4c {
52c66ec88fSEmmanuel Vadot			compatible = "ti,pcm5142";
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot			reg = <0x4c>;
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadot			AVDD-supply = <&reg_3v3>;
57c66ec88fSEmmanuel Vadot			DVDD-supply = <&reg_3v3>;
58c66ec88fSEmmanuel Vadot			CPVDD-supply = <&reg_3v3>;
59c66ec88fSEmmanuel Vadot
60c66ec88fSEmmanuel Vadot			clocks = <&sck>;
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot			pll-in = <3>;
63c66ec88fSEmmanuel Vadot			pll-out = <6>;
64c66ec88fSEmmanuel Vadot		};
65c66ec88fSEmmanuel Vadot	};
66c66ec88fSEmmanuel Vadot
67c66ec88fSEmmanuel Vadot	ana: ana-reg {
68c66ec88fSEmmanuel Vadot		compatible = "pwm-regulator";
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot		regulator-name = "ANA";
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot		pwms = <&pwm0 2 1000 PWM_POLARITY_INVERTED>;
73c66ec88fSEmmanuel Vadot		pwm-dutycycle-unit = <1000>;
74c66ec88fSEmmanuel Vadot		pwm-dutycycle-range = <100 1000>;
75c66ec88fSEmmanuel Vadot
76c66ec88fSEmmanuel Vadot		regulator-min-microvolt = <2000000>;
77c66ec88fSEmmanuel Vadot		regulator-max-microvolt = <20000000>;
78c66ec88fSEmmanuel Vadot		regulator-ramp-delay = <1000>;
79c66ec88fSEmmanuel Vadot	};
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadot	sound {
82c66ec88fSEmmanuel Vadot		compatible = "axentia,tse850-pcm5142";
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot		axentia,cpu-dai = <&ssc0>;
85c66ec88fSEmmanuel Vadot		axentia,audio-codec = <&codec>;
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot		axentia,add-gpios = <&pioA 8 GPIO_ACTIVE_LOW>;
88c66ec88fSEmmanuel Vadot		axentia,loop1-gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
89c66ec88fSEmmanuel Vadot		axentia,loop2-gpios = <&pioA 11 GPIO_ACTIVE_LOW>;
90c66ec88fSEmmanuel Vadot
91c66ec88fSEmmanuel Vadot		axentia,ana-supply = <&ana>;
92c66ec88fSEmmanuel Vadot	};
93