aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8a3192bcee78..728f3ac2f304 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -763,21 +763,18 @@ static ssize_t dapm_widget_show(struct device *dev,
763 } 763 }
764 } 764 }
765 765
766 switch(codec->dapm_state){ 766 switch (codec->bias_level) {
767 case SNDRV_CTL_POWER_D0: 767 case SND_SOC_BIAS_ON:
768 state = "D0"; 768 state = "On";
769 break; 769 break;
770 case SNDRV_CTL_POWER_D1: 770 case SND_SOC_BIAS_PREPARE:
771 state = "D1"; 771 state = "Prepare";
772 break; 772 break;
773 case SNDRV_CTL_POWER_D2: 773 case SND_SOC_BIAS_STANDBY:
774 state = "D2"; 774 state = "Standby";
775 break; 775 break;
776 case SNDRV_CTL_POWER_D3hot: 776 case SND_SOC_BIAS_OFF:
777 state = "D3hot"; 777 state = "Off";
778 break;
779 case SNDRV_CTL_POWER_D3cold:
780 state = "D3cold";
781 break; 778 break;
782 } 779 }
783 count += sprintf(buf + count, "PM State: %s\n", state); 780 count += sprintf(buf + count, "PM State: %s\n", state);
@@ -1358,27 +1355,28 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
1358EXPORT_SYMBOL_GPL(snd_soc_dapm_stream_event); 1355EXPORT_SYMBOL_GPL(snd_soc_dapm_stream_event);
1359 1356
1360/** 1357/**
1361 * snd_soc_dapm_device_event - send a device event to the dapm core 1358 * snd_soc_dapm_set_bias_level - set the bias level for the system
1362 * @socdev: audio device 1359 * @socdev: audio device
1363 * @event: device event 1360 * @level: level to configure
1364 * 1361 *
1365 * Sends a device event to the dapm core. The core then makes any 1362 * Configure the bias (power) levels for the SoC audio device.
1366 * necessary machine or codec power changes..
1367 * 1363 *
1368 * Returns 0 for success else error. 1364 * Returns 0 for success else error.
1369 */ 1365 */
1370int snd_soc_dapm_device_event(struct snd_soc_device *socdev, int event) 1366int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
1367 enum snd_soc_bias_level level)
1371{ 1368{
1372 struct snd_soc_codec *codec = socdev->codec; 1369 struct snd_soc_codec *codec = socdev->codec;
1373 struct snd_soc_machine *machine = socdev->machine; 1370 struct snd_soc_machine *machine = socdev->machine;
1371 int ret = 0;
1374 1372
1375 if (machine->dapm_event) 1373 if (machine->set_bias_level)
1376 machine->dapm_event(machine, event); 1374 ret = machine->set_bias_level(machine, level);
1377 if (codec->dapm_event) 1375 if (ret == 0 && codec->set_bias_level)
1378 codec->dapm_event(codec, event); 1376 ret = codec->set_bias_level(codec, level);
1379 return 0; 1377
1378 return ret;
1380} 1379}
1381EXPORT_SYMBOL_GPL(snd_soc_dapm_device_event);
1382 1380
1383/** 1381/**
1384 * snd_soc_dapm_set_endpoint - set audio endpoint status 1382 * snd_soc_dapm_set_endpoint - set audio endpoint status