[PATCH 3/3] ASoC: nau8810: add aux input control, available on NAU8812

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thomas Fehrenbacher <thomas.fehrenbacher@xxxxxxxxx>

This commit adds the support to control the aux-port on the nau8812
devices. We don't need to differentiate the aux-port registers since
those bitfields are set to '0' on the nau8810 devices [1,2].

[1] http://www.nuvoton.com/resource-files/NAU8810_Datasheet_Rev_2.8.pdf
[2] http://www.nuvoton.com/resource-files/NAU8812DatasheetRev2.7.pdf

Signed-off-by: Thomas Fehrenbacher <thomas.fehrenbacher@xxxxxxxxx>
[m.felsch@xxxxxxxxxxxxxx: add commit message]
Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
---
 sound/soc/codecs/nau8810.c | 7 +++++++
 sound/soc/codecs/nau8810.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c
index a32a4a8d5f50..b1024d24d413 100644
--- a/sound/soc/codecs/nau8810.c
+++ b/sound/soc/codecs/nau8810.c
@@ -351,6 +351,9 @@ static const struct snd_kcontrol_new nau8810_snd_controls[] = {
 		NAU8810_DACOS_SFT, 1, 0),
 	SOC_SINGLE("ADC Oversampling Rate(128x) Switch", NAU8810_REG_ADC,
 		NAU8810_ADCOS_SFT, 1, 0),
+
+	SOC_SINGLE("AUX Input Enable Switch", NAU8810_REG_POWER1,
+		NAU8810_AUX_EN_SFT, 1, 0),
 };
 
 /* Speaker Output Mixer */
@@ -383,6 +386,8 @@ static const struct snd_kcontrol_new nau8810_inpga[] = {
 		NAU8810_NMICPGA_SFT, 1, 0),
 	SOC_DAPM_SINGLE("MicP Switch", NAU8810_REG_INPUT_SIGNAL,
 		NAU8810_PMICPGA_SFT, 1, 0),
+	SOC_DAPM_SINGLE("AUX Switch", NAU8810_REG_INPUT_SIGNAL,
+		NAU8810_AUXPGA_SFT, 1, 0),
 };
 
 /* Loopback Switch */
@@ -436,6 +441,7 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = {
 
 	SND_SOC_DAPM_INPUT("MICN"),
 	SND_SOC_DAPM_INPUT("MICP"),
+	SND_SOC_DAPM_INPUT("AUX"),
 	SND_SOC_DAPM_OUTPUT("MONOOUT"),
 	SND_SOC_DAPM_OUTPUT("SPKOUTP"),
 	SND_SOC_DAPM_OUTPUT("SPKOUTN"),
@@ -470,6 +476,7 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = {
 	{"Input PGA", NULL, "Mic Bias"},
 	{"Input PGA", "MicN Switch", "MICN"},
 	{"Input PGA", "MicP Switch", "MICP"},
+	{"Input PGA", "AUX Switch", "AUX"},
 
 	/* Digital Looptack */
 	{"Digital Loopback", "Switch", "ADC"},
diff --git a/sound/soc/codecs/nau8810.h b/sound/soc/codecs/nau8810.h
index 1ada31883dc6..7b5ecad173d3 100644
--- a/sound/soc/codecs/nau8810.h
+++ b/sound/soc/codecs/nau8810.h
@@ -69,6 +69,7 @@
 
 /* NAU8810_REG_POWER1 (0x1) */
 #define NAU8810_DCBUF_EN		(0x1 << 8)
+#define NAU8810_AUX_EN_SFT		6
 #define NAU8810_PLL_EN_SFT		5
 #define NAU8810_MICBIAS_EN_SFT	4
 #define NAU8810_ABIAS_EN		(0x1 << 3)
@@ -229,6 +230,7 @@
 /* NAU8810_REG_INPUT_SIGNAL (0x2C) */
 #define NAU8810_PMICPGA_SFT		0
 #define NAU8810_NMICPGA_SFT		1
+#define NAU8810_AUXPGA_SFT		2
 
 /* NAU8810_REG_PGAGAIN (0x2D) */
 #define NAU8810_PGAGAIN_SFT		0
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux