History log of /linux-master/sound/soc/codecs/sgtl5000.h
Revision Date Author Comments
# bf2aebcc 23-Jun-2022 Francesco Dolcini <francesco.dolcini@toradex.com>

ASoC: sgtl5000: Fix noise on shutdown/remove

Put the SGTL5000 in a silent/safe state on shutdown/remove, this is
required since the SGTL5000 produces a constant noise on its output
after it is configured and its clock is removed. Without this change
this is happening every time the module is unbound/removed or from
reboot till the clock is enabled again.

The issue was experienced on both a Toradex Colibri/Apalis iMX6, but can
be easily reproduced everywhere just playing something on the codec and
after that removing/unbinding the driver.

Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220624101301.441314-1-francesco.dolcini@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 040e3360 23-Jun-2022 Francesco Dolcini <francesco.dolcini@toradex.com>

ASoC: sgtl5000: Fix noise on shutdown/remove

Put the SGTL5000 in a silent/safe state on shutdown/remove, this is
required since the SGTL5000 produces a constant noise on its output
after it is configured and its clock is removed. Without this change
this is happening every time the module is unbound/removed or from
reboot till the clock is enabled again.

The issue was experienced on both a Toradex Colibri/Apalis iMX6, but can
be easily reproduced everywhere just playing something on the codec and
after that removing/unbinding the driver.

Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220624101301.441314-1-francesco.dolcini@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# aa781273 14-Apr-2020 Sebastian Reichel <sebastian.reichel@collabora.com>

ASoC: sgtl5000: Fix VAG power-on handling

As mentioned slightly out of patch context in the code, there
is no reset routine for the chip. On boards where the chip is
supplied by a fixed regulator, it might not even be resetted
during (e.g. watchdog) reboot and can be in any state.

If the device is probed with VAG enabled, the driver's probe
routine will generate a loud pop sound when ANA_POWER is
being programmed. Avoid this by properly disabling just the
VAG bit and waiting the required power down time.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Fabio Estevam <festivem@gmail.com>
Link: https://lore.kernel.org/r/20200414181140.145825-1-sebastian.reichel@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# cadee10c 19-Jul-2019 Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

ASoC: sgtl5000: Fix definition of VAG Ramp Control

SGTL5000_SMALL_POP is a bit mask, not a value. Usage of
correct definition makes device probing code more clear.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20190719100524.23300-4-oleksandr.suvorov@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3c1d663b 22-Apr-2018 Fabio Estevam <fabio.estevam@nxp.com>

ASoC: sgtl5000: Switch to SPDX identifier

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 92a2742f 19-Feb-2018 Michal Oleszczyk <oleszczyk.m@gmail.com>

ASoC: sgtl5000: add 5 band graphic equalizer

Enable 5-band graphic equalizer which allows manipulation of
gain in range -11.75dB to 12dB for 5 specific sound bands:
115Hz, 330Hz, 990Hz, 3000Hz, 9900Hz.

Signed-off-by: Michal Oleszczyk <oleszczyk.m@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 08dea16e 06-Jun-2016 Eric Nelson <eric@nelint.com>

ASoC: sgtl5000: Disable internal PLL early

To handle the soft reboot case, the internal PLL must be
disabled in SGTL5000_CHIP_CLK_CTRL before clearing bits
SGTL5000_VCOAMP_POWERUP and SGTL5000_PLL_POWERUP in
register SGTL5000_CHIP_ANA_POWER.

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3d632cc8 06-Jun-2016 Eric Nelson <eric@nelint.com>

ASoC: sgtl5000: Initialize CHIP_ANA_POWER to power-on defaults

Initialize CHIP_ANA_POWER to match power on defaults, which disables
ADC, DAC, and charge pumps.

In the process, remove references to the following register/bitfields
from the sgtl5000_set_power_regs routine:
CHIP_ANA_POWER/LINREG_SIMPLE_POWERUP and
CHIP_LINREG_CTRL/LINREG_VDD_MASK

And remove CHIP_ANA_POWER and CHIP_LINREG_CTRL from the set of default
registers so they don't get clobbered by sgtl5000_fill_defaults().

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b101acfa 21-Jul-2015 Axel Lin <axel.lin@ingics.com>

ASoC: sgtl5000: Fix up define for SGTL5000_SMALL_POP

Currently, below code actually does not update any bit because
SGTL5000_SMALL_POP is 0.

snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL, SGTL5000_SMALL_POP, 1);

The SGTL5000_SMALL_POP should be BIT(0) rather than 0, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-By: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c251ea7b 13-Nov-2014 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: sgtl5000: Fix SMALL_POP bit definition

On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound to happen
5 seconds after the end of a playback.

The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
bit 1.

Fix the definition accordingly and enable the bit as intended per the code
comment.

After applying this change, no loud 'click' sound is heard after playback

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org


# 5c78dfe8 04-Jul-2013 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: sglt5000: Fix SGTL5000_PLL_FRAC_DIV_MASK

SGTL5000_PLL_FRAC_DIV_MASK is used to mask bits 0-10 (11 bits in total) of
register CHIP_PLL_CTRL, so fix the mask to accomodate all this bit range.

Reported-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org


# 271f193d 03-May-2013 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: sgtl5000: Fix comment about register addresses

The list below the comment relates to sgtl5000 registers addresses, so change
the comment to improve the description.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 56c09aa5 18-Oct-2011 Axel Lin <axel.lin@gmail.com>

ASoC: sgtl5000: Fix define for SGTL5000_BIAS_R_MASK

According to the datasheet:
CHIP_MIC_CTRL 0x002A

BITS[9:8] BIAS_RESISTOR
0x0 = Powerd off
0x1 = 2.0 kohm
0x2 = 4.0 kohm
0x3 = 8.0 kohm

Thus SGTL5000_BIAS_R_MASK should be defined as 0x0300 instead of 0x0200.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5f83df9a 27-Feb-2011 Zeng Zhaoming <b32542@freescale.com>

ASoC: remove unnecessary header including in SGTL5000 codec driver

Remove unnecessary headers:
- mach/hardware.h in sgtl5000.c
- linux/i2c.h in sgtl5000.h

Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9b34e6cc 23-Feb-2011 Zeng Zhaoming <zhaoming.zeng@freescale.com>

ASoC: Add Freescale SGTL5000 codec support

Add Freescale SGTL5000 codec support.
Supported features:
- line-in and mic input
- headphone and line-out output
- line-in bypass ADC and DAC to headphone
- 16, 20, 24, 32 bit audio
- 8 ~ 96k sample rates

Signed-off-by: Zeng Zhaoming <zhaoming.zeng@freescale.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>