OSDN Git Service

ASoC: nau8824: user configuration of key detection
authorJohn Hsu <KCHSU0@nuvoton.com>
Wed, 21 Mar 2018 07:30:23 +0000 (15:30 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 17 Apr 2018 16:13:43 +0000 (17:13 +0100)
The SAR ADC of key press detection varies depending on headset.
We can't make a set of common threshold values for every case.
Therefore, the driver provides configuration for user and
they can set up values by UCM configuration.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/nau8824.c

index 637e952..76502c0 100644 (file)
@@ -409,6 +409,15 @@ static const struct snd_kcontrol_new nau8824_snd_controls[] = {
 
        SOC_SINGLE("DACL LR Mix", NAU8824_REG_DAC_MUTE_CTRL, 0, 1, 0),
        SOC_SINGLE("DACR LR Mix", NAU8824_REG_DAC_MUTE_CTRL, 1, 1, 0),
+
+       SOC_SINGLE("THD for key media",
+               NAU8824_REG_VDET_THRESHOLD_1, 8, 0xff, 0),
+       SOC_SINGLE("THD for key voice command",
+               NAU8824_REG_VDET_THRESHOLD_1, 0, 0xff, 0),
+       SOC_SINGLE("THD for key volume up",
+               NAU8824_REG_VDET_THRESHOLD_2, 8, 0xff, 0),
+       SOC_SINGLE("THD for key volume down",
+               NAU8824_REG_VDET_THRESHOLD_2, 0, 0xff, 0),
 };
 
 static int nau8824_output_dac_event(struct snd_soc_dapm_widget *w,