[PATCH] ASoC: codecs: ES8326: Adding new kcontrols about Headphone resistance

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

 



We get headphone detect issue.And we fix it with the new kcontrols

Signed-off-by: Zhang Yi <zhangyi@xxxxxxxxxxxxxxxx>
---
 sound/soc/codecs/es8326.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
index 608862aebd71..aa5044eef0ca 100755
--- a/sound/soc/codecs/es8326.c
+++ b/sound/soc/codecs/es8326.c
@@ -226,6 +226,29 @@ static const char *const hp_spkvol_switch[] = {
 	"HPVOL: HPL+HPR, SPKVOL: SPKL+SPKR",
 };
 
+static const char *const hp_det_resistance[] = {
+	"10K",
+	"5K",
+};
+
+static const char *const micbias_resistance[] = {
+	"5.5K",
+	"4.5K",
+	"3.6K",
+	"2.8K",
+	"2.1K",
+	"1.5K",
+	"1.0K",
+	"0.6K",
+};
+
+static const char *const button_resistance[] = {
+	"100 percent",
+	"90 percent",
+	"80 percent",
+	"70 percent",
+};
+
 static const struct soc_enum dacpol =
 	SOC_ENUM_SINGLE(ES8326_DAC_DSM, 4, 4, dacpol_txt);
 static const struct soc_enum alc_winsize =
@@ -234,6 +257,12 @@ static const struct soc_enum drc_winsize =
 	SOC_ENUM_SINGLE(ES8326_DRC_WINSIZE, 4, 16, winsize);
 static const struct soc_enum hpvol_spkvol_switch =
 	SOC_ENUM_SINGLE(ES8326_HP_MISC, 6, 4, hp_spkvol_switch);
+static const struct soc_enum hp_det =
+	SOC_ENUM_SINGLE(ES8326_ANA_MICBIAS, 7, 2, hp_det_resistance);
+static const struct soc_enum micbias_res =
+	SOC_ENUM_SINGLE(ES8326_ANA_MICBIAS, 4, 8, micbias_resistance);
+static const struct soc_enum button_res =
+	SOC_ENUM_SINGLE(ES8326_ANA_MICBIAS, 0, 4, button_resistance);
 
 static const struct snd_kcontrol_new es8326_snd_controls[] = {
 	SOC_SINGLE_TLV("DAC Playback Volume", ES8326_DACL_VOL, 0, 0xbf, 0, dac_vol_tlv),
@@ -270,6 +299,9 @@ static const struct snd_kcontrol_new es8326_snd_controls[] = {
 	SOC_SINGLE_TLV("SPKR Playback Volume", ES8326_SPKR_VOL, 0, 0xbf, 0, dac_vol_tlv),
 
 	SOC_ENUM("HPVol SPKVol Switch", hpvol_spkvol_switch),
+	SOC_ENUM("Hpdet Resistance", hp_det),
+	SOC_ENUM("Micbias Resistance", micbias_res),
+	SOC_ENUM("Button Resistance", button_res),
 };
 
 static const struct snd_soc_dapm_widget es8326_dapm_widgets[] = {
-- 
2.17.1




[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