summaryrefslogtreecommitdiff
path: root/target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch
diff options
context:
space:
mode:
authorZoltan Herpai <wigyori@uid0.hu>2015-08-09 12:25:18 +0000
committerZoltan Herpai <wigyori@uid0.hu>2015-08-09 12:25:18 +0000
commit50018a752771efce3ae222457d4d231d1f80a1a5 (patch)
treeced2b9c1e216ce0e3d0bb204e359a7a9d6d2a3ef /target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch
parent0b8643af4fa7eebd55b63d6d547f85da1409f83d (diff)
downloadmtk-20170518-50018a752771efce3ae222457d4d231d1f80a1a5.zip
mtk-20170518-50018a752771efce3ae222457d4d231d1f80a1a5.tar.gz
mtk-20170518-50018a752771efce3ae222457d4d231d1f80a1a5.tar.bz2
sunxi: add support for 4.1
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> SVN-Revision: 46571
Diffstat (limited to 'target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch')
-rw-r--r--target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch b/target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch
new file mode 100644
index 0000000..120220c
--- /dev/null
+++ b/target/linux/sunxi/patches-4.1/166-asoc-sunxi-fix-distortion-on-16bit-mono.patch
@@ -0,0 +1,35 @@
+From f8517e7d836269f5fa1e1049394104417d3a7357 Mon Sep 17 00:00:00 2001
+From: "B.R. Oake" <broake@openmailbox.org>
+Date: Sat, 6 Sep 2014 14:58:50 +0000
+Subject: [PATCH] ASoC: sunxi-codec: Fix distortion on 16-bit mono
+
+Patch to remove distortion on 16-bit mono, based on the linux-sunxi-3.4
+code.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+---
+ sound/soc/sunxi/sunxi-codec.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/sound/soc/sunxi/sunxi-codec.c b/sound/soc/sunxi/sunxi-codec.c
+index 67f978e..77a191b 100644
+--- a/sound/soc/sunxi/sunxi-codec.c
++++ b/sound/soc/sunxi/sunxi-codec.c
+@@ -215,9 +215,6 @@ static int sunxi_codec_prepare(struct snd_pcm_substream *substream,
+ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 0x1 << SUNXI_DAC_FIFOC_FIR_VERSION, 0x1 << SUNXI_DAC_FIFOC_FIR_VERSION);
+ }
+
+- /* set TX FIFO MODE - 0 works for both 16 and 24 bits */
+- regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 0x1 << SUNXI_DAC_FIFOC_TX_FIFO_MODE, 0x0 << SUNXI_DAC_FIFOC_TX_FIFO_MODE);
+-
+ /* send last sample when DAC FIFO under run */
+ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 0x1 << SUNXI_DAC_FIFOC_SEND_LASAT, 0x0 << SUNXI_DAC_FIFOC_SEND_LASAT);
+ } else {
+@@ -329,6 +326,7 @@ static int sunxi_codec_hw_params(struct snd_pcm_substream *substream,
+ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 7 << SUNXI_DAC_FIFOC_DAC_FS, hwrate << SUNXI_DAC_FIFOC_DAC_FS);
+ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 1 << SUNXI_DAC_FIFOC_MONO_EN, is_mono << SUNXI_DAC_FIFOC_MONO_EN);
+ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 1 << SUNXI_DAC_FIFOC_TX_SAMPLE_BITS, is_24bit << SUNXI_DAC_FIFOC_TX_SAMPLE_BITS);
++ regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 1 << SUNXI_DAC_FIFOC_TX_FIFO_MODE, !is_24bit << SUNXI_DAC_FIFOC_TX_FIFO_MODE);
+ if (is_24bit)
+ priv->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+ else