diff mbox series

[v2] ASoC: tlv320aic3x: Add support for high power analog output

Message ID 20190430200118.13014-1-sravanhome@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] ASoC: tlv320aic3x: Add support for high power analog output | expand

Commit Message

saravanan sekar April 30, 2019, 8:01 p.m. UTC
Add support to output level control for the analog high power output
drivers HPOUT and HPCOM.

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---

Notes:
    Changes in V2:
    - Removed power control as it is handled by DAPM
    - Added level control for left channel

 sound/soc/codecs/tlv320aic3x.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mark Brown May 2, 2019, 2:09 a.m. UTC | #1
On Tue, Apr 30, 2019 at 10:01:18PM +0200, Saravanan Sekar wrote:
> Add support to output level control for the analog high power output
> drivers HPOUT and HPCOM.
> 
> Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>

This doesn't build with current code:

  CC      sound/soc/codecs/tlv320aic3x.o
sound/soc/codecs/tlv320aic3x.c:428:20: error: expected ‘}’ before ‘;’ token
    4, 9, 0, hp_tlv);
                    ^
sound/soc/codecs/tlv320aic3x.c:330:61: note: to match this ‘{’
 static const struct snd_kcontrol_new aic3x_snd_controls[] = {
                                                             ^
diff mbox series

Patch

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 516d17cb2182..90f53f9b5c2f 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -324,6 +324,9 @@  static DECLARE_TLV_DB_SCALE(adc_tlv, 0, 50, 0);
  */
 static DECLARE_TLV_DB_SCALE(output_stage_tlv, -5900, 50, 1);
 
+/* HP/HPCOM volumes. From 0 to 9 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(hp_tlv, 0, 100, 0);
+
 static const struct snd_kcontrol_new aic3x_snd_controls[] = {
 	/* Output */
 	SOC_DOUBLE_R_TLV("PCM Playback Volume",
@@ -419,6 +422,12 @@  static const struct snd_kcontrol_new aic3x_snd_controls[] = {
 	/* Pop reduction */
 	SOC_ENUM("Output Driver Power-On time", aic3x_poweron_time_enum),
 	SOC_ENUM("Output Driver Ramp-up step", aic3x_rampup_step_enum),
+
+	/* Analog HPOUT, HPCOM output level controls */
+	SOC_DOUBLE_R_TLV("HP Playback Volume", HPLOUT_CTRL, HPROUT_CTRL,
+			4, 9, 0, hp_tlv);
+	SOC_DOUBLE_R_TLV("HPCOM Playback Volume", HPLCOM_CTRL, HPRCOM_CTRL,
+			4, 9, 0, hp_tlv);
 };
 
 /* For other than tlv320aic3104 */