* [PATCH] ASoC: tlv320dac33: Control for line output gain
@ 2010-10-13 8:08 Peter Ujfalusi
2010-10-13 8:14 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Peter Ujfalusi @ 2010-10-13 8:08 UTC (permalink / raw)
To: alsa-devel; +Cc: broonie, Liam Girdwood
New control to select the line output gain.
This gain control affects the linein-to-lineout and
dac-to-loneout gain differently.
Use enum type to select the desired gain combination.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
sound/soc/codecs/tlv320dac33.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index bf6d01f..4d86bf6 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -524,6 +524,22 @@ static const struct soc_enum dac33_fifo_mode_enum =
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dac33_fifo_mode_texts),
dac33_fifo_mode_texts);
+/* L/R Line Output Gain */
+static const char *lr_lineout_gain_texts[] = {
+ "Line 0.25V/V DAC 1V/V", "Line 0.5V/V DAC 2V/V",
+ "Line 1V/V DAC 4V/V", "Line 2V/V DAC 8V/V",
+};
+
+static const struct soc_enum l_lineout_gain_enum =
+ SOC_ENUM_SINGLE(DAC33_LDAC_PWR_CTRL, 0,
+ ARRAY_SIZE(lr_lineout_gain_texts),
+ lr_lineout_gain_texts);
+
+static const struct soc_enum r_lineout_gain_enum =
+ SOC_ENUM_SINGLE(DAC33_RDAC_PWR_CTRL, 0,
+ ARRAY_SIZE(lr_lineout_gain_texts),
+ lr_lineout_gain_texts);
+
/*
* DACL/R digital volume control:
* from 0 dB to -63.5 in 0.5 dB steps
@@ -541,6 +557,8 @@ static const struct snd_kcontrol_new dac33_snd_controls[] = {
DAC33_LDAC_DIG_VOL_CTRL, DAC33_RDAC_DIG_VOL_CTRL, 7, 1, 1),
SOC_DOUBLE_R("Line to Line Out Volume",
DAC33_LINEL_TO_LLO_VOL, DAC33_LINER_TO_RLO_VOL, 0, 127, 1),
+ SOC_ENUM("Left Line Output Gain", l_lineout_gain_enum),
+ SOC_ENUM("Right Line Output Gain", r_lineout_gain_enum),
};
static const struct snd_kcontrol_new dac33_mode_snd_controls[] = {
--
1.7.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: tlv320dac33: Control for line output gain
2010-10-13 8:08 [PATCH] ASoC: tlv320dac33: Control for line output gain Peter Ujfalusi
@ 2010-10-13 8:14 ` Mark Brown
2010-10-13 8:40 ` Peter Ujfalusi
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-10-13 8:14 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood
On Wed, Oct 13, 2010 at 11:08:18AM +0300, Peter Ujfalusi wrote:
> +/* L/R Line Output Gain */
> +static const char *lr_lineout_gain_texts[] = {
> + "Line 0.25V/V DAC 1V/V", "Line 0.5V/V DAC 2V/V",
> + "Line 1V/V DAC 4V/V", "Line 2V/V DAC 8V/V",
> +};
I'm having a hard time parsing what these actually mean so I'm guessing
users are going to have trouble also - is there anything that could be
done to make things clearer?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: tlv320dac33: Control for line output gain
2010-10-13 8:14 ` Mark Brown
@ 2010-10-13 8:40 ` Peter Ujfalusi
2010-10-13 8:43 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Peter Ujfalusi @ 2010-10-13 8:40 UTC (permalink / raw)
To: ext Mark Brown; +Cc: alsa-devel@alsa-project.org, Liam Girdwood
On Wednesday 13 October 2010 11:14:03 ext Mark Brown wrote:
> On Wed, Oct 13, 2010 at 11:08:18AM +0300, Peter Ujfalusi wrote:
> > +/* L/R Line Output Gain */
> > +static const char *lr_lineout_gain_texts[] = {
> > + "Line 0.25V/V DAC 1V/V", "Line 0.5V/V DAC 2V/V",
> > + "Line 1V/V DAC 4V/V", "Line 2V/V DAC 8V/V",
> > +};
>
> I'm having a hard time parsing what these actually mean so I'm guessing
> users are going to have trouble also - is there anything that could be
> done to make things clearer?
In the documentation these gains are described like that (0.25V.V / 1V/V), and I
wanted to use the same in the enum elements, but what about:
/* L/R Line Output Gain */
static const char *lr_lineout_gain_texts[] = {
"Line -12dB DAC 0dB", "Line -6dB DAC 6dB",
"Line 0dB DAC 12dB", "Line 6dB DAC 18dB",
};
Value 0 in the registers mean:
linein-to-lineout gain 0.25V/V (-12dB)
dac-to-lineout gain 1V/V (0dB)
Value 1 in the registers mean:
linein-to-lineout gain 0.5V/V (-6dB)
dac-to-lineout gain 2V/V (6dB)
What do you think?
--
Péter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: tlv320dac33: Control for line output gain
2010-10-13 8:40 ` Peter Ujfalusi
@ 2010-10-13 8:43 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2010-10-13 8:43 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel@alsa-project.org, Liam Girdwood
On Wed, Oct 13, 2010 at 11:40:26AM +0300, Peter Ujfalusi wrote:
> In the documentation these gains are described like that (0.25V.V / 1V/V), and I
> wanted to use the same in the enum elements, but what about:
> /* L/R Line Output Gain */
> static const char *lr_lineout_gain_texts[] = {
> "Line -12dB DAC 0dB", "Line -6dB DAC 6dB",
> "Line 0dB DAC 12dB", "Line 6dB DAC 18dB",
> };
That's *much* clearer.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-13 8:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-13 8:08 [PATCH] ASoC: tlv320dac33: Control for line output gain Peter Ujfalusi
2010-10-13 8:14 ` Mark Brown
2010-10-13 8:40 ` Peter Ujfalusi
2010-10-13 8:43 ` 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.