18c2ecf20Sopenharmony_ciRT5663 audio CODEC
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis device supports I2C only.
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciRequired properties:
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci- compatible : "realtek,rt5663".
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci- reg : The I2C address of the device.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci- interrupts : The CODEC's interrupt output.
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci- avdd-supply: Power supply for AVDD, providing 1.8V.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci- cpvdd-supply: Power supply for CPVDD, providing 3.5V.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciOptional properties:
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci- "realtek,dc_offset_l_manual"
208c2ecf20Sopenharmony_ci- "realtek,dc_offset_r_manual"
218c2ecf20Sopenharmony_ci- "realtek,dc_offset_l_manual_mic"
228c2ecf20Sopenharmony_ci- "realtek,dc_offset_r_manual_mic"
238c2ecf20Sopenharmony_ci  Based on the different PCB layout, add the manual offset value to
248c2ecf20Sopenharmony_ci  compensate the DC offset for each L and R channel, and they are different
258c2ecf20Sopenharmony_ci  between headphone and headset.
268c2ecf20Sopenharmony_ci- "realtek,impedance_sensing_num"
278c2ecf20Sopenharmony_ci  The matrix row number of the impedance sensing table.
288c2ecf20Sopenharmony_ci  If the value is 0, it means the impedance sensing is not supported.
298c2ecf20Sopenharmony_ci- "realtek,impedance_sensing_table"
308c2ecf20Sopenharmony_ci  The matrix rows of the impedance sensing table are consisted by impedance
318c2ecf20Sopenharmony_ci  minimum, impedance maximun, volume, DC offset w/o and w/ mic of each L and
328c2ecf20Sopenharmony_ci  R channel accordingly. Example is shown as following.
338c2ecf20Sopenharmony_ci  <   0    300  7  0xffd160  0xffd1c0  0xff8a10  0xff8ab0
348c2ecf20Sopenharmony_ci    301  65535  4  0xffe470  0xffe470  0xffb8e0  0xffb8e0>
358c2ecf20Sopenharmony_ci  The first and second column are defined for the impedance range. If the
368c2ecf20Sopenharmony_ci  detected impedance value is in the range, then the volume value of the
378c2ecf20Sopenharmony_ci  third column will be set to codec. In our codec design, each volume value
388c2ecf20Sopenharmony_ci  should compensate different DC offset to avoid the pop sound, and it is
398c2ecf20Sopenharmony_ci  also different between headphone and headset. In the example, the
408c2ecf20Sopenharmony_ci  "realtek,impedance_sensing_num" is 2. It means that there are 2 ranges of
418c2ecf20Sopenharmony_ci  impedance in the impedance sensing function.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciPins on the device (for linking into audio routes) for RT5663:
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci  * IN1P
468c2ecf20Sopenharmony_ci  * IN1N
478c2ecf20Sopenharmony_ci  * IN2P
488c2ecf20Sopenharmony_ci  * IN2N
498c2ecf20Sopenharmony_ci  * HPOL
508c2ecf20Sopenharmony_ci  * HPOR
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciExample:
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_cirt5663: codec@12 {
558c2ecf20Sopenharmony_ci	compatible = "realtek,rt5663";
568c2ecf20Sopenharmony_ci	reg = <0x12>;
578c2ecf20Sopenharmony_ci	interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
588c2ecf20Sopenharmony_ci	avdd-supply = <&pp1800_a_alc5662>;
598c2ecf20Sopenharmony_ci	cpvdd-supply = <&pp3500_a_alc5662>;
608c2ecf20Sopenharmony_ci};
61