[alsa-devel] [PATCH 0/4] CS42L52 fixes.
Hi,
In the following emails, you will find the fixes I currently have for the CS42L52 driver.
The fixes are:
- Set both Master Volume A & B init value to 0x88 (otherwise left channel and right channel master volume would not be the same after init).
- Use IFACE_CTL2 register for Microphone Bias enum (IFACE_CTL1 is clearly not controling microphone bias according to the datasheet).
- Various controls would use a bogus shift value, resulting in only the high order bits being updated when changing them.
- The wrong mask was used when muting/unmuting the codec, resutling in the wrong part of the PB_CTL1 register being cleared, especially the headphone analog gain part.
All those patches are against the latest linus tree.
Regards,
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 0f6f481..6445d95 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -87,7 +87,7 @@ static const struct reg_default cs42l52_reg_defaults[] = { { CS42L52_BEEP_TONE_CTL, 0x00 }, /* r1E Beep Tone Cfg. */ { CS42L52_TONE_CTL, 0x00 }, /* r1F Tone Ctl */ { CS42L52_MASTERA_VOL, 0x88 }, /* r20 Master A Volume */ - { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */ + { CS42L52_MASTERB_VOL, 0x88 }, /* r21 Master B Volume */ { CS42L52_HPA_VOL, 0x00 }, /* r22 Headphone A Volume */ { CS42L52_HPB_VOL, 0x00 }, /* r23 Headphone B Volume */ { CS42L52_SPKA_VOL, 0x00 }, /* r24 Speaker A Volume */
On Wed, May 22, 2013 at 07:19:24PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Why?
- { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */
- { CS42L52_MASTERB_VOL, 0x88 }, /* r21 Master B Volume */
Note that the register defaults need to reflect the default value for the registers.
On May 22, 2013, at 8:34, "Mark Brown" broonie@kernel.org wrote:
On Wed, May 22, 2013 at 07:19:24PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Why?
- { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */
- { CS42L52_MASTERB_VOL, 0x88 }, /* r21 Master B Volume */
Note that the register defaults need to reflect the default value for the registers.
Your right Mark. I missed that. These registers should be default of 0x00.
Thanks
On 05/22/2013 08:34 PM, Mark Brown wrote:
On Wed, May 22, 2013 at 07:19:24PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Why?
- { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */
- { CS42L52_MASTERB_VOL, 0x88 }, /* r21 Master B Volume */
Note that the register defaults need to reflect the default value for the registers.
I was not aware of that, The solution would be then to fix MASTERB_VOL default value to 0x00 instead to 0x88. Shall I just send an updated version of the patch or the whole serie ?
Regards,
On Thu, May 23, 2013 at 03:17:24PM +0200, Nicolas Schichan wrote:
I was not aware of that, The solution would be then to fix MASTERB_VOL default value to 0x00 instead to 0x88. Shall I just send an updated version of the patch or the whole serie ?
Don't resend anything that's already been applied, just send things that are still being worked on.
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 6445d95..d2ee37d 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -225,7 +225,7 @@ static const char * const mic_bias_level_text[] = { };
static const struct soc_enum mic_bias_level_enum = - SOC_ENUM_SINGLE(CS42L52_IFACE_CTL1, 0, + SOC_ENUM_SINGLE(CS42L52_IFACE_CTL2, 0, ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text);
static const char * const cs42l52_mic_text[] = { "Single", "Differential" };
On Wed, May 22, 2013 at 07:19:25PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Applied, but please always CC maintainers on patches and use changelogs appropriate for the subsystem.
On 05/22/2013 08:38 PM, Mark Brown wrote:
On Wed, May 22, 2013 at 07:19:25PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Applied, but please always CC maintainers on patches and use changelogs appropriate for the subsystem.
Hi,
I Cc'ed only the maintainers reported by get_maintainers.pl (you are reported as 'supporter'), but I'll note to Cc you next time, sorry about that.
Regards,
On 05/23/2013 02:58 PM, Nicolas Schichan wrote:
On 05/22/2013 08:38 PM, Mark Brown wrote:
On Wed, May 22, 2013 at 07:19:25PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Applied, but please always CC maintainers on patches and use changelogs appropriate for the subsystem.
Hi,
I Cc'ed only the maintainers reported by get_maintainers.pl (you are reported as 'supporter'), but I'll note to Cc you next time, sorry about that.
A supporter is actually the more advanced version of a maintainer ;)
From MAINTAINERS:
Supported: Someone is actually paid to look after this. Maintained: Someone actually looks after it.
- Lars
On Thu, May 23, 2013 at 02:58:52PM +0200, Nicolas Schichan wrote:
I Cc'ed only the maintainers reported by get_maintainers.pl (you are reported as 'supporter'), but I'll note to Cc you next time, sorry about that.
A supporter is a maintianer who is employed.
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index d2ee37d..06c6025 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -413,7 +413,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = { SOC_ENUM("Headphone Analog Gain", hp_gain_enum),
SOC_DOUBLE_R_SX_TLV("Speaker Volume", CS42L52_SPKA_VOL, - CS42L52_SPKB_VOL, 7, 0x1, 0xff, hl_tlv), + CS42L52_SPKB_VOL, 0, 0x1, 0xff, hl_tlv),
SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL, CS42L52_PASSTHRUB_VOL, 6, 0x18, 0x90, pga_tlv), @@ -441,7 +441,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
SOC_DOUBLE_R_SX_TLV("PCM Mixer Volume", CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, - 6, 0x7f, 0x19, hl_tlv), + 0, 0x7f, 0x19, hl_tlv), SOC_DOUBLE_R("PCM Mixer Switch", CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, 7, 1, 1),
On Wed, May 22, 2013 at 07:19:26PM +0200, Nicolas Schichan wrote:
Signed-off-by: Nicolas Schichan nschichan@freebox.fr
Applied, thanks.
The mask should define the bits to change in the register, not the bits to preserve.
This fixes the inadvertent changes of the "Headphone Analog Gain" value during mute/unmute.
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.h b/sound/soc/codecs/cs42l52.h index 60985c0..4277012 100644 --- a/sound/soc/codecs/cs42l52.h +++ b/sound/soc/codecs/cs42l52.h @@ -157,7 +157,7 @@ #define CS42L52_PB_CTL1_INV_PCMA (1 << 2) #define CS42L52_PB_CTL1_MSTB_MUTE (1 << 1) #define CS42L52_PB_CTL1_MSTA_MUTE (1 << 0) -#define CS42L52_PB_CTL1_MUTE_MASK 0xFFFD +#define CS42L52_PB_CTL1_MUTE_MASK 0x03 #define CS42L52_PB_CTL1_MUTE 3 #define CS42L52_PB_CTL1_UNMUTE 0
On May 22, 2013, at 7:19, "Nicolas Schichan" nschichan@freebox.fr wrote:
Hi,
In the following emails, you will find the fixes I currently have for the CS42L52 driver.
The fixes are:
- Set both Master Volume A & B init value to 0x88 (otherwise left
channel and right channel master volume would not be the same after init).
- Use IFACE_CTL2 register for Microphone Bias enum (IFACE_CTL1 is
clearly not controling microphone bias according to the datasheet).
- Various controls would use a bogus shift value, resulting in only the
high order bits being updated when changing them.
- The wrong mask was used when muting/unmuting the codec, resutling in
the wrong part of the PB_CTL1 register being cleared, especially the headphone analog gain part.
All those patches are against the latest linus tree.
Regards,
-- Nicolas Schichan
Whole series Acked-by: Brian Austin brian.austin@cirrus.com
Thanks
participants (4)
-
Austin, Brian
-
Lars-Peter Clausen
-
Mark Brown
-
Nicolas Schichan