All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Guanqun <guanqun.lu@intel.com>
To: ALSA <alsa-devel@alsa-project.org>, Lu Guanqun <guanqun.lu@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>, Koul Vinod <vinod.koul@intel.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>,
	Wang Xingchao <xingchao.wang@intel.com>
Subject: [PATCH v2 06/10] ASoC: upd9976: add Analog MIC support
Date: Fri, 06 May 2011 13:46:29 +0800	[thread overview]
Message-ID: <20110506054629.26312.4509.stgit@localhost> (raw)
In-Reply-To: <20110506053852.26312.79083.stgit@localhost>

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/upd9976.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/upd9976.c b/sound/soc/codecs/upd9976.c
index a668b47..cbcfbb2 100644
--- a/sound/soc/codecs/upd9976.c
+++ b/sound/soc/codecs/upd9976.c
@@ -77,6 +77,11 @@ static DECLARE_TLV_DB_SCALE(adac_tlv, -8400, 75, 0);
  */
 static DECLARE_TLV_DB_SCALE(dmic_tlv, -6300, 100, 1);
 
+/*
+ * Analog Volume: from -25 dB to 6 dB in 1 dB steps.
+ */
+static DECLARE_TLV_DB_SCALE(analog_tlv, -2500, 100, 0);
+
 static const struct snd_kcontrol_new upd9976_snd_controls[] = {
 	SOC_DOUBLE_R_TLV("Master Volume",
 			 UPD9976_AUDIOLVOL, UPD9976_AUDIORVOL,
@@ -87,6 +92,11 @@ static const struct snd_kcontrol_new upd9976_snd_controls[] = {
 	SOC_SINGLE("Internal Mic Switch", UPD9976_DMICCTRL1, 6, 1, 0),
 	SOC_SINGLE_TLV("Internal Mic Capture Volume",
 		       UPD9976_DMICCTRL1, 0, 0x3f, 1, dmic_tlv),
+	SOC_DOUBLE_R("Analog Mic Switch", UPD9976_LILSEL, UPD9976_LIRSEL,
+		     6, 1, 0),
+	SOC_DOUBLE_R_TLV("Analog Capture Volume",
+			 UPD9976_LILSEL, UPD9976_LILSEL,
+			 0, 0x1f, 1, analog_tlv),
 };
 
 static const struct snd_kcontrol_new upd9976_hp_spkr_mixer_left_controls[] = {
@@ -99,6 +109,13 @@ static const struct snd_kcontrol_new upd9976_hp_spkr_mixer_right_controls[] = {
 	SOC_DAPM_SINGLE("Audio DAC Right Switch", UPD9976_HPRMIXSEL, 3, 1, 1),
 };
 
+/* Analog Right Mux */
+static const char *upd9976_analog_mux_texts[] = {"MIC", "LineIn"};
+static const struct soc_enum upd9976_ar_mux_enum =
+	SOC_ENUM_SINGLE(UPD9976_LIRSEL, 7, 2, upd9976_analog_mux_texts);
+static const struct snd_kcontrol_new upd9976_ar_mux_control =
+	SOC_DAPM_ENUM("Route", upd9976_ar_mux_enum);
+
 /* PCM2 Left Mux */
 static const char *upd9976_pcm2_left_mux_texts[] = {"AADC Left", "DMIC"};
 static const struct soc_enum upd9976_pcm2_left_mux_enum =
@@ -166,6 +183,9 @@ static const struct snd_soc_dapm_widget upd9976_dapm_widgets[] = {
 	SND_SOC_DAPM_MIXER("PCM2 In No Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
 
 	/* Mux */
+	SND_SOC_DAPM_MUX("Analog Right Mux", UPD9976_POWERCTRL1, 4, 0,
+			 &upd9976_ar_mux_control),
+
 	SND_SOC_DAPM_MUX("PCM2 Left Mux", SND_SOC_NOPM, 0, 0,
 			 &upd9976_pcm2_left_mux_control),
 	SND_SOC_DAPM_MUX("PCM2 Right Mux", SND_SOC_NOPM, 0, 0,
@@ -184,6 +204,8 @@ static const struct snd_soc_dapm_widget upd9976_dapm_widgets[] = {
 
 	SND_SOC_DAPM_PGA("DMIC Gain PGA", UPD9976_DMICCTRL1, 7, 0, NULL, 0),
 
+	SND_SOC_DAPM_PGA("MIC2 In PGA", UPD9976_POWERCTRL1, 2, 0, NULL, 0),
+
 	/* Audio Interface */
 	SND_SOC_DAPM_AIF_OUT("PCM2 Out", "Audio Capture", 0, SND_SOC_NOPM, 0,
 			     0),
@@ -208,6 +230,13 @@ static const struct snd_soc_dapm_route upd9976_dapm_routes[] = {
 	{"HPOUTL", NULL, "HP Playback Left PGA"},
 	{"HPOUTR", NULL, "HP Playback Right PGA"},
 
+	{"MIC2 In PGA", NULL, "MIC2"},
+
+	{"Analog Right Mux", "MIC", "MIC2 In PGA"},
+	{"Analog Right Mux", "LineIn", "LINEINR"},
+
+	{"AADC", NULL, "Analog Right Mux"},
+
 	{"DMICDAT", NULL, "DMIC Supply"},
 	{"DMIC Gain PGA", NULL, "DMICDAT"},
 

  parent reply	other threads:[~2011-05-06  5:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06  5:45 [PATCH v2 00/10] ASoC Support For Moorestown Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 01/10] ASoC: upd9976: Add Renesas uPD9976 codec driver Lu Guanqun
2011-05-06 10:17   ` Mark Brown
2011-05-07 14:21     ` Lu Guanqun
2011-05-07 14:27       ` Mark Brown
2011-05-07 14:43         ` Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 02/10] ASoC: sst_platform: modify current cpu dai driver to suit the needs for moorestown platform Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 03/10] ASoC: mrst_machine: add moorestown machine driver Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 04/10] ASoC: upd9976: add capture ability for dai driver Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 05/10] ASoC: upd9976: add DMIC support Lu Guanqun
2011-05-06 11:07   ` Mark Brown
2011-05-06  5:46 ` Lu Guanqun [this message]
2011-05-06  5:46 ` [PATCH v2 07/10] ASoC: upd9976: add jack detection function Lu Guanqun
2011-05-06 12:53   ` Mark Brown
2011-05-06  5:46 ` [PATCH v2 08/10] ASoC: mrst_machine: add capture functionality Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 09/10] ASoC: mrst_machine: add jack detection support Lu Guanqun
2011-05-06  5:46 ` [PATCH v2 10/10] ASoC: mrst_machine: add initial config to machine driver Lu Guanqun
2011-05-06 12:54   ` Mark Brown

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=20110506054629.26312.4509.stgit@localhost \
    --to=guanqun.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    --cc=xingchao.wang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.