ASoC: Store DC offset correction for wm_hubs devices in class W mode
Subsystems (3)
PATCH 1/1 ASoC: Store DC offset correction for wm_hubs devices in class W mode
Providing the analogue configuration of the output path remains the same the DC offset corrected by the DC servo will remain identical so we can skip the callibration, reducing the startup time for the headphone output. Implement this for the wm_hubs devices as has been done for several other CODECs.
Don't do this if we have any analogue paths enabled since offsets may be being introduced by the analogue paths which could vary outside the control of the driver.
---
This change has not been tested yet but I'm sending it out for review now to accelerate the process.
sound/soc/codecs/wm8993.c | 2 + sound/soc/codecs/wm8994.c | 3 ++ sound/soc/codecs/wm_hubs.c | 69 +++++++++++++++++++++++++++++-------------- sound/soc/codecs/wm_hubs.h | 3 ++ 4 files changed, 54 insertions(+), 23 deletions(-)
sound/soc/codecs/wm8993.c +2 -0
@@ -735,6 +735,7 @@ static int class_w_put(struct snd_kcontrol *kcontrol, 0); } wm8993->class_w_users++; + wm8993->hubs_data.class_w = true; }/* Implement the change */
@@ -751,6 +752,7 @@ static int class_w_put(struct snd_kcontrol *kcontrol, WM8993_CP_DYN_V); } wm8993->class_w_users--; + wm8993->hubs_data.class_w = false; } dev_dbg(codec->dev, "Indirect DAC use count now %d\n",
sound/soc/codecs/wm8994.c +3 -0
@@ -2228,6 +2228,7 @@ static int clk_sys_event(struct snd_soc_dapm_widget *w,static void wm8994_update_class_w (struct snd_soc_codec *codec) { +struct wm8994_priv *wm8994 =snd_soc_codec_get_drvdata (codec);int enable =1 ;int source =0 ;/* GCC flow analysis can't track enable */ int reg, reg_r;
@@ -2278,11 +2279,13 @@ static void wm8994_update_class_w(struct snd_soc_codec *codec)WM8994_CP_DYN_PWR |WM8994_CP_DYN_SRC_SEL_MASK , source | WM8994_CP_DYN_PWR); + wm8994->hubs.class_w = true; }else {dev_dbg (codec->dev,"Class W disabled\n" );snd_soc_update_bits (codec,WM8994_CLASS_W_1 ,WM8994_CP_DYN_PWR ,0 ); + wm8994->hubs.class_w = false; } }
sound/soc/codecs/wm_hubs.c +46 -23
99 lines not on this page · raw message
sound/soc/codecs/wm_hubs.h +3 -0
@@ -23,6 +23,9 @@ struct wm_hubs_data {int dcs_codes;int dcs_readback_mode;int hp_startup_mode; + +bool class_w; +u16 class_w_dcs; };extern int wm_hubs_add_analogue_controls (struct snd_soc_codec *);
Signature · 1 line
1.7.1
Quoted 13 lines · Mark Brown
Providing the analogue configuration of the output path remains the same the DC offset corrected by the DC servo will remain identical so we can skip the callibration, reducing the startup time for the headphone output. Implement this for the
wm_hubsdevices as has been done for several other CODECs.Don't do this if we have any analogue paths enabled since offsets may be being introduced by the analogue paths which could vary outside the control of the driver.
Signed-off-by Mark Brown <[email protected]>---
Quoted 8 lines
This change has not been tested yet but I'm sending it out for review now to accelerate the process.
sound/soc/codecs/wm8993.c | 2 + sound/soc/codecs/wm8994.c | 3 ++ sound/soc/codecs/wm_hubs.c | 69 +++++++++++++++++++++++++++++-------------- sound/soc/codecs/wm_hubs.h | 3 ++ 4 files changed, 54 insertions(+), 23 deletions(-)
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk