mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ryan Lee <ryans.lee@maximintegrated.com>
To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, ryans.lee@maximintegrated.com,
	kuninori.morimoto.gx@renesas.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Cc: ryan.lee.maxim@gmail.com
Subject: [PATCH 8/9] ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path
Date: Fri, 25 Aug 2017 17:41:09 -0700	[thread overview]
Message-ID: <1503708070-7906-8-git-send-email-ryans.lee@maximintegrated.com> (raw)
In-Reply-To: <1503708070-7906-1-git-send-email-ryans.lee@maximintegrated.com>

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
---
Changes : Modified DAPM widget and audio map to enable/disable IV sensing path

 sound/soc/codecs/max98927.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c
index 5517251..f944659 100644
--- a/sound/soc/codecs/max98927.c
+++ b/sound/soc/codecs/max98927.c
@@ -509,11 +509,6 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w,
 		regmap_update_bits(max98927->regmap,
 			MAX98927_R003A_AMP_EN,
 			MAX98927_AMP_EN_MASK, 1);
-		/* enable VMON and IMON */
-		regmap_update_bits(max98927->regmap,
-			MAX98927_R003E_MEAS_EN,
-			MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN,
-			MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN);
 		regmap_update_bits(max98927->regmap,
 			MAX98927_R00FF_GLOBAL_SHDN,
 			MAX98927_GLOBAL_EN_MASK, 1);
@@ -525,10 +520,6 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w,
 		regmap_update_bits(max98927->regmap,
 			MAX98927_R003A_AMP_EN,
 			MAX98927_AMP_EN_MASK, 0);
-		/* disable VMON and IMON */
-		regmap_update_bits(max98927->regmap,
-			MAX98927_R003E_MEAS_EN,
-			MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN, 0);
 		break;
 	default:
 		return 0;
@@ -547,14 +538,24 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w,
 static const struct snd_kcontrol_new max98927_dai_controls =
 	SOC_DAPM_ENUM("DAI Sel", dai_sel_enum);
 
+static const struct snd_kcontrol_new max98927_vi_control =
+	SOC_DAPM_SINGLE("Switch", MAX98927_R003F_MEAS_DSP_CFG, 2, 1, 0);
+
 static const struct snd_soc_dapm_widget max98927_dapm_widgets[] = {
-	SND_SOC_DAPM_AIF_IN("DAI_OUT", "HiFi Playback", 0, SND_SOC_NOPM, 0, 0),
 	SND_SOC_DAPM_DAC_E("Amp Enable", "HiFi Playback", MAX98927_R003A_AMP_EN,
 		0, 0, max98927_dac_event,
 		SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
 	SND_SOC_DAPM_MUX("DAI Sel Mux", SND_SOC_NOPM, 0, 0,
 		&max98927_dai_controls),
 	SND_SOC_DAPM_OUTPUT("BE_OUT"),
+	SND_SOC_DAPM_AIF_OUT("Voltage Sense", "HiFi Capture",  0,
+		MAX98927_R003E_MEAS_EN, 0, 0),
+	SND_SOC_DAPM_AIF_OUT("Current Sense", "HiFi Capture",  0,
+		MAX98927_R003E_MEAS_EN, 1, 0),
+	SND_SOC_DAPM_SWITCH("VI Sense", SND_SOC_NOPM, 0, 0,
+		&max98927_vi_control),
+	SND_SOC_DAPM_SIGGEN("VMON"),
+	SND_SOC_DAPM_SIGGEN("IMON"),
 };
 
 static DECLARE_TLV_DB_SCALE(max98927_spk_tlv, 300, 300, 0);
@@ -656,11 +657,16 @@ static SOC_ENUM_SINGLE_DECL(max98927_env_track_headroom,
 };
 
 static const struct snd_soc_dapm_route max98927_audio_map[] = {
-	{"Amp Enable", NULL, "DAI_OUT"},
+	/* Plabyack */
 	{"DAI Sel Mux", "Left", "Amp Enable"},
 	{"DAI Sel Mux", "Right", "Amp Enable"},
 	{"DAI Sel Mux", "LeftRight", "Amp Enable"},
 	{"BE_OUT", NULL, "DAI Sel Mux"},
+	/* Capture */
+	{ "VI Sense", "Switch", "VMON" },
+	{ "VI Sense", "Switch", "IMON" },
+	{ "Voltage Sense", NULL, "VI Sense" },
+	{ "Current Sense", NULL, "VI Sense" },
 };
 
 static struct snd_soc_dai_driver max98927_dai[] = {
-- 
1.9.1

  parent reply	other threads:[~2017-08-26  0:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26  0:41 [PATCH 1/9] ASoC: max98927: Added TDM support Ryan Lee
2017-08-26  0:41 ` [PATCH 2/9] ASoC: max98927: Added controls for Envelope tracking Ryan Lee
2017-08-26  0:41 ` [PATCH 3/9] ASoC: max98927: Updated volatile register list Ryan Lee
2017-08-26  0:41 ` [PATCH 4/9] ASoC: max98927: Added missing \n to end of dev_err messages Ryan Lee
2017-08-26  0:41 ` [PATCH 5/9] ASoC: max98927: Removed obsolete variables Ryan Lee
2017-08-26  0:41 ` [PATCH 6/9] ASoC: max98927: Modified chip default register values Ryan Lee
2017-08-26  0:41 ` [PATCH 7/9] ASoC: max98927: Added PM suspend and resume function Ryan Lee
2017-08-26  0:41 ` Ryan Lee [this message]
2017-08-31 11:54   ` Applied "ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path" to the asoc tree Mark Brown
2017-08-26  0:41 ` [PATCH 9/9] ASoC: max98927: Changed device property read function Ryan Lee
2017-08-31 11:54   ` Applied "ASoC: max98927: Changed device property read function" to the asoc tree Mark Brown
2017-08-27 14:02 ` [PATCH 1/9] ASoC: max98927: Added TDM support Mark Brown
2017-08-28 23:34   ` Ryan Lee
2017-08-28 23:30 [PATCH 1/9] ASoC: max98927: Added support for DSP_A and DSP_B format Ryan Lee
2017-08-28 23:31 ` [PATCH 8/9] ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path Ryan Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503708070-7906-8-git-send-email-ryans.lee@maximintegrated.com \
    --to=ryans.lee@maximintegrated.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=ryan.lee.maxim@gmail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome