ASoC: codecs: Fix more control definitions that write another control's bits
Subsystems (3)
cover ASoC: codecs: Fix more control definitions that write another control's bits
These are the last fixes found by the overlap scan from the first series [1]. In sta32x and sta350 a 4-bit field has a maximum of 16, so the control also writes the bit above it. In tlv320aic32x4 a TAS2505 control uses the wrong register.
[1] https://lore.kernel.org/all/[email protected]/
HyeongJun An (3):
ASoC: codecs: sta32x: Fix definition of limiter threshold controls
ASoC: codecs: sta350: Fix definition of limiter threshold controls
ASoC: tlv320aic32x4: Fix definition of TAS2505 HP Driver Gain Volume
control
sound/soc/codecs/sta32x.c | 16 ++++++++-------- sound/soc/codecs/sta350.c | 16 ++++++++-------- sound/soc/codecs/tlv320aic32x4.c | 2 +- sound/soc/codecs/tlv320aic32x4.h | 1 + 4 files changed, 18 insertions(+), 17 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/3 ASoC: codecs: sta32x: Fix definition of limiter threshold controls
The limiter attack and release thresholds are the two 4-bit halves of one register, so their maximum is 15, not 16. With 16 the controls on bits 3:0 also write bit 4, which belongs to the other threshold.
--- sound/soc/codecs/sta32x.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
sound/soc/codecs/sta32x.c +8 -8
@@ -507,21 +507,21 @@ SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta32x_limiter2_release_rate_enum),* two different enum definitions; provide both */ SOC_SINGLE_TLV ("Limiter1 Attack Threshold (AC Mode)" ,STA32X_L1ATRT , STA32X_LxA_SHIFT, -16 ,0 , sta32x_limiter_ac_attack_tlv), +15 ,0 , sta32x_limiter_ac_attack_tlv),SOC_SINGLE_TLV ("Limiter2 Attack Threshold (AC Mode)" ,STA32X_L2ATRT , STA32X_LxA_SHIFT, -16 ,0 , sta32x_limiter_ac_attack_tlv), +15 ,0 , sta32x_limiter_ac_attack_tlv),SOC_SINGLE_TLV ("Limiter1 Release Threshold (AC Mode)" ,STA32X_L1ATRT , STA32X_LxR_SHIFT, -16 ,0 , sta32x_limiter_ac_release_tlv), +15 ,0 , sta32x_limiter_ac_release_tlv),SOC_SINGLE_TLV ("Limiter2 Release Threshold (AC Mode)" ,STA32X_L2ATRT , STA32X_LxR_SHIFT, -16 ,0 , sta32x_limiter_ac_release_tlv), +15 ,0 , sta32x_limiter_ac_release_tlv),SOC_SINGLE_TLV ("Limiter1 Attack Threshold (DRC Mode)" ,STA32X_L1ATRT , STA32X_LxA_SHIFT, -16 ,0 , sta32x_limiter_drc_attack_tlv), +15 ,0 , sta32x_limiter_drc_attack_tlv),SOC_SINGLE_TLV ("Limiter2 Attack Threshold (DRC Mode)" ,STA32X_L2ATRT , STA32X_LxA_SHIFT, -16 ,0 , sta32x_limiter_drc_attack_tlv), +15 ,0 , sta32x_limiter_drc_attack_tlv),SOC_SINGLE_TLV ("Limiter1 Release Threshold (DRC Mode)" ,STA32X_L1ATRT , STA32X_LxR_SHIFT, -16 ,0 , sta32x_limiter_drc_release_tlv), +15 ,0 , sta32x_limiter_drc_release_tlv),SOC_SINGLE_TLV ("Limiter2 Release Threshold (DRC Mode)" ,STA32X_L2ATRT , STA32X_LxR_SHIFT, -16 ,0 , sta32x_limiter_drc_release_tlv), +15 ,0 , sta32x_limiter_drc_release_tlv),BIQUAD_COEFS ("Ch1 - Biquad 1" ,0 ), BIQUAD_COEFS("Ch1 - Biquad 2", 5),
Signature · 1 line
2.43.0
PATCH 2/3 ASoC: codecs: sta350: Fix definition of limiter threshold controls
In reply to HyeongJun AnThe limiter attack and release thresholds are the two 4-bit halves of one register, so their maximum is 15, not 16. With 16 the controls on bits 3:0 also write bit 4, which belongs to the other threshold.
--- sound/soc/codecs/sta350.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
sound/soc/codecs/sta350.c +8 -8
@@ -502,28 +502,28 @@ SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta350_limiter2_release_rate_enum),*/ SOC_SINGLE_TLV ("Limiter1 Attack Threshold (AC Mode)" ,STA350_L1ATRT , STA350_LxA_SHIFT, -16 ,0 , sta350_limiter_ac_attack_tlv), +15 ,0 , sta350_limiter_ac_attack_tlv),SOC_SINGLE_TLV ("Limiter2 Attack Threshold (AC Mode)" ,STA350_L2ATRT , STA350_LxA_SHIFT, -16 ,0 , sta350_limiter_ac_attack_tlv), +15 ,0 , sta350_limiter_ac_attack_tlv),SOC_SINGLE_TLV ("Limiter1 Release Threshold (AC Mode)" ,STA350_L1ATRT , STA350_LxR_SHIFT, -16 ,0 , sta350_limiter_ac_release_tlv), +15 ,0 , sta350_limiter_ac_release_tlv),SOC_SINGLE_TLV ("Limiter2 Release Threshold (AC Mode)" ,STA350_L2ATRT , STA350_LxR_SHIFT, -16 ,0 , sta350_limiter_ac_release_tlv), +15 ,0 , sta350_limiter_ac_release_tlv),SOC_SINGLE_TLV ("Limiter1 Attack Threshold (DRC Mode)" ,STA350_L1ATRT , STA350_LxA_SHIFT, -16 ,0 , sta350_limiter_drc_attack_tlv), +15 ,0 , sta350_limiter_drc_attack_tlv),SOC_SINGLE_TLV ("Limiter2 Attack Threshold (DRC Mode)" ,STA350_L2ATRT , STA350_LxA_SHIFT, -16 ,0 , sta350_limiter_drc_attack_tlv), +15 ,0 , sta350_limiter_drc_attack_tlv),SOC_SINGLE_TLV ("Limiter1 Release Threshold (DRC Mode)" ,STA350_L1ATRT , STA350_LxR_SHIFT, -16 ,0 , sta350_limiter_drc_release_tlv), +15 ,0 , sta350_limiter_drc_release_tlv),SOC_SINGLE_TLV ("Limiter2 Release Threshold (DRC Mode)" ,STA350_L2ATRT , STA350_LxR_SHIFT, -16 ,0 , sta350_limiter_drc_release_tlv), +15 ,0 , sta350_limiter_drc_release_tlv),BIQUAD_COEFS ("Ch1 - Biquad 1" ,0 ), BIQUAD_COEFS("Ch1 - Biquad 2", 5),
Signature · 1 line
2.43.0
PATCH 3/3 ASoC: tlv320aic32x4: Fix definition of TAS2505 HP Driver Gain Volume control
In reply to HyeongJun AnThe TAS2505 HP volume is bits 6:0 of page 1 register 22, not of register 16, which holds the HP driver mute (bit 6) and gain (bits 5:0).
--- sound/soc/codecs/tlv320aic32x4.c | 2 +- sound/soc/codecs/tlv320aic32x4.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/tlv320aic32x4.c +1 -1
@@ -1057,7 +1057,7 @@ static const struct snd_kcontrol_new aic32x4_tas2505_snd_controls[] = {SOC_ENUM ("DAC Playback PowerTune Switch" , l_ptm_enum),SOC_SINGLE_TLV ("HP Driver Gain Volume" , -AIC32X4_HPLGAIN ,0 ,0x74 ,1 , tlv_tas_driver_gain), +TAS2505_HPVOL ,0 ,0x74 ,1 , tlv_tas_driver_gain),SOC_SINGLE ("HP DAC Playback Switch" ,AIC32X4_HPLGAIN ,6 ,1 ,1 ), SOC_SINGLE_TLV("Speaker Driver Playback Volume",
sound/soc/codecs/tlv320aic32x4.h +1 -0
@@ -94,6 +94,7 @@ int aic32x4_register_clocks(struct device *dev, const char *mclk_name);#define AIC32X4_LOLGAIN AIC32X4_REG(1, 18)#define AIC32X4_LORGAIN AIC32X4_REG(1, 19)#define AIC32X4_HEADSTART AIC32X4_REG(1, 20) +#define TAS2505_HPVOL AIC32X4_REG(1, 22)#define TAS2505_SPK AIC32X4_REG(1, 45)#define TAS2505_SPKVOL1 AIC32X4_REG(1, 46)#define TAS2505_SPKVOL2 AIC32X4_REG(1, 48)
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 8 lines · HyeongJun An
ASoC: codecs: Fix more control definitions that write another control's bits
These are the last fixes found by the overlap scan from the first series [1]. In sta32x and sta350 a 4-bit field has a maximum of 16, so the control also writes the bit above it. In tlv320aic32x4 a TAS2505 control uses the wrong register.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/3] ASoC: codecs: sta32x: Fix definition of limiter threshold controls
https://git.kernel.org/broonie/sound/c/e06bf60ee5bf [2/3] ASoC: codecs: sta350: Fix definition of limiter threshold controls https://git.kernel.org/broonie/sound/c/77623752c156 [3/3] ASoC: tlv320aic32x4: Fix definition of TAS2505 HP Driver Gain Volume control https://git.kernel.org/broonie/sound/c/f28c09b7e62f
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark