]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
Turn speaker LED accroding to rt1318 speaker status
authorShuming Fan <shumingf@realtek.com>
Wed, 19 Feb 2025 06:15:17 +0000 (14:15 +0800)
committerJaroslav Kysela <perex@perex.cz>
Sat, 15 Mar 2025 14:46:15 +0000 (15:46 +0100)
Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/512
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/rt1318/init.conf [new file with mode: 0644]
ucm2/sof-soundwire/sof-soundwire.conf

diff --git a/ucm2/codecs/rt1318/init.conf b/ucm2/codecs/rt1318/init.conf
new file mode 100644 (file)
index 0000000..b1d6c28
--- /dev/null
@@ -0,0 +1,26 @@
+# RT1318 specific switch control settings
+
+If.oneAmp {
+       Condition {
+               Type ControlExists
+               Control "name='rt1318-1 DAC Switch'"
+       }
+       True {
+               FixedBootSequence [
+                       exec "-/sbin/modprobe snd_ctl_led"
+                       sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:rt1318-1 DAC Switch"
+               ]
+       }
+}
+
+If.twoAmps {
+       Condition {
+               Type ControlExists
+               Control "name='rt1318-2 DAC Switch'"
+       }
+       True {
+               FixedBootSequence [
+                       sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:rt1318-2 DAC Switch"
+               ]
+       }
+}
index f458815f633eeed890d4018da9853f5d91f2d1e8..1cddfbf4cfbf414cb229cce9880f468c4be264ef 100644 (file)
@@ -102,6 +102,14 @@ If.multi_headset {
        }
 }
 
+If.spk_init_rt1318 {
+       Condition {
+               Type RegexMatch
+               Regex "(rt1318(-1)?)"
+               String "${var:SpeakerCodec1}"
+       }
+       True.Include.spk_init.File "/codecs/${var:SpeakerCodec1}/init.conf"
+}
 
 If.hs_init {
        Condition {