Hello, NXP
I have a custom board with imx6q and sgtl5000, but when the machine get into suspend or wake up or shutdown, the speaker had a "pop" noise. I had tried this: setting the DAC_MUTE_LEFT and DAC_MUTE_RIGHT bit in suspend function, and clear them in resume function, but it didn't works. Any advices? Thanks.
Best Regards,
bo xu
Hello, everyone
I solved this problem by closing the amplifier(TS4962)'s STBY pin before the system get into suspend, for letting the machine get into suspend we use commands like this "echo 'mem' > /sys/power/state" in the application layer.
The processes just like this:
echo 0 > /sys/class/gpio/gpio204/value (num 204 is the pin number of TS4962's STBY, before get into suspend)
echo "mem" > /sys/power/state (getting into suspend)
echo 1 > /sys/class/gpio/gpio204/value (in wakeup process)
And the pop-click noise has gone.
Hi bo
additionally one can consider decreasing volume as described in
sect.2.2.6 Volume Control AN3663 SGTL5000 Initialization and Programming
http://cache.freescale.com/files/analog/doc/app_note/AN3663.pdf
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov,
Thanks for your advice.I tried as section 2.2.6 told.but when i put the code in sgtl5000_suspend() like this:
static int sgtl5000_suspend(struct snd_soc_codec *codec)
{
// Configure ADC left and right analog volume to desired default.
snd_soc_write(codec, SGTL5000_CHIP_ANA_ADC_CTRL, 0x0000);
// LINEOUT and DAC volume control
snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_CTRL, 8, 0);
snd_soc_write(codec, SGTL5000_CHIP_DAC_VOL, 0x3c3c);
snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL, 2, 0);
snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL, 3, 0);
// Unmute ADC
snd_soc_update_bits(code, SGTL5000_CHIP_ANA_CTRL, 0, 0);
sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}
and rebuild the kernel for the machine. But the machine had no sound before i set it to suspend and when the machine got into suspend status, it can't wake up.Did i missed something?
Best Regards,
bo xu