ASoC: wm8741: Add differential mono mode support
Subsystems (4)
PATCH v3 1/1 ASoC: wm8741: Add differential mono mode support
The WM8741 DAC supports several differential output modes (stereo, stereo reversed, mono left, mono right). Add platform data and DT bindings to configure it.
---
Mark, Charles,
thanks for your comments.
This patch has been tested on a board with two codecs in mono mode (left and right channel).
Changes since v2:
- Add controls for mono codecs with a channel neutral name.
Note: Machine drivers can attach prefixes like left, right or center to this controls using the name_prefix field in struct snd_soc_codec_conf (Suggested by Charles Keepax).
Changes since v1:
- Remove controls for mono codecs.
Note: The machine driver is responsible for controls if the codec is configured in mono mode.
Many thanks in advance for your time and effort,
Sergej
Documentation/devicetree/bindings/sound/wm8741.txt | 11 ++ sound/soc/codecs/wm8741.c | 129 ++++++++++++++++++--- sound/soc/codecs/wm8741.h | 10 ++ 3 files changed, 137 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/sound/wm8741.txt +11 -0
@@ -10,9 +10,20 @@ Required properties: - reg : the I2C address of the device for I2C, the chip select number for SPI. +Optional properties: + + - diff-mode: Differential output mode configuration. Default value for field + DIFF in register R8 (MODE_CONTROL_2). If absent, the default is 0, shall be: + 0 = stereo + 1 = mono left + 2 = stereo reversed + 3 = mono right + Example: codec: wm8741@1a { compatible = "wlf,wm8741"; reg = <0x1a>; + + diff-mode = <3>; };
sound/soc/codecs/wm8741.c +116 -13
189 lines not on this page · raw message
sound/soc/codecs/wm8741.h +10 -0
@@ -194,6 +194,12 @@#define WM8741_DITHER_SHIFT 0/* DITHER - [1:0] */ #define WM8741_DITHER_WIDTH 2/* DITHER - [1:0] */ +/* DIFF field values */ +#define WM8741_DIFF_MODE_STEREO 0/* stereo normal */ +#define WM8741_DIFF_MODE_STEREO_REVERSED 2/* stereo reversed */ +#define WM8741_DIFF_MODE_MONO_LEFT 1/* mono left */ +#define WM8741_DIFF_MODE_MONO_RIGHT 3/* mono right */ +/* * R32 (0x20) - ADDITONAL_CONTROL_1 */
@@ -208,4 +214,8 @@#define WM8741_SYSCLK 0 +struct wm8741_platform_data { +u32 diff_mode;/* Differential Output Mode */ +}; +#endif
Signature · 1 line
1.9.1
Quoted 6 lines · Sergej Sawazki
The WM8741 DAC supports several differential output modes (stereo, stereo reversed, mono left, mono right). Add platform data and DT bindings to configure it.
Signed-off-by Sergej Sawazki <[email protected]>---
Thanks,
Charles
Quoted 3 lines · Sergej Sawazki
The WM8741 DAC supports several differential output modes (stereo, stereo reversed, mono left, mono right). Add platform data and DT bindings to configure it.
Applied, thanks.