All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: tlv320aic32x4: Better model the input mixers
@ 2016-04-20 18:39 Jeremy McDermond
  2016-04-20 18:39 ` [PATCH 1/2] ASoC: tlv320aic32x4: Implement resistors on input pins Jeremy McDermond
  2016-04-20 18:39 ` [PATCH 2/2] ASoC: tlv320aic32x4: Add additional input pins Jeremy McDermond
  0 siblings, 2 replies; 5+ messages in thread
From: Jeremy McDermond @ 2016-04-20 18:39 UTC (permalink / raw)
  To: alsa-devel, broonie, lgirdwood; +Cc: Jeremy McDermond

The input mixers have resistors on all the input lines as well as an
additional line that crosses between right and left pins.  This patch
enables those routings within the driver to provide more flexibility for
different board configurations.

These settings are documented on pages 135 and 136 of TI's SLAA557
document available at http://www.ti.com/lit/ml/slaa557/slaa557.pdf.

This patch might introduce some breakage for current users because it
changes some mixer routing settings from a straight switch to an enum for
the different resistor values instead.  I'm not sure there's anything we
can do in code to mitigate these effects, but am open to requests for
changes if there's something I'm not aware of.

Jeremy McDermond (2):
  ASoC: tlv320aic32x4: Implement resistors on input pins
  ASoC: tlv320aic32x4:  Add additional input pins

 sound/soc/codecs/tlv320aic32x4.c | 38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ASoC: tlv320aic32x4: Implement resistors on input pins
  2016-04-20 18:39 [PATCH 0/2] ASoC: tlv320aic32x4: Better model the input mixers Jeremy McDermond
@ 2016-04-20 18:39 ` Jeremy McDermond
  2016-04-21 16:11   ` Applied "ASoC: tlv320aic32x4: Implement resistors on input pins" to the asoc tree Mark Brown
  2016-04-20 18:39 ` [PATCH 2/2] ASoC: tlv320aic32x4: Add additional input pins Jeremy McDermond
  1 sibling, 1 reply; 5+ messages in thread
From: Jeremy McDermond @ 2016-04-20 18:39 UTC (permalink / raw)
  To: alsa-devel, broonie, lgirdwood; +Cc: Jeremy McDermond

The input pins of the aic3204 have resistors inline with them.  The
current code assumes that you want a 10k resistor inline with your
inputs and implements it as a simple switch.  This patch creates an enum
for each pin and allows you to switch between not connected, 10k, 20k
and 40k ohm values.  This more closely models the acutal aic3204 part.

These pin settings are documented in TI's SLAA557 pages 135 and 136
(http://www.ti.com/lit/ml/slaa557/slaa557.pdf).

Signed-off-by: Jeremy McDermond <nh6z@nh6z.net>
---
 sound/soc/codecs/tlv320aic32x4.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 2f8480c..621f421 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -183,16 +183,34 @@ static const struct snd_kcontrol_new lor_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_LORROUTE, 3, 1, 0),
 };
 
+static const char * const resistor_text[] = {
+	"Off", "10 kOhm", "20 kOhm", "40 kOhm",
+};
+
+static SOC_ENUM_SINGLE_DECL(in1l_lpga_p_enum, AIC32X4_LMICPGAPIN, 6,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2,
+		resistor_text);
+
 static const struct snd_kcontrol_new left_input_mixer_controls[] = {
-	SOC_DAPM_SINGLE("IN1_L P Switch", AIC32X4_LMICPGAPIN, 6, 1, 0),
-	SOC_DAPM_SINGLE("IN2_L P Switch", AIC32X4_LMICPGAPIN, 4, 1, 0),
-	SOC_DAPM_SINGLE("IN3_L P Switch", AIC32X4_LMICPGAPIN, 2, 1, 0),
+	SOC_DAPM_ENUM("IN1_L P Switch", in1l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN2_L P Switch", in2l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN3_L P Switch", in3l_lpga_p_enum),
 };
 
+static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2,
+		resistor_text);
+
 static const struct snd_kcontrol_new right_input_mixer_controls[] = {
-	SOC_DAPM_SINGLE("IN1_R P Switch", AIC32X4_RMICPGAPIN, 6, 1, 0),
-	SOC_DAPM_SINGLE("IN2_R P Switch", AIC32X4_RMICPGAPIN, 4, 1, 0),
-	SOC_DAPM_SINGLE("IN3_R P Switch", AIC32X4_RMICPGAPIN, 2, 1, 0),
+	SOC_DAPM_ENUM("IN1_R P Switch", in1r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN2_R P Switch", in2r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN3_R P Switch", in3r_rpga_p_enum),
 };
 
 static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ASoC: tlv320aic32x4: Add additional input pins
  2016-04-20 18:39 [PATCH 0/2] ASoC: tlv320aic32x4: Better model the input mixers Jeremy McDermond
  2016-04-20 18:39 ` [PATCH 1/2] ASoC: tlv320aic32x4: Implement resistors on input pins Jeremy McDermond
@ 2016-04-20 18:39 ` Jeremy McDermond
  2016-04-21 16:11   ` Applied "ASoC: tlv320aic32x4: Add additional input pins" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Jeremy McDermond @ 2016-04-20 18:39 UTC (permalink / raw)
  To: alsa-devel, broonie, lgirdwood; +Cc: Jeremy McDermond

The input mixers support routing the IN1_R pin to the Left PGA and the
IN2_L pin to the Right PGA.  This patch allows for those routings.

Signed-off-by: Jeremy McDermond <nh6z@nh6z.net>
---
 sound/soc/codecs/tlv320aic32x4.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 621f421..0eb8acc 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -193,11 +193,14 @@ static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4,
 		resistor_text);
 static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2,
 		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in1r_lpga_p_enum, AIC32X4_LMICPGAPIN, 0,
+		resistor_text);
 
 static const struct snd_kcontrol_new left_input_mixer_controls[] = {
 	SOC_DAPM_ENUM("IN1_L P Switch", in1l_lpga_p_enum),
 	SOC_DAPM_ENUM("IN2_L P Switch", in2l_lpga_p_enum),
 	SOC_DAPM_ENUM("IN3_L P Switch", in3l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN1_R P Switch", in1r_lpga_p_enum),
 };
 
 static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6,
@@ -206,11 +209,14 @@ static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4,
 		resistor_text);
 static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2,
 		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2l_rpga_p_enum, AIC32X4_RMICPGAPIN, 0,
+		resistor_text);
 
 static const struct snd_kcontrol_new right_input_mixer_controls[] = {
 	SOC_DAPM_ENUM("IN1_R P Switch", in1r_rpga_p_enum),
 	SOC_DAPM_ENUM("IN2_R P Switch", in2r_rpga_p_enum),
 	SOC_DAPM_ENUM("IN3_R P Switch", in3r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN2_L P Switch", in2l_rpga_p_enum),
 };
 
 static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
@@ -285,6 +291,7 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	{"Left Input Mixer", "IN1_L P Switch", "IN1_L"},
 	{"Left Input Mixer", "IN2_L P Switch", "IN2_L"},
 	{"Left Input Mixer", "IN3_L P Switch", "IN3_L"},
+	{"Left Input Mixer", "IN1_R P Switch", "IN1_R"},
 
 	{"Left ADC", NULL, "Left Input Mixer"},
 
@@ -292,6 +299,7 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	{"Right Input Mixer", "IN1_R P Switch", "IN1_R"},
 	{"Right Input Mixer", "IN2_R P Switch", "IN2_R"},
 	{"Right Input Mixer", "IN3_R P Switch", "IN3_R"},
+	{"Right Input Mixer", "IN2_L P Switch", "IN2_L"},
 
 	{"Right ADC", NULL, "Right Input Mixer"},
 };
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Applied "ASoC: tlv320aic32x4: Add additional input pins" to the asoc tree
  2016-04-20 18:39 ` [PATCH 2/2] ASoC: tlv320aic32x4: Add additional input pins Jeremy McDermond
@ 2016-04-21 16:11   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-04-21 16:11 UTC (permalink / raw)
  To: Jeremy McDermond; +Cc: alsa-devel, broonie, lgirdwood

The patch

   ASoC: tlv320aic32x4: Add additional input pins

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 13a06ed55dba0ae3f983ef3c4ea70fc42066e1b5 Mon Sep 17 00:00:00 2001
From: Jeremy McDermond <nh6z@nh6z.net>
Date: Wed, 20 Apr 2016 11:39:12 -0700
Subject: [PATCH] ASoC: tlv320aic32x4: Add additional input pins

The input mixers support routing the IN1_R pin to the Left PGA and the
IN2_L pin to the Right PGA.  This patch allows for those routings.

Signed-off-by: Jeremy McDermond <nh6z@nh6z.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/tlv320aic32x4.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 621f4210cd27..0eb8acc8cd66 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -193,11 +193,14 @@ static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4,
 		resistor_text);
 static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2,
 		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in1r_lpga_p_enum, AIC32X4_LMICPGAPIN, 0,
+		resistor_text);
 
 static const struct snd_kcontrol_new left_input_mixer_controls[] = {
 	SOC_DAPM_ENUM("IN1_L P Switch", in1l_lpga_p_enum),
 	SOC_DAPM_ENUM("IN2_L P Switch", in2l_lpga_p_enum),
 	SOC_DAPM_ENUM("IN3_L P Switch", in3l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN1_R P Switch", in1r_lpga_p_enum),
 };
 
 static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6,
@@ -206,11 +209,14 @@ static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4,
 		resistor_text);
 static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2,
 		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2l_rpga_p_enum, AIC32X4_RMICPGAPIN, 0,
+		resistor_text);
 
 static const struct snd_kcontrol_new right_input_mixer_controls[] = {
 	SOC_DAPM_ENUM("IN1_R P Switch", in1r_rpga_p_enum),
 	SOC_DAPM_ENUM("IN2_R P Switch", in2r_rpga_p_enum),
 	SOC_DAPM_ENUM("IN3_R P Switch", in3r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN2_L P Switch", in2l_rpga_p_enum),
 };
 
 static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
@@ -285,6 +291,7 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	{"Left Input Mixer", "IN1_L P Switch", "IN1_L"},
 	{"Left Input Mixer", "IN2_L P Switch", "IN2_L"},
 	{"Left Input Mixer", "IN3_L P Switch", "IN3_L"},
+	{"Left Input Mixer", "IN1_R P Switch", "IN1_R"},
 
 	{"Left ADC", NULL, "Left Input Mixer"},
 
@@ -292,6 +299,7 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	{"Right Input Mixer", "IN1_R P Switch", "IN1_R"},
 	{"Right Input Mixer", "IN2_R P Switch", "IN2_R"},
 	{"Right Input Mixer", "IN3_R P Switch", "IN3_R"},
+	{"Right Input Mixer", "IN2_L P Switch", "IN2_L"},
 
 	{"Right ADC", NULL, "Right Input Mixer"},
 };
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Applied "ASoC: tlv320aic32x4: Implement resistors on input pins" to the asoc tree
  2016-04-20 18:39 ` [PATCH 1/2] ASoC: tlv320aic32x4: Implement resistors on input pins Jeremy McDermond
@ 2016-04-21 16:11   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-04-21 16:11 UTC (permalink / raw)
  To: Jeremy McDermond; +Cc: alsa-devel, broonie, lgirdwood

The patch

   ASoC: tlv320aic32x4: Implement resistors on input pins

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 20d2cecbb7b9c35235c97f0dfa520525c28f8841 Mon Sep 17 00:00:00 2001
From: Jeremy McDermond <nh6z@nh6z.net>
Date: Wed, 20 Apr 2016 11:39:11 -0700
Subject: [PATCH] ASoC: tlv320aic32x4: Implement resistors on input pins

The input pins of the aic3204 have resistors inline with them.  The
current code assumes that you want a 10k resistor inline with your
inputs and implements it as a simple switch.  This patch creates an enum
for each pin and allows you to switch between not connected, 10k, 20k
and 40k ohm values.  This more closely models the acutal aic3204 part.

These pin settings are documented in TI's SLAA557 pages 135 and 136
(http://www.ti.com/lit/ml/slaa557/slaa557.pdf).

Signed-off-by: Jeremy McDermond <nh6z@nh6z.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/tlv320aic32x4.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 2f8480c93b3c..621f4210cd27 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -183,16 +183,34 @@ static const struct snd_kcontrol_new lor_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_LORROUTE, 3, 1, 0),
 };
 
+static const char * const resistor_text[] = {
+	"Off", "10 kOhm", "20 kOhm", "40 kOhm",
+};
+
+static SOC_ENUM_SINGLE_DECL(in1l_lpga_p_enum, AIC32X4_LMICPGAPIN, 6,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2,
+		resistor_text);
+
 static const struct snd_kcontrol_new left_input_mixer_controls[] = {
-	SOC_DAPM_SINGLE("IN1_L P Switch", AIC32X4_LMICPGAPIN, 6, 1, 0),
-	SOC_DAPM_SINGLE("IN2_L P Switch", AIC32X4_LMICPGAPIN, 4, 1, 0),
-	SOC_DAPM_SINGLE("IN3_L P Switch", AIC32X4_LMICPGAPIN, 2, 1, 0),
+	SOC_DAPM_ENUM("IN1_L P Switch", in1l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN2_L P Switch", in2l_lpga_p_enum),
+	SOC_DAPM_ENUM("IN3_L P Switch", in3l_lpga_p_enum),
 };
 
+static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4,
+		resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2,
+		resistor_text);
+
 static const struct snd_kcontrol_new right_input_mixer_controls[] = {
-	SOC_DAPM_SINGLE("IN1_R P Switch", AIC32X4_RMICPGAPIN, 6, 1, 0),
-	SOC_DAPM_SINGLE("IN2_R P Switch", AIC32X4_RMICPGAPIN, 4, 1, 0),
-	SOC_DAPM_SINGLE("IN3_R P Switch", AIC32X4_RMICPGAPIN, 2, 1, 0),
+	SOC_DAPM_ENUM("IN1_R P Switch", in1r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN2_R P Switch", in2r_rpga_p_enum),
+	SOC_DAPM_ENUM("IN3_R P Switch", in3r_rpga_p_enum),
 };
 
 static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-21 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 18:39 [PATCH 0/2] ASoC: tlv320aic32x4: Better model the input mixers Jeremy McDermond
2016-04-20 18:39 ` [PATCH 1/2] ASoC: tlv320aic32x4: Implement resistors on input pins Jeremy McDermond
2016-04-21 16:11   ` Applied "ASoC: tlv320aic32x4: Implement resistors on input pins" to the asoc tree Mark Brown
2016-04-20 18:39 ` [PATCH 2/2] ASoC: tlv320aic32x4: Add additional input pins Jeremy McDermond
2016-04-21 16:11   ` Applied "ASoC: tlv320aic32x4: Add additional input pins" to the asoc tree Mark Brown

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.