diff mbox

[3/3] ASoC: tlv320aic3x: Add controls for selecting HP power down modes

Message ID 20161223092112.7992-4-peter.ujfalusi@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Ujfalusi Dec. 23, 2016, 9:21 a.m. UTC
When the HP drivers are powered down, their output can be placed in
high-impedance state or it can be weakly driven to the VCM level.
High-impedance mode provides better power saving in the expense of pop
noise when powering up the HP.
When the output is driven to VCM level the artifacts can be minimized, but
the power down power consumption will be slightly higher.

The patch adds way to select the HPL/R power-down mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/codecs/tlv320aic3x.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jarkko Nikula Dec. 23, 2016, 6:47 p.m. UTC | #1
On 12/23/2016 11:21 AM, Peter Ujfalusi wrote:
> When the HP drivers are powered down, their output can be placed in
> high-impedance state or it can be weakly driven to the VCM level.
> High-impedance mode provides better power saving in the expense of pop
> noise when powering up the HP.
> When the output is driven to VCM level the artifacts can be minimized, but
> the power down power consumption will be slightly higher.
> 
> The patch adds way to select the HPL/R power-down mode.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  sound/soc/codecs/tlv320aic3x.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
This certainly gives more possibilities to control this depending on
use-case and device idleness. However I think does it find use or will
it end up being a random choice?

Alternative could be some high-impedance widget that defines the output
mode and what a machine driver wanting lower power consumption can
connect instead of HP outputs. Another idea that comes to my mind do you
hear the pop if output is let to be in high-impedance but is driven to
VCM with some delay before powering up?
Mark Brown Dec. 31, 2016, 6:49 p.m. UTC | #2
On Fri, Dec 23, 2016 at 08:47:07PM +0200, Jarkko Nikula wrote:

> This certainly gives more possibilities to control this depending on
> use-case and device idleness. However I think does it find use or will
> it end up being a random choice?

I suspect most people won't understand it but OTOH I can see some
people wanting to use it so...

> Alternative could be some high-impedance widget that defines the output
> mode and what a machine driver wanting lower power consumption can
> connect instead of HP outputs. Another idea that comes to my mind do you
> hear the pop if output is let to be in high-impedance but is driven to
> VCM with some delay before powering up?

I can also see a system tying it to jack detection so you get the pop
reduction if the headphones are physically connected and low power if
they're not there and nothing is going to care anyway.
diff mbox

Patch

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index bc220f83dd1f..3e66dedeafac 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -305,6 +305,13 @@  static const char * const aic3x_rampup_step[] = { "0ms", "1ms", "2ms", "4ms" };
 static SOC_ENUM_SINGLE_DECL(aic3x_rampup_step_enum, HPOUT_POP_REDUCTION, 2,
 			    aic3x_rampup_step);
 
+static const char * const aic3x_output_pdown_mode[] = {
+	"Drive to a common-mode", "High-impedance mode"};
+static SOC_ENUM_SINGLE_DECL(aic3x_hpl_pdown_mode_enum, HPLOUT_CTRL, 2,
+			    aic3x_output_pdown_mode);
+static SOC_ENUM_SINGLE_DECL(aic3x_hpr_pdown_mode_enum, HPROUT_CTRL, 2,
+			    aic3x_output_pdown_mode);
+
 /*
  * DAC digital volumes. From -63.5 to 0 dB in 0.5 dB steps
  */
@@ -392,6 +399,9 @@  static const struct snd_kcontrol_new aic3x_snd_controls[] = {
 	SOC_DOUBLE_R("HPCOM Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3,
 		     0x01, 0),
 
+	SOC_ENUM("Left HP Power Down mode", aic3x_hpl_pdown_mode_enum),
+	SOC_ENUM("Right HP Power Down mode", aic3x_hpr_pdown_mode_enum),
+
 	/*
 	 * Note: enable Automatic input Gain Controller with care. It can
 	 * adjust PGA to max value when ADC is on and will never go back.