[alsa-devel] [PATCH ucm/conf: 5/5] Create device comoponent for rt5645 Internal Analog Mic UCM

russell.parker7 at gmail.com russell.parker7 at gmail.com
Sun Jan 6 04:47:15 CET 2019


From: Russell Parker <russell.parker7 at gmail.com>

Since the Internal Analog Microphone device configuration is
identical for the rt5645 and rt5645 mono speaker UCMs, move
the entire definition to a component.

Signed-off-by: Russell Parker <russell.parker7 at gmail.com>

diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
index 489390d5..8497fa66 100644
--- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
+++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
@@ -89,49 +89,7 @@ SectionDevice."Headphones" {
 	]
 }
 
-SectionDevice."Mic".0 {
-	Comment "Internal Analog Microphone"
-
-	Value {
-		CaptureChannels "2"
-		CapturePriority "150"
-	}
-
-	EnableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Int Analog Mic Switch' on"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
-
-		cset "name='Mono ADC MIXL ADC1 Switch' on"
-		cset "name='Mono ADC MIXR ADC1 Switch' on"
-		cset "name='Mono ADC MIXL ADC2 Switch' off"
-		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' on"
-		cset "name='RECMIXR BST2 Switch' on"
-
-	]
-
-	DisableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
-		cset "name='Mono ADC MIXL ADC1 Switch' off"
-		cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' off"
-		cset "name='RECMIXR BST2 Switch' off"
-
-		cset "name='Int Analog Mic Switch' off"
-	]
-}
-
+<codecs/rt5645-common/AnalogMic.conf>
 
 SectionDevice."HSMic".0 {
 	Comment "Headset Microphone"
diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf
index ac5f60e2..b98ae66f 100644
--- a/src/conf/ucm/chtrt5645/HiFi.conf
+++ b/src/conf/ucm/chtrt5645/HiFi.conf
@@ -81,48 +81,7 @@ SectionDevice."Headphones" {
 	]
 }
 
-SectionDevice."Mic".0 {
-	Comment "Internal Analog Microphone"
-
-	Value {
-		CaptureChannels "2"
-		CapturePriority "150"
-	}
-
-	EnableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Int Analog Mic Switch' on"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
-
-		cset "name='Mono ADC MIXL ADC1 Switch' on"
-		cset "name='Mono ADC MIXR ADC1 Switch' on"
-		cset "name='Mono ADC MIXL ADC2 Switch' off"
-		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' on"
-		cset "name='RECMIXR BST2 Switch' on"
-
-	]
-
-	DisableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
-		cset "name='Mono ADC MIXL ADC1 Switch' off"
-		cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' off"
-		cset "name='RECMIXR BST2 Switch' off"
-
-		cset "name='Int Analog Mic Switch' off"
-	]
-}
+<codecs/rt5645-common/AnalogMic.conf>
 
 SectionDevice."HSMic".0 {
 	Comment "Headset Microphone"
diff --git a/src/conf/ucm/codecs/rt5645-common/AnalogMic.conf b/src/conf/ucm/codecs/rt5645-common/AnalogMic.conf
new file mode 100644
index 00000000..cbcefa7a
--- /dev/null
+++ b/src/conf/ucm/codecs/rt5645-common/AnalogMic.conf
@@ -0,0 +1,41 @@
+SectionDevice."Mic".0 {
+	Comment "Internal Analog Microphone"
+
+	Value {
+		CaptureChannels "2"
+		CapturePriority "150"
+	}
+
+	EnableSequence [
+		cdev "hw:chtrt5645"
+
+		cset "name='Int Analog Mic Switch' on"
+
+		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
+		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
+		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
+		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
+
+		cset "name='Mono ADC MIXL ADC1 Switch' on"
+		cset "name='Mono ADC MIXR ADC1 Switch' on"
+		cset "name='Mono ADC MIXL ADC2 Switch' off"
+		cset "name='Mono ADC MIXR ADC2 Switch' off"
+
+		cset "name='RECMIXL BST2 Switch' on"
+		cset "name='RECMIXR BST2 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:chtrt5645"
+
+		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
+		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
+		cset "name='Mono ADC MIXL ADC1 Switch' off"
+		cset "name='Mono ADC MIXR ADC1 Switch' off"
+
+		cset "name='RECMIXL BST2 Switch' off"
+		cset "name='RECMIXR BST2 Switch' off"
+
+		cset "name='Int Analog Mic Switch' off"
+	]
+}
diff --git a/src/conf/ucm/codecs/rt5645-common/Makefile.am b/src/conf/ucm/codecs/rt5645-common/Makefile.am
index 06403d9b..75924b40 100644
--- a/src/conf/ucm/codecs/rt5645-common/Makefile.am
+++ b/src/conf/ucm/codecs/rt5645-common/Makefile.am
@@ -3,5 +3,5 @@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645-common
 ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \
 		   SpeakerEnableSeq.conf DigitalMicDisableSeq.conf \
 		   DigitalMicEnableSeq.conf HSMicDisableSeq.conf \
-		   HSMicEnableSeq.conf
+		   HSMicEnableSeq.conf AnalogMic.conf
 EXTRA_DIST = $(ucm_DATA)
-- 
2.20.1



More information about the Alsa-devel mailing list