]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: MediaTek: mt8195-sof: Add support for Tomato RT5682s
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 26 Mar 2024 10:38:45 +0000 (11:38 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 18 Apr 2024 08:46:05 +0000 (10:46 +0200)
A later revision of the MT8195 Cherry Tomato Chromebook (Acer Chromebook
Spin 513 CP513-2H, Revision 3 and 4) are using the RT5682s codec instead
of RT5682i.

The differences are only about a couple of missing switches, where the
'i' variant had a switch for the L/R Headphone output and a configurable
DAC L/R Mux, while the 's' one misses the mux control and solely relies
on the main Headphone Switch.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/406
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/MediaTek/mt8195-sof/mt6359-rt1019-rt5682/HiFi.conf
ucm2/MediaTek/mt8195-sof/mt6359-rt1019-rt5682/init.conf
ucm2/conf.d/sof-m8195_r1019/sof-m8195_r1019_5682s.conf [new symlink]

index 762c8078325f2ba6b00f5306955a2b3f7eae7e6a..3339cdeb3e7e245d6390f0cd06d6fb8a1b59c43b 100644 (file)
@@ -33,13 +33,27 @@ SectionDevice."Headphones" {
 
        EnableSequence [
                cset "name='Headphone Switch' on"
-               cset "name='HPOL Playback Switch' 1"
-               cset "name='HPOR Playback Switch' 1"
        ]
 
+       If.is_rt5682i_hp {
+               Condition {
+                       Type ControlExists
+                       Control "name='HPOL Playback Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='HPOL Playback Switch' 1"
+                               cset "name='HPOR Playback Switch' 1"
+                       ]
+
+                       DisableSequence [
+                               cset "name='HPOL Playback Switch' 0"
+                               cset "name='HPOR Playback Switch' 0"
+                       ]
+               }
+       }
+
        DisableSequence [
-               cset "name='HPOL Playback Switch' 0"
-               cset "name='HPOR Playback Switch' 0"
                cset "name='Headphone Switch' off"
        ]
 
index 44605c3f26bf6252945380775646f415035de401..173ef3fa85b2d79c45c7e0c6a0e7bd0ef6774f18 100644 (file)
@@ -1,9 +1,20 @@
-# rt1019-rt5682 specific boot sequence
+# rt1019-rt5682i/s specific boot sequence
+
+If.is_rt5682i {
+       # We can safely assume that both L/R exist if L does.
+       Condition {
+               Type ControlExists
+               Control "name='DAC L Mux"
+       }
+       True.BootSequence [
+               cset "name='DAC L Mux' IF1"
+               cset "name='DAC R Mux' IF1"
+       ]
+}
+
 BootSequence [
        cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1"
        cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1"
-       cset "name='DAC L Mux' IF1"
-       cset "name='DAC R Mux' IF1"
        cset "name='IF1 01 ADC Swap Mux' 2"
        cset "name='CBJ Boost Volume' 3"
        cset "name='Stereo1 ADC L Mux' 'ADC1 L'"
diff --git a/ucm2/conf.d/sof-m8195_r1019/sof-m8195_r1019_5682s.conf b/ucm2/conf.d/sof-m8195_r1019/sof-m8195_r1019_5682s.conf
new file mode 120000 (symlink)
index 0000000..bc06786
--- /dev/null
@@ -0,0 +1 @@
+../../MediaTek/mt8195-sof/mt6359-rt1019-rt5682/sof-mt8195-mt6359-rt1019-rt5682.conf
\ No newline at end of file