ASoC: codecs: jz4725b: Various improvements and fixes
Subsystems (4)
PATCH 1/1 ASoC: codecs: jz4725b: Various improvements and fixes
The patch fixes:
- incorrectly represented dB values in alsamixer, et al.
- Line In path stays powered off during capturing or bypass to mixer.
The patch improves:
- Exposes all mixer inputs (both Mics, LineIn and DAC) with their gain controls.
- Exposes output stage (post mixer) gain control and makes it new Master playback gain, DAC gain was the previous master. However, no Master mute now.
Known issues:
- Bypass path enablement isn't applied immediately, for make things going bit clock needs to be triggered for a bit, e.g. by aplay dummy.wav
It might be a hardware bug, since the bit clock isn't declared as required for codec operation.
Tested on:
- Ritmix RZX-27 (jz4725b).
- Ritmix RZX-50 (jz4755).
--- sound/soc/codecs/jz4725b.c | 81 ++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 11 deletions(-)
sound/soc/codecs/jz4725b.c +70 -11
@@ -136,28 +136,80 @@ enum {#define REG_CGR3_GO1L_OFFSET 0#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR4_GO2R_OFFSET 0 +#define REG_CGR4_GO2R_MASK (0x1f << REG_CGR4_GO2R_OFFSET) + +#define REG_CGR5_GO2L_OFFSET 0 +#define REG_CGR5_GO2L_MASK (0x1f << REG_CGR5_GO2L_OFFSET) + +#define REG_CGR6_GO3R_OFFSET 0 +#define REG_CGR6_GO3R_MASK (0x1f << REG_CGR6_GO3R_OFFSET) + +#define REG_CGR7_GO3L_OFFSET 0 +#define REG_CGR7_GO3L_MASK (0x1f << REG_CGR7_GO3L_OFFSET) + +#define REG_CGR8_GOR_OFFSET 0 +#define REG_CGR8_GOR_MASK (0x1f << REG_CGR8_GOR_OFFSET) + +#define REG_CGR9_GOL_OFFSET 0 +#define REG_CGR9_GOL_MASK (0x1f << REG_CGR9_GOL_OFFSET) + +#define REG_CGR10_GIL_OFFSET 0 +#define REG_CGR10_GIR_OFFSET 4 +struct jz_icdc {struct regmap *regmap;void __iomem *base;struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0); -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_mix_tlv, + 0, 11, TLV_DB_SCALE_ITEM(-2250, 0, 0), + 12, 31, TLV_DB_SCALE_ITEM(-2250, 150, 0), +); + +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, + 0, 11, TLV_DB_SCALE_ITEM(-3350, 200, 0), + 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), + 24, 31, TLV_DB_SCALE_ITEM( 100, 50, 0), +);static const struct snd_kcontrol_new jz4725b_codec_controls[] = { -SOC_DOUBLE_TLV ("Master Playback Volume" , +SOC_DOUBLE_TLV ("DAC Playback Volume" ,JZ4725B_CODEC_REG_CGR1 ,REG_CGR1_GODL_OFFSET ,REG_CGR1_GODR_OFFSET ,0xf ,1 , jz4725b_dac_tlv), -SOC_DOUBLE_R_TLV ("Master Capture Volume" , +SOC_DOUBLE_TLV ("Master Capture Volume" , +JZ4725B_CODEC_REG_CGR10 , +REG_CGR10_GIL_OFFSET , +REG_CGR10_GIR_OFFSET , +0xf ,0 , jz4725b_adc_tlv), +SOC_DOUBLE_R_TLV ("Mixer Line In Bypass Playback Volume" ,JZ4725B_CODEC_REG_CGR3 ,JZ4725B_CODEC_REG_CGR2 ,REG_CGR2_GO1R_OFFSET , -0x1f ,1 , jz4725b_line_tlv), - -SOC_SINGLE ("Master Playback Switch" ,JZ4725B_CODEC_REG_CR1 , +0x1f ,1 , jz4725b_mix_tlv), +SOC_DOUBLE_R_TLV ("Mixer Mic 1 Bypass Playback Volume" , +JZ4725B_CODEC_REG_CGR5 , +JZ4725B_CODEC_REG_CGR4 , +REG_CGR4_GO2R_OFFSET , +0x1f ,1 , jz4725b_mix_tlv), +SOC_DOUBLE_R_TLV ("Mixer Mic 2 Bypass Playback Volume" , +JZ4725B_CODEC_REG_CGR7 , +JZ4725B_CODEC_REG_CGR6 , +REG_CGR6_GO3R_OFFSET , +0x1f ,1 , jz4725b_mix_tlv), + +SOC_DOUBLE_R_TLV ("Master Playback Volume" , +JZ4725B_CODEC_REG_CGR9 , +JZ4725B_CODEC_REG_CGR8 , +REG_CGR8_GOR_OFFSET , +0x1f ,1 , jz4725b_out_tlv), + +SOC_SINGLE ("DAC Playback Switch" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_DAC_MUTE_OFFSET ,1 ,1 ), SOC_SINGLE("Deemphasize Filter Playback Switch",
@@ -180,11 +232,15 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum, jz4725b_codec_adc_src_texts, jz4725b_codec_adc_src_values);static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = -SOC_DAPM_ENUM ("Route" , jz4725b_codec_adc_src_enum); +SOC_DAPM_ENUM ("ADC Source Capture Route" , jz4725b_codec_adc_src_enum);static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { -SOC_DAPM_SINGLE ("Line In Bypass" ,JZ4725B_CODEC_REG_CR1 , +SOC_DAPM_SINGLE ("Line In Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_BYPASS_OFFSET ,1 ,0 ), +SOC_DAPM_SINGLE ("Mic 1 Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR3 , +REG_CR3_SIDETONE1_OFFSET ,1 ,0 ), +SOC_DAPM_SINGLE ("Mic 2 Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR3 , +REG_CR3_SIDETONE2_OFFSET ,1 ,0 ), }; static int jz4725b_out_stage_enable(struct snd_soc_dapm_widget *w,
@@ -236,7 +292,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {SND_SOC_DAPM_MIXER ("DAC to Mixer" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_DACSEL_OFFSET ,0 ,NULL ,0 ), -SND_SOC_DAPM_MIXER ("Line In" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_MIXER ("Line In" ,JZ4725B_CODEC_REG_PMR1 , +REG_PMR1_SB_LIN_OFFSET ,1 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("HP Out" ,JZ4725B_CODEC_REG_CR1 , REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
@@ -278,7 +335,9 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Line In", NULL, "LLINEIN"}, {"Line In", NULL, "RLINEIN"}, - {"Mixer", "Line In Bypass", "Line In"}, + {"Mixer", "Mic 1 Bypass Playback Switch", "Mic 1"}, + {"Mixer", "Mic 2 Bypass Playback Switch", "Mic 2"}, + {"Mixer", "Line In Bypass Playback Switch", "Line In"}, {"DAC to Mixer", NULL, "DAC"}, {"Mixer", NULL, "DAC to Mixer"},
Signature · 1 line
2.36.1
Mark Brown
maintainerQuoted 12 lines · Siarhei Volkau
The patch fixes:
- incorrectly represented dB values in alsamixer, et al.
- Line In path stays powered off during capturing or bypass to mixer.The patch improves:
- Exposes all mixer inputs (both Mics, LineIn and DAC) with their gain controls.
- Exposes output stage (post mixer) gain control and makes it new Master playback gain, DAC gain was the previous master. However, no Master mute now.
Quoted 6 lines
Known issues:
- Bypass path enablement isn't applied immediately, for make things going bit clock needs to be triggered for a bit, e.g. by aplay dummy.wav
It might be a hardware bug, since the bit clock isn't declared as required for codec operation.
As covered in submitting-patches.rst this should really be split up into multiple patches, with one change per patch. This is especially the case here since you have a mix of fixes and new features which should be applied differently.
sound/soc/codecs/jz4725b.c enum { · line 191
Quoted 8 lines
sound/soc/codecs/jz4725b.c +6
-1- SOC_DOUBLE_R_TLV("Master Capture Volume", +SOC_DOUBLE_TLV ("Master Capture Volume" , +JZ4725B_CODEC_REG_CGR10 , +REG_CGR10_GIL_OFFSET , +REG_CGR10_GIR_OFFSET , +0xf ,0 , jz4725b_adc_tlv), + SOC_DOUBLE_R_TLV("Mixer Line In Bypass Playback Volume", JZ4725B_CODEC_REG_CGR3,
This doesn't appear to correspond to what your patch description said and will presumably cause problems for any existing configurations...
пн, 10 окт. 2022 г. в 14:19, Mark Brown <[email protected]>:
Quoted 4 lines
As covered in
submitting-patches.rstthis should really be split up into multiple patches, with one change per patch. This is especially the case here since you have a mix of fixes and new features which should be applied differently.
Got it, will rework.
Quoted 10 lines
sound/soc/codecs/jz4725b.c enum { · line 191
Quoted 8 lines
sound/soc/codecs/jz4725b.c +6
-1- SOC_DOUBLE_R_TLV("Master Capture Volume", +SOC_DOUBLE_TLV ("Master Capture Volume" , +JZ4725B_CODEC_REG_CGR10 , +REG_CGR10_GIL_OFFSET , +REG_CGR10_GIR_OFFSET , +0xf ,0 , jz4725b_adc_tlv), + SOC_DOUBLE_R_TLV("Mixer Line In Bypass Playback Volume", JZ4725B_CODEC_REG_CGR3,This doesn't appear to correspond to what your patch description said
I forgot to mention that in the description, thanks.
Quoted 1 line
and will presumably cause problems for any existing configurations...
I'm curious why this didn't cause problems earlier, as the wrong control was used
for the Master Capture Volume.
Mark Brown
maintainerQuoted 7 lines · Siarhei Volkau
пн, 10 окт. 2022 г. в 14:19, Mark Brown <[email protected]>:
Quoted 1 line
and will presumably cause problems for any existing configurations...
I'm curious why this didn't cause problems earlier, as the wrong control was used
for the Master Capture Volume.
The issue is that if someone is relying on the current behaviour and the control starts doing something completely different they might be surprised, it at least needs a separate change.
пн, 10 окт. 2022 г. в 18:53, Mark Brown <[email protected]>:
Quoted 3 lines
The issue is that if someone is relying on the current behaviour and the control starts doing something completely different they might be surprised, it at least needs a separate change.
At the moment there's only one consumer for the codec in the mainline kernel Its RetroMini RS-90 and it doesn't seem to have capture capabilities.
v2 cover ASoC: codecs: jz4725b: Various improvements and fixes
In reply to Mark BrownThe patchset fixes:
- Line In path stays powered off during capturing or bypass to mixer.
- incorrectly represented dB values in alsamixer, et al.
- incorrect represented Capture input selector in alsamixer in Playback tab.
- wrong control selected as Capture Master
The patchset improves:
- Exposes output stage (post mixer) gain control and makes it new Master playback gain, DAC gain was the previous master. However, no Master mute now.
- Exposes all mixer inputs (both Mics, LineIn and DAC) with their gain controls.
Known issues:
- Bypass path enablement isn't applied immediately, for make things going bit clock needs to be triggered for a bit, e.g. by aplay dummy.wav
It might be a hardware bug, since the bit clock isn't declared as required for codec operation.
Tested on:
- Ritmix RZX-27 (jz4725b).
- Ritmix RZX-50 (jz4755).
Diff from v1:
- each change in a separate patch
Siarhei Volkau (6):
ASoC: codecs: jz4725b: add missed Line In power control bit
ASoC: codecs: jz4725b: fix reported volume for Master ctl
ASoC: codecs: jz4725b: use right control for Capture Volume
ASoC: codecs: jz4725b: fix capture selector naming
ASoC: codecs: jz4725b: use right control for Master Playback
ASoC: codecs: jz4725b: add missed Mixer inputs
sound/soc/codecs/jz4725b.c | 81 ++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 11 deletions(-)
Signature · 1 line
2.36.1
PATCH v2 1/6 ASoC: codecs: jz4725b: add missed Line In power control bit
Line In path stayed powered off during capturing or bypass to mixer.
--- sound/soc/codecs/jz4725b.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +2 -1
@@ -236,7 +236,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {SND_SOC_DAPM_MIXER ("DAC to Mixer" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_DACSEL_OFFSET ,0 ,NULL ,0 ), -SND_SOC_DAPM_MIXER ("Line In" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_MIXER ("Line In" ,JZ4725B_CODEC_REG_PMR1 , +REG_PMR1_SB_LIN_OFFSET ,1 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("HP Out" ,JZ4725B_CODEC_REG_CR1 , REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
Signature · 1 line
2.36.1
PATCH v2 2/6 ASoC: codecs: jz4725b: fix reported volume for Master ctl
In reply to Siarhei VolkauDAC volume control is the Master Playback Volume at the moment and it reports wrong levels in alsamixer and other alsa apps.
The patch fixes that, as stated in manual on the jz4725b SoC (16.6.3.4 Programmable attenuation: GOD) the ctl range varies from -22.5dB to 0dB with 1.5dB step.
--- sound/soc/codecs/jz4725b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +1 -1
@@ -142,8 +142,8 @@ struct jz_icdc {struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_DOUBLE_TLV("Master Playback Volume",
Signature · 1 line
2.36.1
PATCH v2 3/6 ASoC: codecs: jz4725b: use right control for Capture Volume
In reply to Siarhei VolkauLine In Bypass control is used as Master Capture at the moment this is completely incorrect.
Current control routed to Mixer instead of ADC, thus can't affect Capture path. ADC control shall be used instead.
ADC volume control parameters are different, so the patch fixes that as well. Manual says (16.6.3.2 Programmable input attenuation amplifier:
PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step.
--- sound/soc/codecs/jz4725b.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
sound/soc/codecs/jz4725b.c +9 -6
@@ -136,13 +136,16 @@ enum {#define REG_CGR3_GO1L_OFFSET 0#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR10_GIL_OFFSET 0 +#define REG_CGR10_GIR_OFFSET 4 +struct jz_icdc {struct regmap *regmap;void __iomem *base;struct clk *clk; }; -static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
@@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR1_GODL_OFFSET, REG_CGR1_GODR_OFFSET, 0xf, 1, jz4725b_dac_tlv), -SOC_DOUBLE_R_TLV ("Master Capture Volume" , -JZ4725B_CODEC_REG_CGR3 , -JZ4725B_CODEC_REG_CGR2 , -REG_CGR2_GO1R_OFFSET , -0x1f ,1 , jz4725b_line_tlv), +SOC_DOUBLE_TLV ("Master Capture Volume" , +JZ4725B_CODEC_REG_CGR10 , +REG_CGR10_GIL_OFFSET , +REG_CGR10_GIR_OFFSET , +0xf ,0 , jz4725b_adc_tlv),SOC_SINGLE ("Master Playback Switch" ,JZ4725B_CODEC_REG_CR1 , REG_CR1_DAC_MUTE_OFFSET, 1, 1),
Signature · 1 line
2.36.1
PATCH v2 4/6 ASoC: codecs: jz4725b: fix capture selector naming
In reply to Siarhei VolkauAt the moment Capture source selector appears on Playback tab in the alsamixer and has a senseless name.
Let's fix that.
--- sound/soc/codecs/jz4725b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/jz4725b.c +1 -1
@@ -183,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum, jz4725b_codec_adc_src_texts, jz4725b_codec_adc_src_values);static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = -SOC_DAPM_ENUM ("Route" , jz4725b_codec_adc_src_enum); +SOC_DAPM_ENUM ("ADC Source Capture Route" , jz4725b_codec_adc_src_enum);static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1,
Signature · 1 line
2.36.1
PATCH v2 5/6 ASoC: codecs: jz4725b: use right control for Master Playback
In reply to Siarhei VolkauAt the moment DAC control is used as Master Playback control, this is incorrect as DAC's output goes to a Mixer.
The Mixer couples analog input from 4 sources (DAC, Line In, Mic 1,
Mic 2) each input has its own gain & mute controls.
Output of the Mixer goes to Output Stage control which is the best suite for the new Playback Master. However, it doesn't have mute capability.
The patch implements Output Stage control as a new master and renames old Master to DAC. Rest of mixer inputs will be implemented in the next patch in the series.
Manual states that Output stage control (16.6.3.5 Programmable output
amplifier: PGAT) gain varies from -33.5dB to +4.5dB, gain step isn't fixed and has 3 opts.
--- sound/soc/codecs/jz4725b.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
sound/soc/codecs/jz4725b.c +19 -2
@@ -136,6 +136,12 @@ enum {#define REG_CGR3_GO1L_OFFSET 0#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR8_GOR_OFFSET 0 +#define REG_CGR8_GOR_MASK (0x1f << REG_CGR8_GOR_OFFSET) + +#define REG_CGR9_GOL_OFFSET 0 +#define REG_CGR9_GOL_MASK (0x1f << REG_CGR9_GOL_OFFSET) +#define REG_CGR10_GIL_OFFSET 0#define REG_CGR10_GIR_OFFSET 4
@@ -147,9 +153,14 @@ struct jz_icdc { static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, + 0, 11, TLV_DB_SCALE_ITEM(-3350, 200, 0), + 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), + 24, 31, TLV_DB_SCALE_ITEM( 100, 50, 0), +); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { - SOC_DOUBLE_TLV("Master Playback Volume", + SOC_DOUBLE_TLV("DAC Playback Volume", JZ4725B_CODEC_REG_CGR1, REG_CGR1_GODL_OFFSET, REG_CGR1_GODR_OFFSET,
@@ -160,7 +171,13 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR10_GIR_OFFSET, 0xf, 0, jz4725b_adc_tlv), -SOC_SINGLE ("Master Playback Switch" ,JZ4725B_CODEC_REG_CR1 , +SOC_DOUBLE_R_TLV ("Master Playback Volume" , +JZ4725B_CODEC_REG_CGR9 , +JZ4725B_CODEC_REG_CGR8 , +REG_CGR8_GOR_OFFSET , +0x1f ,1 , jz4725b_out_tlv), + +SOC_SINGLE ("DAC Playback Switch" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_DAC_MUTE_OFFSET ,1 ,1 ), SOC_SINGLE("Deemphasize Filter Playback Switch",
Signature · 1 line
2.36.1
PATCH v2 6/6 ASoC: codecs: jz4725b: add missed Mixer inputs
In reply to Siarhei VolkauThe Mixer couples analog input from 4 sources (DAC, Line In, Mic 1,
Mic 2) each input has its own gain & mute controls.
At the moment only DAC is implemented fully and Line In path can be switched on/off. The patch implements Mic 1 and Mic 2 paths and fully implements Line In path.
Manual states that these controls (16.6.3.3 Programmable attenuation:
GOi) gain varies from -22.5dB to +6.0dB with 1.5dB step. Also there's extra values below the minimum, but they behave the same as the minimum value.
--- sound/soc/codecs/jz4725b.c | 42 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-)
sound/soc/codecs/jz4725b.c +40 -2
@@ -136,6 +136,18 @@ enum {#define REG_CGR3_GO1L_OFFSET 0#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) +#define REG_CGR4_GO2R_OFFSET 0 +#define REG_CGR4_GO2R_MASK (0x1f << REG_CGR4_GO2R_OFFSET) + +#define REG_CGR5_GO2L_OFFSET 0 +#define REG_CGR5_GO2L_MASK (0x1f << REG_CGR5_GO2L_OFFSET) + +#define REG_CGR6_GO3R_OFFSET 0 +#define REG_CGR6_GO3R_MASK (0x1f << REG_CGR6_GO3R_OFFSET) + +#define REG_CGR7_GO3L_OFFSET 0 +#define REG_CGR7_GO3L_MASK (0x1f << REG_CGR7_GO3L_OFFSET) +#define REG_CGR8_GOR_OFFSET 0#define REG_CGR8_GOR_MASK (0x1f << REG_CGR8_GOR_OFFSET)
@@ -153,6 +165,11 @@ struct jz_icdc { static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_mix_tlv, +0 ,11 ,TLV_DB_SCALE_ITEM (-2250 ,0 ,0 ), + 12, 31, TLV_DB_SCALE_ITEM(-2250, 150, 0), +); + static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv,0 ,11 ,TLV_DB_SCALE_ITEM (-3350 ,200 ,0 ), 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0),
@@ -170,6 +187,21 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { REG_CGR10_GIL_OFFSET, REG_CGR10_GIR_OFFSET, 0xf, 0, jz4725b_adc_tlv), +SOC_DOUBLE_R_TLV ("Mixer Line In Bypass Playback Volume" , +JZ4725B_CODEC_REG_CGR3 , +JZ4725B_CODEC_REG_CGR2 , +REG_CGR2_GO1R_OFFSET , +0x1f ,1 , jz4725b_mix_tlv), +SOC_DOUBLE_R_TLV ("Mixer Mic 1 Bypass Playback Volume" , +JZ4725B_CODEC_REG_CGR5 , +JZ4725B_CODEC_REG_CGR4 , +REG_CGR4_GO2R_OFFSET , +0x1f ,1 , jz4725b_mix_tlv), +SOC_DOUBLE_R_TLV ("Mixer Mic 2 Bypass Playback Volume" , +JZ4725B_CODEC_REG_CGR7 , +JZ4725B_CODEC_REG_CGR6 , +REG_CGR6_GO3R_OFFSET , +0x1f ,1 , jz4725b_mix_tlv), SOC_DOUBLE_R_TLV("Master Playback Volume", JZ4725B_CODEC_REG_CGR9,
@@ -203,8 +235,12 @@ static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl =SOC_DAPM_ENUM ("ADC Source Capture Route" , jz4725b_codec_adc_src_enum);static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { -SOC_DAPM_SINGLE ("Line In Bypass" ,JZ4725B_CODEC_REG_CR1 , +SOC_DAPM_SINGLE ("Line In Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR1 ,REG_CR1_BYPASS_OFFSET ,1 ,0 ), +SOC_DAPM_SINGLE ("Mic 1 Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR3 , +REG_CR3_SIDETONE1_OFFSET ,1 ,0 ), +SOC_DAPM_SINGLE ("Mic 2 Bypass Playback Switch" ,JZ4725B_CODEC_REG_CR3 , +REG_CR3_SIDETONE2_OFFSET ,1 ,0 ), }; static int jz4725b_out_stage_enable(struct snd_soc_dapm_widget *w,
@@ -299,7 +335,9 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = { {"Line In", NULL, "LLINEIN"}, {"Line In", NULL, "RLINEIN"}, - {"Mixer", "Line In Bypass", "Line In"}, + {"Mixer", "Mic 1 Bypass Playback Switch", "Mic 1"}, + {"Mixer", "Mic 2 Bypass Playback Switch", "Mic 2"}, + {"Mixer", "Line In Bypass Playback Switch", "Line In"}, {"DAC to Mixer", NULL, "DAC"}, {"Mixer", NULL, "DAC to Mixer"},
Signature · 1 line
2.36.1
Mark Brown
maintainerQuoted 9 lines · Siarhei Volkau
The patchset fixes:
- Line In path stays powered off during capturing or bypass to mixer.
- incorrectly represented dB values in alsamixer, et al.
- incorrect represented Capture input selector in alsamixer in Playback tab.
- wrong control selected as Capture Master[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/6] ASoC: codecs: jz4725b: add missed Line In power control bit
commit: 1013999b431b4bcdc1f5ae47dd3338122751db31
[2/6] ASoC: codecs: jz4725b: fix reported volume for Master ctl
commit: 088777bf65b98cfa4b5378119d0a7d49a58ece44
[3/6] ASoC: codecs: jz4725b: use right control for Capture Volume
commit: 1538e2c8c9b7e7a656effcc6e4e7cfe8c1b405fd
[4/6] ASoC: codecs: jz4725b: fix capture selector naming
commit: 80852f8268769715db335a22305e81a0c4a38a84
[5/6] ASoC: codecs: jz4725b: use right control for Master Playback
commit: e6233ee25059de0eeac6ed3d9d49737afdbd5087
[6/6] ASoC: codecs: jz4725b: add missed Mixer inputs
commit: 616c291820d155cbad258ecae5c7dbca2c01f07fAll 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