build/patch/kernel/meson64-current/0085-WIP-ASoC-meson-add-2-8-channel-constraints.patch
Igor Pečovnik 99f6bef7de
Attach Meson64 CURRENT to 5.6.y and make DEV = CURRENT at this point. (#1956)
* Attach Meson64 CURRENT to 5.6.y and make DEV = CURRENT at this point.

There is a lot of changes to 5.7.y and can be done after release or by someone that feels a need for this right now.

* Delete meson64_fclk_div3.patch

this fix has been upstream for some time, I had issues with it on 5.4, which is why it had been removed there.

* [ meson64 current ] kconfig tweak

disable Rockchip SoC drivers

* [ meson64 current ] remove rockchip patches

* [ meson64 current ] disable CMA patch GX

* [ meson64 current] add libretech cc audio patch

This brings the dts even with the khilman 5.8/integ branch which includes all of the audio changes.  The kernel is registering audio devices, however nothing comes out.  committed in case someone wants to spend time debugging/testing theories.

* fix permissions

was editing from another machine, accidental change of permissions in the patch

* Set default mixer settings

Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>

* [ meson64 current ] GXL audio commit

This moves to the mainline patches and covers le potato and la frite.  Adjusted asound config to handle a commonized sound card name.

* [ meson64 current ] add gxbb audio WIP

Playback is too fast, a clock setting is off somewhere.

* Update kernel configs

Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>

Co-authored-by: Tony <tonymckahan@gmail.com>
2020-05-22 00:17:08 +02:00

62 lines
1.9 KiB
Diff

From 6f010e1f35e82ba7d05e7738b391b8b7b53eb1cf Mon Sep 17 00:00:00 2001
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Thu, 20 Feb 2020 15:58:14 +0000
Subject: [PATCH 085/101] WIP: ASoC: meson: add 2/8 channel constraints
The audio hardware can output in 2 or 8 channels only, so we need must
ensure we start in only these two configurations.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
sound/soc/meson/aiu-fifo-i2s.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/sound/soc/meson/aiu-fifo-i2s.c b/sound/soc/meson/aiu-fifo-i2s.c
index 9a5271ce80fe..87e0c85eacc8 100644
--- a/sound/soc/meson/aiu-fifo-i2s.c
+++ b/sound/soc/meson/aiu-fifo-i2s.c
@@ -118,15 +118,40 @@ 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);
+ snd_soc_component_write(component, AIU_RST_SOFT,
+ AIU_RST_SOFT_I2S_FAST);
+ snd_soc_component_read(component, AIU_I2S_SYNC, &val);
+
return 0;
}
+static const unsigned int channels_2_8[] = {
+ 2, 8
+};
+
+static const struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
+ .count = ARRAY_SIZE(channels_2_8),
+ .list = channels_2_8,
+ .mask = 0,
+};
+
+static int aiu_fifo_i2s_startup(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ /* Make sure either 2ch or 8ch is selected */
+ snd_pcm_hw_constraint_list(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_CHANNELS,
+ &hw_constraints_2_8_channels);
+
+ return aiu_fifo_startup(substream, dai);
+}
+
const struct snd_soc_dai_ops aiu_fifo_i2s_dai_ops = {
.trigger = aiu_fifo_i2s_trigger,
.prepare = aiu_fifo_i2s_prepare,
.hw_params = aiu_fifo_i2s_hw_params,
.hw_free = aiu_fifo_hw_free,
- .startup = aiu_fifo_startup,
+ .startup = aiu_fifo_i2s_startup,
.shutdown = aiu_fifo_shutdown,
};
--
2.17.1