Enabling ASoC paths over suspend
Subsystems (5)
cover Enabling ASoC paths over suspend
The following patch series implements support for keeping some paths in the audio codec enabled while the system is suspended. This is primarily intended for mobile phones, where the GSM modem is normally capable of supporting a voice call with no intervention from the CPU so power can be saved by suspending the Linux system. This is done by allowing DAPM nodes to be marked as ignoring suspend. Any audio paths between two widgets set up like this at suspend time will be kept active and the CODEC device will not be suspended.
The existing testing is very light (especially for digital paths), the intention is to do more of that get this merged into Takashi's tree early next week.
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git suspend-enable
Mark Brown (5):
ASoC: Remove unneeded suspend bias managment from CODEC drivers
ASoC: Remove unused DAPM suspend flag
ASoC: Refactor DAPM suspend handling
ASoC: Support leaving paths enabled over system suspend
ASoC: Allow active paths from the GSM modem while the GTA02 is suspended
include/sound/soc-dapm.h | 3 +- sound/soc/codecs/ak4535.c | 1 - sound/soc/codecs/cq93vc.c | 2 +- sound/soc/codecs/ssm2602.c | 1 - sound/soc/codecs/stac9766.c | 3 - sound/soc/codecs/tlv320aic23.c | 1 - sound/soc/codecs/tlv320aic3x.c | 2 +- sound/soc/codecs/tlv320dac33.c | 3 - sound/soc/codecs/twl4030.c | 1 - sound/soc/codecs/twl6040.c | 1 - sound/soc/codecs/uda1380.c | 1 - sound/soc/codecs/wm8350.c | 3 - sound/soc/codecs/wm8510.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8728.c | 2 +- sound/soc/codecs/wm8731.c | 1 - sound/soc/codecs/wm8903.c | 1 - sound/soc/codecs/wm8940.c | 1 - sound/soc/codecs/wm8960.c | 2 +- sound/soc/codecs/wm8974.c | 2 +- sound/soc/codecs/wm9712.c | 3 - sound/soc/codecs/wm9713.c | 3 - sound/soc/s3c24xx/neo1973_gta02_wm8753.c | 8 +++ sound/soc/soc-core.c | 35 ++++++++++- sound/soc/soc-dapm.c | 92 +++++++++++++++++++----------- 25 files changed, 107 insertions(+), 69 deletions(-)
PATCH 1/5 ASoC: Remove unneeded suspend bias managment from CODEC drivers
The core will ensure that the device is in either STANDBY or OFF bias before suspending, restoring the bias in the driver is unneeded. Some drivers doing slightly more roundabout things have been left alone for now.
--- sound/soc/codecs/ak4535.c | 1 - sound/soc/codecs/cq93vc.c | 2 +- sound/soc/codecs/ssm2602.c | 1 - sound/soc/codecs/stac9766.c | 3 --- sound/soc/codecs/tlv320aic23.c | 1 - sound/soc/codecs/tlv320aic3x.c | 2 +- sound/soc/codecs/tlv320dac33.c | 3 --- sound/soc/codecs/twl4030.c | 1 - sound/soc/codecs/twl6040.c | 1 - sound/soc/codecs/uda1380.c | 1 - sound/soc/codecs/wm8350.c | 3 --- sound/soc/codecs/wm8510.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8728.c | 2 +- sound/soc/codecs/wm8731.c | 1 - sound/soc/codecs/wm8903.c | 1 - sound/soc/codecs/wm8940.c | 1 - sound/soc/codecs/wm8960.c | 2 +- sound/soc/codecs/wm8974.c | 2 +- sound/soc/codecs/wm9712.c | 3 --- sound/soc/codecs/wm9713.c | 3 --- 21 files changed, 7 insertions(+), 31 deletions(-)
sound/soc/codecs/ak4535.c +0 -1
@@ -445,7 +445,6 @@ static int ak4535_resume(struct platform_device *pdev)struct snd_soc_codec *codec = socdev->card->codec;ak4535_sync (codec);ak4535_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -ak4535_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/cq93vc.c +1 -1
@@ -153,7 +153,7 @@ static int cq93vc_resume(struct platform_device *pdev)struct snd_soc_device *socdev =platform_get_drvdata (pdev);struct snd_soc_codec *codec = socdev->card->codec; -cq93vc_set_bias_level (codec, codec->suspend_bias_level); +cq93vc_set_bias_level (codec,SND_SOC_BIAS_STANDBY );return 0 ; }
sound/soc/codecs/ssm2602.c +0 -1
@@ -559,7 +559,6 @@ static int ssm2602_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }ssm2602_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -ssm2602_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/stac9766.c +0 -3
@@ -288,9 +288,6 @@ reset: }stac9766_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) -stac9766_set_bias_level (codec,SND_SOC_BIAS_ON ); -return 0 ; }
sound/soc/codecs/tlv320aic23.c +0 -1
@@ -633,7 +633,6 @@ static int tlv320aic23_resume(struct platform_device *pdev) }tlv320aic23_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -tlv320aic23_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/tlv320aic3x.c +1 -1
@@ -1143,7 +1143,7 @@ static int aic3x_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); } -aic3x_set_bias_level (codec, codec->suspend_bias_level); +aic3x_set_bias_level (codec,SND_SOC_BIAS_STANDBY );return 0 ; }
sound/soc/codecs/tlv320dac33.c +0 -3
@@ -1386,9 +1386,6 @@ static int dac33_soc_resume(struct platform_device *pdev)struct snd_soc_codec *codec = socdev->card->codec;dac33_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) -dac33_set_bias_level (codec,SND_SOC_BIAS_PREPARE ); -dac33_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/twl4030.c +0 -1
@@ -2181,7 +2181,6 @@ static int twl4030_soc_resume(struct platform_device *pdev)struct snd_soc_codec *codec = socdev->card->codec;twl4030_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -twl4030_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/twl6040.c +0 -1
@@ -996,7 +996,6 @@ static int twl6040_resume(struct platform_device *pdev)struct snd_soc_codec *codec = socdev->card->codec;twl6040_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -twl6040_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/uda1380.c +0 -1
@@ -670,7 +670,6 @@ static int uda1380_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }uda1380_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -uda1380_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/wm8350.c +0 -3
@@ -1336,9 +1336,6 @@ static int wm8350_resume(struct platform_device *pdev)wm8350_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) -wm8350_set_bias_level (codec,SND_SOC_BIAS_ON ); -return 0 ; }
sound/soc/codecs/wm8510.c +1 -1
@@ -556,7 +556,7 @@ static int wm8510_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }wm8510_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -wm8510_set_bias_level (codec, codec->suspend_bias_level); +return 0 ; }
sound/soc/codecs/wm8711.c +1 -1
@@ -375,7 +375,7 @@ static int wm8711_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }wm8711_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -wm8711_set_bias_level (codec, codec->suspend_bias_level); +return 0 ; }
sound/soc/codecs/wm8728.c +1 -1
@@ -237,7 +237,7 @@ static int wm8728_resume(struct platform_device *pdev)struct snd_soc_device *socdev =platform_get_drvdata (pdev);struct snd_soc_codec *codec = socdev->card->codec; -wm8728_set_bias_level (codec, codec->suspend_bias_level); +wm8728_set_bias_level (codec,SND_SOC_BIAS_STANDBY );return 0 ; }
sound/soc/codecs/wm8731.c +0 -1
@@ -460,7 +460,6 @@ static int wm8731_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }wm8731_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -wm8731_set_bias_level (codec, codec->suspend_bias_level);return 0 ; }
sound/soc/codecs/wm8903.c +0 -1
@@ -1628,7 +1628,6 @@ static int wm8903_resume(struct platform_device *pdev)/* Bring the codec back up to standby first to minimise pop/clicks */ wm8903_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -wm8903_set_bias_level (codec, codec->suspend_bias_level);/* Sync back everything else */ if (tmp_cache) {
sound/soc/codecs/wm8940.c +0 -1
@@ -691,7 +691,6 @@ static int wm8940_resume(struct platform_device *pdev) ret =wm8940_set_bias_level (codec,SND_SOC_BIAS_STANDBY );if (ret) goto error_ret; - ret =wm8940_set_bias_level (codec, codec->suspend_bias_level); error_ret:return ret;
sound/soc/codecs/wm8960.c +1 -1
@@ -823,7 +823,7 @@ static int wm8960_resume(struct platform_device *pdev) } codec->set_bias_level (codec,SND_SOC_BIAS_STANDBY ); - codec->set_bias_level (codec, codec->suspend_bias_level); +return 0 ; }
sound/soc/codecs/wm8974.c +1 -1
@@ -608,7 +608,7 @@ static int wm8974_resume(struct platform_device *pdev) codec->hw_write (codec->control_data, data,2 ); }wm8974_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); -wm8974_set_bias_level (codec, codec->suspend_bias_level); +return 0 ; }
sound/soc/codecs/wm9712.c +0 -3
@@ -631,9 +631,6 @@ static int wm9712_soc_resume(struct platform_device *pdev) } } -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) -wm9712_set_bias_level (codec,SND_SOC_BIAS_ON ); -return ret; }
sound/soc/codecs/wm9713.c +0 -3
@@ -1200,9 +1200,6 @@ static int wm9713_soc_resume(struct platform_device *pdev) } } -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) -wm9713_set_bias_level (codec,SND_SOC_BIAS_ON ); -return ret; }
Signature · 1 line
1.7.0.5
PATCH 2/5 ASoC: Remove unused DAPM suspend flag
In reply to Mark BrownWe now manage suspend within the main power analysis rather than by flipping the state of widgets.
--- include/sound/soc-dapm.h | 1 - sound/soc/soc-dapm.c | 10 ---------- 2 files changed, 0 insertions(+), 11 deletions(-)
include/sound/soc-dapm.h +0 -1
@@ -427,7 +427,6 @@ struct snd_soc_dapm_widget { unsigned char connected:1; /* connected codec pin */ unsigned char new:1; /* cnew complete */ unsigned char ext:1; /* has external widgets */ - unsigned char suspend:1; /* was active before suspend */ unsigned char force:1; /* force state */int (*power_check)(struct snd_soc_dapm_widget *w);
sound/soc/soc-dapm.c +0 -10
@@ -2012,18 +2012,8 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, w->active =0 ;break ;case SND_SOC_DAPM_STREAM_SUSPEND : -if (w->active) - w->suspend =1 ; - w->active =0 ; -break ;case SND_SOC_DAPM_STREAM_RESUME : -if (w->suspend) { - w->active =1 ; - w->suspend =0 ; - } -break ;case SND_SOC_DAPM_STREAM_PAUSE_PUSH : -break ;case SND_SOC_DAPM_STREAM_PAUSE_RELEASE :break ; }
Signature · 1 line
1.7.0.5
PATCH 3/5 ASoC: Refactor DAPM suspend handling
In reply to Mark BrownInstead of using stream events to handle power down during suspend integrate the handling with the normal widget path checking by replacing all cases where we report a connected endpoint in a path with a function snd_soc_dapm_suspend_check() which looks at the ALSA power state for the card and reports false if we are in a D3 state.
Since the core moves us into D3 prior to initating the suspend all power checks during suspend will cause the widgets to be powered down. In order to ensure that widgets are powered up on resume set the card to D2 at the start of resume handling (ALSA API calls require D0 so we are still protected against userspace access).
--- sound/soc/soc-core.c | 3 ++ sound/soc/soc-dapm.c | 53 ++++++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 23 deletions(-)
sound/soc/soc-core.c +3 -0
@@ -963,6 +963,9 @@ static void soc_resume_deferred(struct work_struct *work)dev_dbg (socdev->dev,"starting resume work\n" ); +/* Bring us up into D2 so that DAPM starts enabling things */ +snd_power_change_state (codec->card,SNDRV_CTL_POWER_D2 ); +if (card->resume_pre) card->resume_pre (pdev);
sound/soc/soc-dapm.c +30 -23
100 lines not on this page · raw message
Signature · 1 line
1.7.0.5
PATCH 4/5 ASoC: Support leaving paths enabled over system suspend
In reply to Mark BrownSome devices can usefully run audio while the Linux system is suspended. One of the most common examples is smartphone systems, which are normally designed to allow audio to be run between the baseband and the CODEC without passing through the CPU and so can suspend the CPU when on a voice call for additional power savings.
Support such systems by providing an API snd_soc_dapm_ignore_suspend(). This can be used to mark DAPM endpoints as not being sensitive to system suspend. When the system is being suspended paths between endpoints which are marked as ignoring suspend will be kept active. Both source and sink must be marked, and there must already be an active path between the two endpoints prior to suspend.
When paths are active over suspend the bias management will hold the device bias in the ON state. This is used to avoid suspending the CODEC while it is still in use.
--- include/sound/soc-dapm.h | 2 ++ sound/soc/soc-core.c | 32 ++++++++++++++++++++++++++++---- sound/soc/soc-dapm.c | 31 ++++++++++++++++++++++++++++++- 3 files changed, 60 insertions(+), 5 deletions(-)
include/sound/soc-dapm.h +2 -0
@@ -341,6 +341,7 @@ int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin);int snd_soc_dapm_sync (struct snd_soc_codec *codec);int snd_soc_dapm_force_enable_pin (struct snd_soc_codec *codec,const char *pin); +int snd_soc_dapm_ignore_suspend (struct snd_soc_codec *codec,const char *pin);/* dapm widget types */ enum snd_soc_dapm_type {
@@ -428,6 +429,7 @@ struct snd_soc_dapm_widget { unsigned char new:1; /* cnew complete */ unsigned char ext:1; /* has external widgets */ unsigned char force:1; /* force state */ + unsigned char ignore_suspend:1; /* kept enabled over suspend */int (*power_check)(struct snd_soc_dapm_widget *w);
sound/soc/soc-core.c +28 -4
@@ -927,8 +927,19 @@ static int soc_suspend(struct device *dev) SND_SOC_DAPM_STREAM_SUSPEND); } -if (codec_dev->suspend) - codec_dev->suspend (pdev,PMSG_SUSPEND ); +/* If there are paths active then the CODEC will be held with +* bias _ON and should not be suspended. */ +if (codec_dev->suspend) { +switch (codec->bias_level) { +case SND_SOC_BIAS_STANDBY : +case SND_SOC_BIAS_OFF : + codec_dev->suspend (pdev,PMSG_SUSPEND ); +break ; +default : +dev_dbg (socdev->dev,"CODEC is on over suspend\n" ); +break ; + } + }for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
@@ -975,8 +986,21 @@ static void soc_resume_deferred(struct work_struct *work) cpu_dai->resume (cpu_dai); } -if (codec_dev->resume) - codec_dev->resume (pdev); +/* If the CODEC was idle over suspend then it will have been +* left with bias OFF or STANDBY and suspended so we must now +* resume. Otherwise the suspend was suppressed. +*/ +if (codec_dev->resume) { +switch (codec->bias_level) { +case SND_SOC_BIAS_STANDBY : +case SND_SOC_BIAS_OFF : + codec_dev->resume (pdev); +break ; +default : +dev_dbg (socdev->dev,"CODEC was on over suspend\n" ); +break ; + } + }for (i =0 ; i < codec->num_dai; i++) {char *stream = codec->dai[i].playback.stream_name;
sound/soc/soc-dapm.c +30 -1
@@ -441,7 +441,9 @@ static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget)switch (snd_power_get_state (codec->card)) {case SNDRV_CTL_POWER_D3hot:case SNDRV_CTL_POWER_D3cold: -return 0 ; +if (widget->ignore_suspend) +pr_debug ("%s ignoring suspend\n" , widget->name); +return widget->ignore_suspend;default :return 1 ; }
@@ -2137,6 +2139,33 @@ int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin)EXPORT_SYMBOL_GPL (snd_soc_dapm_get_pin_status);/** +* snd_soc_dapm_ignore_suspend - ignore suspend status for DAPM endpoint +* @codec: audio codec +* @pin: audio signal pin endpoint (or start point) +* +* Mark the given endpoint or pin as ignoring suspend. When the +* system is disabled a path between two endpoints flagged as ignoring +* suspend will not be disabled. The path must already be enabled via +* normal means at suspend time, it will not be turned on if it was not +* already enabled. +*/ +int snd_soc_dapm_ignore_suspend (struct snd_soc_codec *codec,const char *pin) +{ +struct snd_soc_dapm_widget *w; + +list_for_each_entry (w, &codec->dapm_widgets, list) { +if (!strcmp (w->name, pin)) { + w->ignore_suspend =1 ; +return 0 ; + } + } + +pr_err ("Unknown DAPM pin: %s\n" , pin); +return -EINVAL ; +} +EXPORT_SYMBOL_GPL (snd_soc_dapm_ignore_suspend); + +/** * snd_soc_dapm_free - free dapm resources * @socdev: SoC device *
Signature · 1 line
1.7.0.5
PATCH 5/5 ASoC: Allow active paths from the GSM modem while the GTA02 is suspended
In reply to Mark Brown--- sound/soc/s3c24xx/neo1973_gta02_wm8753.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/s3c24xx/neo1973_gta02_wm8753.c +8 -0
@@ -362,6 +362,14 @@ static int neo1973_gta02_wm8753_init(struct snd_soc_codec *codec)snd_soc_dapm_disable_pin (codec,"Handset Mic" );snd_soc_dapm_disable_pin (codec,"Handset Spk" ); +/* allow audio paths from the GSM modem to run during suspend */ +snd_soc_dapm_ignore_suspend (codec,"Stereo Out" ); +snd_soc_dapm_ignore_suspend (codec,"GSM Line Out" ); +snd_soc_dapm_ignore_suspend (codec,"GSM Line In" ); +snd_soc_dapm_ignore_suspend (codec,"Headset Mic" ); +snd_soc_dapm_ignore_suspend (codec,"Handset Mic" ); +snd_soc_dapm_ignore_suspend (codec,"Handset Spk" ); +snd_soc_dapm_sync (codec);return 0 ;
Signature · 1 line
1.7.0.5
[PATCH 6/5] ASoC: Allow DAI links to be kept active over suspend
In reply to Mark BrownAs well as allowing DAPM pins to be marked as ignoring suspend allow DAI links to be similarly marked. This is primarily intended for digital links between CODECs and non-CPU devices such as basebands in mobile phones and will suppress all suspend calls for the DAI link. It is likely that this will need to be revisited if used with devices which are part of the SoC CPU.
---
This patch is (as the timestamp and numbering indicate) a late addition to the series and has not been tested at all yet but hopefully it or something close to it will do the trick for digital links.
include/sound/soc.h | 3 +++ sound/soc/soc-core.c | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletions(-)
include/sound/soc.h +3 -0
@@ -505,6 +505,9 @@ struct snd_soc_dai_link {/* codec/machine specific init - e.g. add machine controls */ int (*init)(struct snd_soc_codec *codec); +/* Keep DAI active over suspend */ + unsigned int ignore_suspend:1; +/* Symmetry requirements */ unsigned int symmetric_rates:1;
sound/soc/soc-core.c +37 -1
@@ -893,19 +893,31 @@ static int soc_suspend(struct device *dev)/* mute any active DAC's */ for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *dai = card->dai_link[i].codec_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (dai->ops->digital_mute && dai->playback.active) dai->ops->digital_mute (dai,1 ); }/* suspend all pcms */ -for (i =0 ; i < card->num_links; i++) +for (i =0 ; i < card->num_links; i++) { +if (card->dai_link[i].ignore_suspend) +continue ; +snd_pcm_suspend_all (card->dai_link[i].pcm); + }if (card->suspend_pre) card->suspend_pre (pdev,PMSG_SUSPEND );for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (cpu_dai->suspend && !cpu_dai->ac97_control) cpu_dai->suspend (cpu_dai);if (platform->suspend)
@@ -918,6 +930,10 @@ static int soc_suspend(struct device *dev)for (i =0 ; i < codec->num_dai; i++) {char *stream = codec->dai[i].playback.stream_name; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (stream !=NULL )snd_soc_dapm_stream_event (codec, stream,SND_SOC_DAPM_STREAM_SUSPEND );
@@ -943,6 +959,10 @@ static int soc_suspend(struct device *dev)for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (cpu_dai->suspend && cpu_dai->ac97_control) cpu_dai->suspend (cpu_dai); }
@@ -982,6 +1002,10 @@ static void soc_resume_deferred(struct work_struct *work)for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (cpu_dai->resume && cpu_dai->ac97_control) cpu_dai->resume (cpu_dai); }
@@ -1004,6 +1028,10 @@ static void soc_resume_deferred(struct work_struct *work)for (i =0 ; i < codec->num_dai; i++) {char *stream = codec->dai[i].playback.stream_name; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (stream !=NULL )snd_soc_dapm_stream_event (codec, stream,SND_SOC_DAPM_STREAM_RESUME );
@@ -1016,12 +1044,20 @@ static void soc_resume_deferred(struct work_struct *work)/* unmute any active DACs */ for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *dai = card->dai_link[i].codec_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (dai->ops->digital_mute && dai->playback.active) dai->ops->digital_mute (dai,0 ); }for (i =0 ; i < card->num_links; i++) {struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; + +if (card->dai_link[i].ignore_suspend) +continue ; +if (cpu_dai->resume && !cpu_dai->ac97_control) cpu_dai->resume (cpu_dai);if (platform->resume)
Signature · 1 line
1.7.0.5
Quoted 16 lines · On Sunday 09 May 2010 15:07:41 ext Mark Brown wrote:
The following patch series implements support for keeping some paths in the audio codec enabled while the system is suspended. This is primarily intended for mobile phones, where the GSM modem is normally capable of supporting a voice call with no intervention from the CPU so power can be saved by suspending the Linux system. This is done by allowing DAPM nodes to be marked as ignoring suspend. Any audio paths between two widgets set up like this at suspend time will be kept active and the CODEC device will not be suspended.
The existing testing is very light (especially for digital paths), the intention is to do more of that get this merged into Takashi's tree early next week.
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
suspend-enable
Quoted 7 lines
Mark Brown (5):
ASoC: Remove unneeded suspend bias managment from CODEC drivers
ASoC: Remove unused DAPM suspend flag
ASoC: Refactor DAPM suspend handling
ASoC: Support leaving paths enabled over system suspend
ASoC: Allow active paths from the GSM modem while the GTA02 is
suspended
I have not tested the actual purpose of this series, but at least it is not breaking the twl4030, and tlv320dac33 codec driver normal usage.
Quoted 13 lines · Mark Brown
The following patch series implements support for keeping some paths in the audio codec enabled while the system is suspended. This is primarily intended for mobile phones, where the GSM modem is normally capable of supporting a voice call with no intervention from the CPU so power can be saved by suspending the Linux system. This is done by allowing DAPM nodes to be marked as ignoring suspend. Any audio paths between two widgets set up like this at suspend time will be kept active and the CODEC device will not be suspended.
The existing testing is very light (especially for digital paths), the intention is to do more of that get this merged into Takashi's tree early next week.
Quoted 8 lines
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.gitsuspend-enableMark Brown (5):
ASoC: Remove unneeded suspend bias managment from CODEC drivers
ASoC: Remove unused DAPM suspend flag
ASoC: Refactor DAPM suspend handling
ASoC: Support leaving paths enabled over system suspend
ASoC: Allow active paths from the GSM modem while the GTA02 is suspended
All :-
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk