summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/sgtl5000.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-04-22 22:22:34 +0200
committerArnd Bergmann <arnd@arndb.de>2012-04-22 22:28:48 +0200
commit6540afeae0c66c99c24d43446dab90836170a4e6 (patch)
tree9d4ed5065c9ad95ad8bc4a26a6f5924e83019acd /sound/soc/codecs/sgtl5000.c
parent17d2f847e6aa1181024cb881fdc6cbad18f11b04 (diff)
parent39ecc143b4c1f3d42e8300e7f5274681b99f95c2 (diff)
Merge tag 'at91-3.5-cleanup' of git://github.com/at91linux/linux-at91 into next/cleanup
Nicolas Ferre <nicolas.ferre@atmel.com> writes: First batch of AT91 cleanup for 3.5 kernel. - The biggest improvement of this series is the ability to compile several AT91 SoCs in one kernel image. For now on it's limited to the DT-enabled boards but we can compile all the core together. - The Kconfig series is stacked before other patches as it is simple and non-intrusive. Its goal is to remove too restrictive dependencies on SoC names. This will allow to add support for newer SoC seamlessly. - Some very "cosmetic" Kconfig changes are also added (entry names, comments, etc.). * tag 'at91-3.5-cleanup' of git://github.com/at91linux/linux-at91: (19 commits) ARM: at91: add defconfig for device tree ARM: at91/dt: do not specify the board any more ARN: at91: introduce SOC_AT91xxx define to allow to compile SoC core support ARM: at91: add SOC_AT91SAM9 kconfig option to factorise select ARM: at91: pm select memory controler at runtime ARM: at91: move at91_init_leds to board init ARM: at91: do not pin mux the UARTs in init_early ARM: at91: drop at91_set_serial_console ARM: at91: uncompress: autodetect the uart to use ARM: at91: uncompress Store UART address in a variable hwrng: Kconfig: remove dependency for atmel-rng driver Input: Kconfig: remove dependency for atmel_tsadcc driver rtc: Kconfig: remove dependency for AT91 rtc driver ARM: at91/Kconfig: website link for AT91SAM9G20-EK ARM: at91/Kconfig: add AT91SAM9x5 family to AT91_EARLY_DBGU0 entry ARM: at91/Kconfig: add clarifications to AT91SAM9M10G45-EK entry ARM: at91/Kconfig: add comment to at91sam9x5 family entry ARM: at91/Kconfig: change at91sam9g45 entry ARM: at91: change AT91 Kconfig entry comment Also updates the cleanup branch to v3.4-rc3. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'sound/soc/codecs/sgtl5000.c')
-rw-r--r--sound/soc/codecs/sgtl5000.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d1926266fe0..8e92fb88ed0 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -143,11 +143,11 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
}
/*
- * using codec assist to small pop, hp_powerup or lineout_powerup
- * should stay setting until vag_powerup is fully ramped down,
- * vag fully ramped down require 400ms.
+ * As manual described, ADC/DAC only works when VAG powerup,
+ * So enabled VAG before ADC/DAC up.
+ * In power down case, we need wait 400ms when vag fully ramped down.
*/
-static int small_pop_event(struct snd_soc_dapm_widget *w,
+static int power_vag_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
switch (event) {
@@ -156,7 +156,7 @@ static int small_pop_event(struct snd_soc_dapm_widget *w,
SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
break;
- case SND_SOC_DAPM_PRE_PMD:
+ case SND_SOC_DAPM_POST_PMD:
snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
SGTL5000_VAG_POWERUP, 0);
msleep(400);
@@ -201,12 +201,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
mic_bias_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
- SND_SOC_DAPM_PGA_E("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0,
- small_pop_event,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
- SND_SOC_DAPM_PGA_E("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0,
- small_pop_event,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
+ SND_SOC_DAPM_PGA("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0),
+ SND_SOC_DAPM_PGA("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0),
SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux),
SND_SOC_DAPM_MUX("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux),
@@ -221,8 +217,11 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
0, SGTL5000_CHIP_DIG_POWER,
1, 0),
- SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0),
+ SND_SOC_DAPM_SUPPLY("VAG_POWER", SGTL5000_CHIP_ANA_POWER, 7, 0,
+ power_vag_event,
+ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0),
SND_SOC_DAPM_DAC("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0),
};
@@ -231,9 +230,11 @@ static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
{"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */
{"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */
+ {"ADC", NULL, "VAG_POWER"},
{"ADC", NULL, "Capture Mux"}, /* adc_mux --> adc */
{"AIFOUT", NULL, "ADC"}, /* adc --> i2s_out */
+ {"DAC", NULL, "VAG_POWER"},
{"DAC", NULL, "AIFIN"}, /* i2s-->dac,skip audio mux */
{"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */
{"LO", NULL, "DAC"}, /* dac --> line_out */