ASoC: wm8753: Add control to allow swapping HiFi DAC channels
authorAlexander Shiyan <shc_work@mail.ru>
Tue, 13 Dec 2016 10:56:19 +0000 (13:56 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 15 Dec 2016 11:44:56 +0000 (11:44 +0000)
This patch adds a control to allow swapping HiFi DAC Left/Right channels.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8753.c

index 9bdf5447f6f60fcdace934194f2c81337e4c5195..d05d76e79c70cf4197eecc3daeb3de1264df4d7c 100644 (file)
@@ -280,6 +280,7 @@ static const DECLARE_TLV_DB_SCALE(voice_mix_tlv, -1200, 300, 0);
 static const DECLARE_TLV_DB_SCALE(pga_tlv, -1725, 75, 0);
 
 static const struct snd_kcontrol_new wm8753_snd_controls[] = {
+SOC_SINGLE("Hi-Fi DAC Left/Right channel Swap", WM8753_HIFI, 5, 1, 0),
 SOC_DOUBLE_R_TLV("PCM Volume", WM8753_LDAC, WM8753_RDAC, 0, 255, 0, dac_tlv),
 
 SOC_DOUBLE_R_TLV("ADC Capture Volume", WM8753_LADC, WM8753_RADC, 0, 255, 0,
@@ -1087,7 +1088,7 @@ static int wm8753_i2s_set_dai_fmt(struct snd_soc_codec *codec,
 {
        u16 ioctl, hifi;
 
-       hifi = snd_soc_read(codec, WM8753_HIFI) & 0x011f;
+       hifi = snd_soc_read(codec, WM8753_HIFI) & 0x013f;
        ioctl = snd_soc_read(codec, WM8753_IOCTL) & 0x00ae;
 
        /* set master/slave audio interface */