kernel: bump 5.10 to 5.10.66
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.10 / 950-0312-vc4_hdmi-Set-HD_CTL_WHOLSMP-and-HD_CTL_CHALIGN_SET.patch
1 From 1a0b802bb6bca3b42034245d35b56309749a362c Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Tue, 23 Jun 2020 18:37:01 +0100
4 Subject: [PATCH] vc4_hdmi: Set HD_CTL_WHOLSMP and HD_CTL_CHALIGN_SET
5
6 Symptom is random switching of speakers when using multichannel.
7
8 Repeatedly running speakertest -c8 occasionally starts with
9 channels jumbled. This is fixed with HD_CTL_WHOLSMP.
10
11 The other bit looks beneficial and apears harmless in testing so
12 I'd suggest adding it too.
13
14 Documentation says: HD_CTL_WHILSMP_SET
15 Wait for whole sample. When this bit is set MAI transmit will start
16 only when there is at least one whole sample available in the fifo.
17
18 Documentation says: HD_CTL_CHALIGN_SET
19 Channel Align When Overflow. This bit is used to realign the audio
20 channels in case of an overflow.
21 If this bit is set, after the detection of an overflow, equal
22 amount of dummy words to the missing words will be written to fifo,
23 filling up the broken sample and maintaining alignment.
24
25 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
26 ---
27 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++-
28 1 file changed, 3 insertions(+), 1 deletion(-)
29
30 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
31 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
32 @@ -1074,7 +1074,9 @@ static int vc4_hdmi_audio_trigger(struct
33 HDMI_WRITE(HDMI_MAI_CTL,
34 VC4_SET_FIELD(vc4_hdmi->audio.channels,
35 VC4_HD_MAI_CTL_CHNUM) |
36 - VC4_HD_MAI_CTL_ENABLE);
37 + VC4_HD_MAI_CTL_WHOLSMP |
38 + VC4_HD_MAI_CTL_CHALIGN |
39 + VC4_HD_MAI_CTL_ENABLE);
40 break;
41 case SNDRV_PCM_TRIGGER_STOP:
42 HDMI_WRITE(HDMI_MAI_CTL,