The sun4i-codec kernel driver covers a large number of Allwinner SoCs.
The H616 codec has a single line-out route, which is used in concert
with a Toshiba mux chip to send audio to either an internal speaker or
headphone jack on a number of Anbernic handheld gaming devices.
Add a UCM configuration to allow enabling/disabling the speaker amp
depending on whether headphones are in use or not.
Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/491
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
--- /dev/null
+SectionDevice."Speaker" {
+ Comment "Internal Speaker"
+
+ EnableSequence [
+ cset "name='Speaker Switch' on"
+ ]
+
+ Value {
+ PlaybackMixerElem "Line Out"
+ PlaybackPCM "hw:${CardId},0"
+ }
+
+ DisableSequence [
+ cset "name='Speaker Switch' off"
+ ]
+
+ ConflictingDevice [
+ "Headphones"
+ ]
+}
+
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ Value {
+ PlaybackMixerElem "Line Out"
+ PlaybackPCM "hw:${CardId},0"
+ JackControl "Headphone Jack"
+ }
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+}
--- /dev/null
+# UCM for Allwinner H616 Codec
+
+Syntax 3
+
+SectionUseCase."HiFi" {
+ File "/Allwinner/sun4i-h616/HiFi.conf"
+ Comment "Play HiFi quality Music"
+}