diff options
author | Derek Fang <derek.fang@realtek.com> | 2021-10-07 16:55:19 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-10-07 19:19:58 +0100 |
commit | 06096537b778c5cfe7618908fe9e55e817083d92 (patch) | |
tree | df79bf247ea69f5b5fd3ae4debac8ade1a128430 /sound/soc/codecs/rt5682s.h | |
parent | d8a15e5fcae132dc6a44847535ce355f6fba46f8 (diff) |
ASoC: rt5682s: Fix hp pop produced immediately after resuming
When the system plays a sound immediately after resuming from S3,
it could hear a little pop from headphones.
It is due to the HP was unmuted before the completion of
jack re-detection finished in parallel.
This patch adds a lock to make sure the HP unmute after jack detect handler,
and adds a few depop changes.
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211007085519.12543-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682s.h')
-rw-r--r-- | sound/soc/codecs/rt5682s.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5682s.h b/sound/soc/codecs/rt5682s.h index 59ba4ea3b062..1bf2ef7ce578 100644 --- a/sound/soc/codecs/rt5682s.h +++ b/sound/soc/codecs/rt5682s.h @@ -1366,6 +1366,11 @@ #define RT5682S_SAR_SOUR_BTN (0x3f) #define RT5682S_SAR_SOUR_TYPE (0x0) +/* Headphone Amp Detection Control 1 (0x3b00) */ +#define RT5682S_CP_SW_SIZE_MASK (0x7 << 4) +#define RT5682S_CP_SW_SIZE_L (0x4 << 4) +#define RT5682S_CP_SW_SIZE_M (0x2 << 4) +#define RT5682S_CP_SW_SIZE_S (0x1 << 4) #define RT5682S_STEREO_RATES SNDRV_PCM_RATE_8000_192000 #define RT5682S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ @@ -1441,6 +1446,7 @@ struct rt5682s_priv { struct delayed_work jd_check_work; struct mutex calibrate_mutex; struct mutex sar_mutex; + struct mutex jdet_mutex; #ifdef CONFIG_COMMON_CLK struct clk_hw dai_clks_hw[RT5682S_DAI_NUM_CLKS]; |