ASoC: rt5663: Add the function of impedance sensing
Subsystems (4)
Oder Chiou
maintainerPATCH v2 1/1 ASoC: rt5663: Add the function of impedance sensing
Support the function of impedance sensing. It could be set the matrix row number of the impedance sensing table and the related parameters in the DTS.
--- Documentation/devicetree/bindings/sound/rt5663.txt | 6 + include/sound/rt5663.h | 3 + sound/soc/codecs/rt5663.c | 218 ++++++++++++++++++++- 3 files changed, 223 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/rt5663.txt +6 -0
@@ -19,6 +19,12 @@ Optional properties: Based on the different PCB layout, add the manual offset value to compensate the DC offset for each L and R channel, and they are different between headphone and headset. +- "realtek,impedance_sensing_num" + The matrix row number of the impedance sensing table. +- "realtek,impedance_sensing_table" + The matrix rows of the impedance sensing table are consisted by impedance + minimum, impedance maximun, volume, DC offset w/o and w/ mic of each L and + R channel accordingly. Pins on the device (for linking into audio routes) for RT5663:
include/sound/rt5663.h +3 -0
@@ -16,6 +16,9 @@ struct rt5663_platform_data {unsigned int dc_offset_r_manual;unsigned int dc_offset_l_manual_mic;unsigned int dc_offset_r_manual_mic; + +unsigned int impedance_sensing_num; + unsigned int *impedance_sensing_table; };#endif
sound/soc/codecs/rt5663.c +214 -4
284 lines not on this page · raw message
Signature · 1 line
2.7.4
Mark Brown
maintainerQuoted 2 lines · Oder Chiou
+- "realtek,impedance_sensing_num" + The matrix row number of the impedance sensing table.
Which table - one in the datasheet?
Documentation/devicetree/bindings/sound/rt5663.txt Optional properties: · line 27
Quoted 4 lines
+- "realtek,impedance_sensing_table"
Documentation/devicetree/bindings/sound/rt5663.txt +3
-0+ The matrix rows of the impedance sensing table are consisted by impedance + minimum, impedance maximun, volume, DC offset w/o and w/ mic of each L and + R channel accordingly.
I can't understand what this property is supposed to look like based on this, sorry. What does the property actually look like, what are the values in it and what units are they specified in?
A message that is not in the archive (sent off-list or not yet received): 7EB0DE829A537248AF2ED30C97D12694023C1915@RTITMBSV02.realtek.com.tw
Mark Brown
maintainerQuoted 1 line · Oder Chiou
Sorry for my poor explanation.
That's OK.
Quoted 11 lines
The impedance table should like the following setting in the DTS.
< 0 300 7 0xffd160 0xffd1c0 0xff8a10 0xff8ab0 301 65535 4 0xffe470 0xffe470 0xffb8e0 0xffb8e0>The first and second column are defined for the impedance range. If the detected impedance value is in the range, then the volume value of the third column will be set to codec. In our codec design, each volume value should compensate different DC offset to avoid the pop sound, and it is also different between headphone and headset. In the example, the "realtek,impedance_sensing_num" is 2. It means that there are 2 ranges of impedance in the impedance sensing function, and it also can be defined the device whether can support this function or not.
This stuff looks fairly good, can you put it in the binding document please?