summaryrefslogtreecommitdiff
path: root/sound/soc/meson/aiu-fifo-i2s.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-12-22 18:07:27 +0100
committerTakashi Iwai <tiwai@suse.de>2021-12-22 18:07:27 +0100
commit065807d758e20cd8e84aa043ffc094651b387978 (patch)
tree22cf35d5278e512be027cb1d752287d99590050e /sound/soc/meson/aiu-fifo-i2s.c
parentf7ac570d0f026cf5475d4cc4d8040bd947980b3a (diff)
parentee907afb0c39a41ee74b862882cfe12820c74b98 (diff)
Merge tag 'asoc-fix-v5.16-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.16 This is a relatively large set of driver specific changes so it may make sense to hold off to v5.17, though picking some over might be good. It's a combination of new device IDs and fixes for various driver specific things which are all small and of the usual "really bad if you're running into them" level, especially the Tegra ones.
Diffstat (limited to 'sound/soc/meson/aiu-fifo-i2s.c')
-rw-r--r--sound/soc/meson/aiu-fifo-i2s.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/meson/aiu-fifo-i2s.c b/sound/soc/meson/aiu-fifo-i2s.c
index 2388a2d0b3a6..57e6e7160d2f 100644
--- a/sound/soc/meson/aiu-fifo-i2s.c
+++ b/sound/soc/meson/aiu-fifo-i2s.c
@@ -20,6 +20,8 @@
#define AIU_MEM_I2S_CONTROL_MODE_16BIT BIT(6)
#define AIU_MEM_I2S_BUF_CNTL_INIT BIT(0)
#define AIU_RST_SOFT_I2S_FAST BIT(0)
+#define AIU_I2S_MISC_HOLD_EN BIT(2)
+#define AIU_I2S_MISC_FORCE_LEFT_RIGHT BIT(4)
#define AIU_FIFO_I2S_BLOCK 256
@@ -90,6 +92,10 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream,
unsigned int val;
int ret;
+ snd_soc_component_update_bits(component, AIU_I2S_MISC,
+ AIU_I2S_MISC_HOLD_EN,
+ AIU_I2S_MISC_HOLD_EN);
+
ret = aiu_fifo_hw_params(substream, params, dai);
if (ret)
return ret;
@@ -117,6 +123,19 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream,
snd_soc_component_update_bits(component, AIU_MEM_I2S_MASKS,
AIU_MEM_I2S_MASKS_IRQ_BLOCK, val);
+ /*
+ * Most (all?) supported SoCs have this bit set by default. The vendor
+ * driver however sets it manually (depending on the version either
+ * while un-setting AIU_I2S_MISC_HOLD_EN or right before that). Follow
+ * the same approach for consistency with the vendor driver.
+ */
+ snd_soc_component_update_bits(component, AIU_I2S_MISC,
+ AIU_I2S_MISC_FORCE_LEFT_RIGHT,
+ AIU_I2S_MISC_FORCE_LEFT_RIGHT);
+
+ snd_soc_component_update_bits(component, AIU_I2S_MISC,
+ AIU_I2S_MISC_HOLD_EN, 0);
+
return 0;
}