diff options
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 26 | ||||
-rw-r--r-- | sound/soc/codecs/wm8731.c | 28 | ||||
-rw-r--r-- | sound/soc/codecs/wm8750.c | 36 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 36 | ||||
-rw-r--r-- | sound/soc/codecs/wm9712.c | 28 | ||||
-rw-r--r-- | sound/soc/codecs/wm9713.c | 26 |
6 files changed, 90 insertions, 90 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index cb8365ac0c02..dc8a38d9e53a 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -847,13 +847,14 @@ static int aic3x_set_dai_fmt(struct snd_soc_codec_dai *codec_dai, | |||
847 | return 0; | 847 | return 0; |
848 | } | 848 | } |
849 | 849 | ||
850 | static int aic3x_dapm_event(struct snd_soc_codec *codec, int event) | 850 | static int aic3x_set_bias_level(struct snd_soc_codec *codec, |
851 | enum snd_soc_bias_level level) | ||
851 | { | 852 | { |
852 | struct aic3x_priv *aic3x = codec->private_data; | 853 | struct aic3x_priv *aic3x = codec->private_data; |
853 | u8 reg; | 854 | u8 reg; |
854 | 855 | ||
855 | switch (event) { | 856 | switch (level) { |
856 | case SNDRV_CTL_POWER_D0: | 857 | case SND_SOC_BIAS_ON: |
857 | /* all power is driven by DAPM system */ | 858 | /* all power is driven by DAPM system */ |
858 | if (aic3x->master) { | 859 | if (aic3x->master) { |
859 | /* enable pll */ | 860 | /* enable pll */ |
@@ -862,10 +863,9 @@ static int aic3x_dapm_event(struct snd_soc_codec *codec, int event) | |||
862 | reg | PLL_ENABLE); | 863 | reg | PLL_ENABLE); |
863 | } | 864 | } |
864 | break; | 865 | break; |
865 | case SNDRV_CTL_POWER_D1: | 866 | case SND_SOC_BIAS_PREPARE: |
866 | case SNDRV_CTL_POWER_D2: | ||
867 | break; | 867 | break; |
868 | case SNDRV_CTL_POWER_D3hot: | 868 | case SND_SOC_BIAS_STANDBY: |
869 | /* | 869 | /* |
870 | * all power is driven by DAPM system, | 870 | * all power is driven by DAPM system, |
871 | * so output power is safe if bypass was set | 871 | * so output power is safe if bypass was set |
@@ -877,7 +877,7 @@ static int aic3x_dapm_event(struct snd_soc_codec *codec, int event) | |||
877 | reg & ~PLL_ENABLE); | 877 | reg & ~PLL_ENABLE); |
878 | } | 878 | } |
879 | break; | 879 | break; |
880 | case SNDRV_CTL_POWER_D3cold: | 880 | case SND_SOC_BIAS_OFF: |
881 | /* force all power off */ | 881 | /* force all power off */ |
882 | reg = aic3x_read_reg_cache(codec, LINE1L_2_LADC_CTRL); | 882 | reg = aic3x_read_reg_cache(codec, LINE1L_2_LADC_CTRL); |
883 | aic3x_write(codec, LINE1L_2_LADC_CTRL, reg & ~LADC_PWR_ON); | 883 | aic3x_write(codec, LINE1L_2_LADC_CTRL, reg & ~LADC_PWR_ON); |
@@ -913,7 +913,7 @@ static int aic3x_dapm_event(struct snd_soc_codec *codec, int event) | |||
913 | } | 913 | } |
914 | break; | 914 | break; |
915 | } | 915 | } |
916 | codec->dapm_state = event; | 916 | codec->bias_level = level; |
917 | 917 | ||
918 | return 0; | 918 | return 0; |
919 | } | 919 | } |
@@ -979,7 +979,7 @@ static int aic3x_suspend(struct platform_device *pdev, pm_message_t state) | |||
979 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 979 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
980 | struct snd_soc_codec *codec = socdev->codec; | 980 | struct snd_soc_codec *codec = socdev->codec; |
981 | 981 | ||
982 | aic3x_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 982 | aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
983 | 983 | ||
984 | return 0; | 984 | return 0; |
985 | } | 985 | } |
@@ -999,7 +999,7 @@ static int aic3x_resume(struct platform_device *pdev) | |||
999 | codec->hw_write(codec->control_data, data, 2); | 999 | codec->hw_write(codec->control_data, data, 2); |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | aic3x_dapm_event(codec, codec->suspend_dapm_state); | 1002 | aic3x_set_bias_level(codec, codec->suspend_bias_level); |
1003 | 1003 | ||
1004 | return 0; | 1004 | return 0; |
1005 | } | 1005 | } |
@@ -1018,7 +1018,7 @@ static int aic3x_init(struct snd_soc_device *socdev) | |||
1018 | codec->owner = THIS_MODULE; | 1018 | codec->owner = THIS_MODULE; |
1019 | codec->read = aic3x_read_reg_cache; | 1019 | codec->read = aic3x_read_reg_cache; |
1020 | codec->write = aic3x_write; | 1020 | codec->write = aic3x_write; |
1021 | codec->dapm_event = aic3x_dapm_event; | 1021 | codec->set_bias_level = aic3x_set_bias_level; |
1022 | codec->dai = &aic3x_dai; | 1022 | codec->dai = &aic3x_dai; |
1023 | codec->num_dai = 1; | 1023 | codec->num_dai = 1; |
1024 | codec->reg_cache_size = sizeof(aic3x_reg); | 1024 | codec->reg_cache_size = sizeof(aic3x_reg); |
@@ -1100,7 +1100,7 @@ static int aic3x_init(struct snd_soc_device *socdev) | |||
1100 | aic3x_write(codec, LINE2R_2_MONOLOPM_VOL, DEFAULT_VOL); | 1100 | aic3x_write(codec, LINE2R_2_MONOLOPM_VOL, DEFAULT_VOL); |
1101 | 1101 | ||
1102 | /* off, with power on */ | 1102 | /* off, with power on */ |
1103 | aic3x_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 1103 | aic3x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1104 | 1104 | ||
1105 | /* setup GPIO functions */ | 1105 | /* setup GPIO functions */ |
1106 | aic3x_write(codec, AIC3X_GPIO1_REG, (setup->gpio_func[0] & 0xf) << 4); | 1106 | aic3x_write(codec, AIC3X_GPIO1_REG, (setup->gpio_func[0] & 0xf) << 4); |
@@ -1271,7 +1271,7 @@ static int aic3x_remove(struct platform_device *pdev) | |||
1271 | 1271 | ||
1272 | /* power down chip */ | 1272 | /* power down chip */ |
1273 | if (codec->control_data) | 1273 | if (codec->control_data) |
1274 | aic3x_dapm_event(codec, SNDRV_CTL_POWER_D3); | 1274 | aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1275 | 1275 | ||
1276 | snd_soc_free_pcms(socdev); | 1276 | snd_soc_free_pcms(socdev); |
1277 | snd_soc_dapm_free(socdev); | 1277 | snd_soc_dapm_free(socdev); |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 0cf9265fca8f..0f28aa4bcccb 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -435,29 +435,29 @@ static int wm8731_set_dai_fmt(struct snd_soc_codec_dai *codec_dai, | |||
435 | return 0; | 435 | return 0; |
436 | } | 436 | } |
437 | 437 | ||
438 | static int wm8731_dapm_event(struct snd_soc_codec *codec, int event) | 438 | static int wm8731_set_bias_level(struct snd_soc_codec *codec, |
439 | enum snd_soc_bias_level level) | ||
439 | { | 440 | { |
440 | u16 reg = wm8731_read_reg_cache(codec, WM8731_PWR) & 0xff7f; | 441 | u16 reg = wm8731_read_reg_cache(codec, WM8731_PWR) & 0xff7f; |
441 | 442 | ||
442 | switch (event) { | 443 | switch (level) { |
443 | case SNDRV_CTL_POWER_D0: /* full On */ | 444 | case SND_SOC_BIAS_ON: |
444 | /* vref/mid, osc on, dac unmute */ | 445 | /* vref/mid, osc on, dac unmute */ |
445 | wm8731_write(codec, WM8731_PWR, reg); | 446 | wm8731_write(codec, WM8731_PWR, reg); |
446 | break; | 447 | break; |
447 | case SNDRV_CTL_POWER_D1: /* partial On */ | 448 | case SND_SOC_BIAS_PREPARE: |
448 | case SNDRV_CTL_POWER_D2: /* partial On */ | ||
449 | break; | 449 | break; |
450 | case SNDRV_CTL_POWER_D3hot: /* Off, with power */ | 450 | case SND_SOC_BIAS_STANDBY: |
451 | /* everything off except vref/vmid, */ | 451 | /* everything off except vref/vmid, */ |
452 | wm8731_write(codec, WM8731_PWR, reg | 0x0040); | 452 | wm8731_write(codec, WM8731_PWR, reg | 0x0040); |
453 | break; | 453 | break; |
454 | case SNDRV_CTL_POWER_D3cold: /* Off, without power */ | 454 | case SND_SOC_BIAS_OFF: |
455 | /* everything off, dac mute, inactive */ | 455 | /* everything off, dac mute, inactive */ |
456 | wm8731_write(codec, WM8731_ACTIVE, 0x0); | 456 | wm8731_write(codec, WM8731_ACTIVE, 0x0); |
457 | wm8731_write(codec, WM8731_PWR, 0xffff); | 457 | wm8731_write(codec, WM8731_PWR, 0xffff); |
458 | break; | 458 | break; |
459 | } | 459 | } |
460 | codec->dapm_state = event; | 460 | codec->bias_level = level; |
461 | return 0; | 461 | return 0; |
462 | } | 462 | } |
463 | 463 | ||
@@ -503,7 +503,7 @@ static int wm8731_suspend(struct platform_device *pdev, pm_message_t state) | |||
503 | struct snd_soc_codec *codec = socdev->codec; | 503 | struct snd_soc_codec *codec = socdev->codec; |
504 | 504 | ||
505 | wm8731_write(codec, WM8731_ACTIVE, 0x0); | 505 | wm8731_write(codec, WM8731_ACTIVE, 0x0); |
506 | wm8731_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 506 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); |
507 | return 0; | 507 | return 0; |
508 | } | 508 | } |
509 | 509 | ||
@@ -521,8 +521,8 @@ static int wm8731_resume(struct platform_device *pdev) | |||
521 | data[1] = cache[i] & 0x00ff; | 521 | data[1] = cache[i] & 0x00ff; |
522 | codec->hw_write(codec->control_data, data, 2); | 522 | codec->hw_write(codec->control_data, data, 2); |
523 | } | 523 | } |
524 | wm8731_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 524 | wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
525 | wm8731_dapm_event(codec, codec->suspend_dapm_state); | 525 | wm8731_set_bias_level(codec, codec->suspend_bias_level); |
526 | return 0; | 526 | return 0; |
527 | } | 527 | } |
528 | 528 | ||
@@ -539,7 +539,7 @@ static int wm8731_init(struct snd_soc_device *socdev) | |||
539 | codec->owner = THIS_MODULE; | 539 | codec->owner = THIS_MODULE; |
540 | codec->read = wm8731_read_reg_cache; | 540 | codec->read = wm8731_read_reg_cache; |
541 | codec->write = wm8731_write; | 541 | codec->write = wm8731_write; |
542 | codec->dapm_event = wm8731_dapm_event; | 542 | codec->set_bias_level = wm8731_set_bias_level; |
543 | codec->dai = &wm8731_dai; | 543 | codec->dai = &wm8731_dai; |
544 | codec->num_dai = 1; | 544 | codec->num_dai = 1; |
545 | codec->reg_cache_size = sizeof(wm8731_reg); | 545 | codec->reg_cache_size = sizeof(wm8731_reg); |
@@ -557,7 +557,7 @@ static int wm8731_init(struct snd_soc_device *socdev) | |||
557 | } | 557 | } |
558 | 558 | ||
559 | /* power on device */ | 559 | /* power on device */ |
560 | wm8731_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 560 | wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
561 | 561 | ||
562 | /* set the update bits */ | 562 | /* set the update bits */ |
563 | reg = wm8731_read_reg_cache(codec, WM8731_LOUT1V); | 563 | reg = wm8731_read_reg_cache(codec, WM8731_LOUT1V); |
@@ -730,7 +730,7 @@ static int wm8731_remove(struct platform_device *pdev) | |||
730 | struct snd_soc_codec *codec = socdev->codec; | 730 | struct snd_soc_codec *codec = socdev->codec; |
731 | 731 | ||
732 | if (codec->control_data) | 732 | if (codec->control_data) |
733 | wm8731_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 733 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); |
734 | 734 | ||
735 | snd_soc_free_pcms(socdev); | 735 | snd_soc_free_pcms(socdev); |
736 | snd_soc_dapm_free(socdev); | 736 | snd_soc_dapm_free(socdev); |
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index 16cd5d4d5ad9..62423f4493b0 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -686,29 +686,29 @@ static int wm8750_mute(struct snd_soc_codec_dai *dai, int mute) | |||
686 | return 0; | 686 | return 0; |
687 | } | 687 | } |
688 | 688 | ||
689 | static int wm8750_dapm_event(struct snd_soc_codec *codec, int event) | 689 | static int wm8750_set_bias_level(struct snd_soc_codec *codec, |
690 | enum snd_soc_bias_level level) | ||
690 | { | 691 | { |
691 | u16 pwr_reg = wm8750_read_reg_cache(codec, WM8750_PWR1) & 0xfe3e; | 692 | u16 pwr_reg = wm8750_read_reg_cache(codec, WM8750_PWR1) & 0xfe3e; |
692 | 693 | ||
693 | switch (event) { | 694 | switch (level) { |
694 | case SNDRV_CTL_POWER_D0: /* full On */ | 695 | case SND_SOC_BIAS_ON: |
695 | /* set vmid to 50k and unmute dac */ | 696 | /* set vmid to 50k and unmute dac */ |
696 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x00c0); | 697 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x00c0); |
697 | break; | 698 | break; |
698 | case SNDRV_CTL_POWER_D1: /* partial On */ | 699 | case SND_SOC_BIAS_PREPARE: |
699 | case SNDRV_CTL_POWER_D2: /* partial On */ | ||
700 | /* set vmid to 5k for quick power up */ | 700 | /* set vmid to 5k for quick power up */ |
701 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x01c1); | 701 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x01c1); |
702 | break; | 702 | break; |
703 | case SNDRV_CTL_POWER_D3hot: /* Off, with power */ | 703 | case SND_SOC_BIAS_STANDBY: |
704 | /* mute dac and set vmid to 500k, enable VREF */ | 704 | /* mute dac and set vmid to 500k, enable VREF */ |
705 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x0141); | 705 | wm8750_write(codec, WM8750_PWR1, pwr_reg | 0x0141); |
706 | break; | 706 | break; |
707 | case SNDRV_CTL_POWER_D3cold: /* Off, without power */ | 707 | case SND_SOC_BIAS_OFF: |
708 | wm8750_write(codec, WM8750_PWR1, 0x0001); | 708 | wm8750_write(codec, WM8750_PWR1, 0x0001); |
709 | break; | 709 | break; |
710 | } | 710 | } |
711 | codec->dapm_state = event; | 711 | codec->bias_level = level; |
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
@@ -748,7 +748,7 @@ static void wm8750_work(struct work_struct *work) | |||
748 | { | 748 | { |
749 | struct snd_soc_codec *codec = | 749 | struct snd_soc_codec *codec = |
750 | container_of(work, struct snd_soc_codec, delayed_work.work); | 750 | container_of(work, struct snd_soc_codec, delayed_work.work); |
751 | wm8750_dapm_event(codec, codec->dapm_state); | 751 | wm8750_set_bias_level(codec, codec->bias_level); |
752 | } | 752 | } |
753 | 753 | ||
754 | static int wm8750_suspend(struct platform_device *pdev, pm_message_t state) | 754 | static int wm8750_suspend(struct platform_device *pdev, pm_message_t state) |
@@ -756,7 +756,7 @@ static int wm8750_suspend(struct platform_device *pdev, pm_message_t state) | |||
756 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 756 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
757 | struct snd_soc_codec *codec = socdev->codec; | 757 | struct snd_soc_codec *codec = socdev->codec; |
758 | 758 | ||
759 | wm8750_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 759 | wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); |
760 | return 0; | 760 | return 0; |
761 | } | 761 | } |
762 | 762 | ||
@@ -777,12 +777,12 @@ static int wm8750_resume(struct platform_device *pdev) | |||
777 | codec->hw_write(codec->control_data, data, 2); | 777 | codec->hw_write(codec->control_data, data, 2); |
778 | } | 778 | } |
779 | 779 | ||
780 | wm8750_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 780 | wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
781 | 781 | ||
782 | /* charge wm8750 caps */ | 782 | /* charge wm8750 caps */ |
783 | if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) { | 783 | if (codec->suspend_bias_level == SND_SOC_BIAS_ON) { |
784 | wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2); | 784 | wm8750_set_bias_level(codec, SND_SOC_BIAS_PREPARE); |
785 | codec->dapm_state = SNDRV_CTL_POWER_D0; | 785 | codec->bias_level = SND_SOC_BIAS_ON; |
786 | schedule_delayed_work(&codec->delayed_work, | 786 | schedule_delayed_work(&codec->delayed_work, |
787 | msecs_to_jiffies(1000)); | 787 | msecs_to_jiffies(1000)); |
788 | } | 788 | } |
@@ -803,7 +803,7 @@ static int wm8750_init(struct snd_soc_device *socdev) | |||
803 | codec->owner = THIS_MODULE; | 803 | codec->owner = THIS_MODULE; |
804 | codec->read = wm8750_read_reg_cache; | 804 | codec->read = wm8750_read_reg_cache; |
805 | codec->write = wm8750_write; | 805 | codec->write = wm8750_write; |
806 | codec->dapm_event = wm8750_dapm_event; | 806 | codec->set_bias_level = wm8750_set_bias_level; |
807 | codec->dai = &wm8750_dai; | 807 | codec->dai = &wm8750_dai; |
808 | codec->num_dai = 1; | 808 | codec->num_dai = 1; |
809 | codec->reg_cache_size = sizeof(wm8750_reg); | 809 | codec->reg_cache_size = sizeof(wm8750_reg); |
@@ -821,8 +821,8 @@ static int wm8750_init(struct snd_soc_device *socdev) | |||
821 | } | 821 | } |
822 | 822 | ||
823 | /* charge output caps */ | 823 | /* charge output caps */ |
824 | wm8750_dapm_event(codec, SNDRV_CTL_POWER_D2); | 824 | wm8750_set_bias_level(codec, SND_SOC_BIAS_PREPARE); |
825 | codec->dapm_state = SNDRV_CTL_POWER_D3hot; | 825 | codec->bias_level = SND_SOC_BIAS_STANDBY; |
826 | schedule_delayed_work(&codec->delayed_work, msecs_to_jiffies(1000)); | 826 | schedule_delayed_work(&codec->delayed_work, msecs_to_jiffies(1000)); |
827 | 827 | ||
828 | /* set the update bits */ | 828 | /* set the update bits */ |
@@ -1021,7 +1021,7 @@ static int wm8750_remove(struct platform_device *pdev) | |||
1021 | struct snd_soc_codec *codec = socdev->codec; | 1021 | struct snd_soc_codec *codec = socdev->codec; |
1022 | 1022 | ||
1023 | if (codec->control_data) | 1023 | if (codec->control_data) |
1024 | wm8750_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 1024 | wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1025 | run_delayed_work(&codec->delayed_work); | 1025 | run_delayed_work(&codec->delayed_work); |
1026 | snd_soc_free_pcms(socdev); | 1026 | snd_soc_free_pcms(socdev); |
1027 | snd_soc_dapm_free(socdev); | 1027 | snd_soc_dapm_free(socdev); |
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index fb41826c4c4c..9032b0c07c86 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1274,29 +1274,29 @@ static int wm8753_mute(struct snd_soc_codec_dai *dai, int mute) | |||
1274 | return 0; | 1274 | return 0; |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | static int wm8753_dapm_event(struct snd_soc_codec *codec, int event) | 1277 | static int wm8753_set_bias_level(struct snd_soc_codec *codec, |
1278 | enum snd_soc_bias_level level) | ||
1278 | { | 1279 | { |
1279 | u16 pwr_reg = wm8753_read_reg_cache(codec, WM8753_PWR1) & 0xfe3e; | 1280 | u16 pwr_reg = wm8753_read_reg_cache(codec, WM8753_PWR1) & 0xfe3e; |
1280 | 1281 | ||
1281 | switch (event) { | 1282 | switch (level) { |
1282 | case SNDRV_CTL_POWER_D0: /* full On */ | 1283 | case SND_SOC_BIAS_ON: |
1283 | /* set vmid to 50k and unmute dac */ | 1284 | /* set vmid to 50k and unmute dac */ |
1284 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x00c0); | 1285 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x00c0); |
1285 | break; | 1286 | break; |
1286 | case SNDRV_CTL_POWER_D1: /* partial On */ | 1287 | case SND_SOC_BIAS_PREPARE: |
1287 | case SNDRV_CTL_POWER_D2: /* partial On */ | ||
1288 | /* set vmid to 5k for quick power up */ | 1288 | /* set vmid to 5k for quick power up */ |
1289 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x01c1); | 1289 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x01c1); |
1290 | break; | 1290 | break; |
1291 | case SNDRV_CTL_POWER_D3hot: /* Off, with power */ | 1291 | case SND_SOC_BIAS_STANDBY: |
1292 | /* mute dac and set vmid to 500k, enable VREF */ | 1292 | /* mute dac and set vmid to 500k, enable VREF */ |
1293 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x0141); | 1293 | wm8753_write(codec, WM8753_PWR1, pwr_reg | 0x0141); |
1294 | break; | 1294 | break; |
1295 | case SNDRV_CTL_POWER_D3cold: /* Off, without power */ | 1295 | case SND_SOC_BIAS_OFF: |
1296 | wm8753_write(codec, WM8753_PWR1, 0x0001); | 1296 | wm8753_write(codec, WM8753_PWR1, 0x0001); |
1297 | break; | 1297 | break; |
1298 | } | 1298 | } |
1299 | codec->dapm_state = event; | 1299 | codec->bias_level = level; |
1300 | return 0; | 1300 | return 0; |
1301 | } | 1301 | } |
1302 | 1302 | ||
@@ -1500,7 +1500,7 @@ static void wm8753_work(struct work_struct *work) | |||
1500 | { | 1500 | { |
1501 | struct snd_soc_codec *codec = | 1501 | struct snd_soc_codec *codec = |
1502 | container_of(work, struct snd_soc_codec, delayed_work.work); | 1502 | container_of(work, struct snd_soc_codec, delayed_work.work); |
1503 | wm8753_dapm_event(codec, codec->dapm_state); | 1503 | wm8753_set_bias_level(codec, codec->bias_level); |
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | static int wm8753_suspend(struct platform_device *pdev, pm_message_t state) | 1506 | static int wm8753_suspend(struct platform_device *pdev, pm_message_t state) |
@@ -1512,7 +1512,7 @@ static int wm8753_suspend(struct platform_device *pdev, pm_message_t state) | |||
1512 | if (!codec->card) | 1512 | if (!codec->card) |
1513 | return 0; | 1513 | return 0; |
1514 | 1514 | ||
1515 | wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 1515 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1516 | return 0; | 1516 | return 0; |
1517 | } | 1517 | } |
1518 | 1518 | ||
@@ -1537,12 +1537,12 @@ static int wm8753_resume(struct platform_device *pdev) | |||
1537 | codec->hw_write(codec->control_data, data, 2); | 1537 | codec->hw_write(codec->control_data, data, 2); |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 1540 | wm8753_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1541 | 1541 | ||
1542 | /* charge wm8753 caps */ | 1542 | /* charge wm8753 caps */ |
1543 | if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) { | 1543 | if (codec->suspend_bias_level == SND_SOC_BIAS_ON) { |
1544 | wm8753_dapm_event(codec, SNDRV_CTL_POWER_D2); | 1544 | wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE); |
1545 | codec->dapm_state = SNDRV_CTL_POWER_D0; | 1545 | codec->bias_level = SND_SOC_BIAS_ON; |
1546 | schedule_delayed_work(&codec->delayed_work, | 1546 | schedule_delayed_work(&codec->delayed_work, |
1547 | msecs_to_jiffies(caps_charge)); | 1547 | msecs_to_jiffies(caps_charge)); |
1548 | } | 1548 | } |
@@ -1563,7 +1563,7 @@ static int wm8753_init(struct snd_soc_device *socdev) | |||
1563 | codec->owner = THIS_MODULE; | 1563 | codec->owner = THIS_MODULE; |
1564 | codec->read = wm8753_read_reg_cache; | 1564 | codec->read = wm8753_read_reg_cache; |
1565 | codec->write = wm8753_write; | 1565 | codec->write = wm8753_write; |
1566 | codec->dapm_event = wm8753_dapm_event; | 1566 | codec->set_bias_level = wm8753_set_bias_level; |
1567 | codec->dai = wm8753_dai; | 1567 | codec->dai = wm8753_dai; |
1568 | codec->num_dai = 2; | 1568 | codec->num_dai = 2; |
1569 | codec->reg_cache_size = sizeof(wm8753_reg); | 1569 | codec->reg_cache_size = sizeof(wm8753_reg); |
@@ -1584,8 +1584,8 @@ static int wm8753_init(struct snd_soc_device *socdev) | |||
1584 | } | 1584 | } |
1585 | 1585 | ||
1586 | /* charge output caps */ | 1586 | /* charge output caps */ |
1587 | wm8753_dapm_event(codec, SNDRV_CTL_POWER_D2); | 1587 | wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE); |
1588 | codec->dapm_state = SNDRV_CTL_POWER_D3hot; | 1588 | codec->bias_level = SND_SOC_BIAS_STANDBY; |
1589 | schedule_delayed_work(&codec->delayed_work, | 1589 | schedule_delayed_work(&codec->delayed_work, |
1590 | msecs_to_jiffies(caps_charge)); | 1590 | msecs_to_jiffies(caps_charge)); |
1591 | 1591 | ||
@@ -1792,7 +1792,7 @@ static int wm8753_remove(struct platform_device *pdev) | |||
1792 | struct snd_soc_codec *codec = socdev->codec; | 1792 | struct snd_soc_codec *codec = socdev->codec; |
1793 | 1793 | ||
1794 | if (codec->control_data) | 1794 | if (codec->control_data) |
1795 | wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 1795 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1796 | run_delayed_work(&codec->delayed_work); | 1796 | run_delayed_work(&codec->delayed_work); |
1797 | snd_soc_free_pcms(socdev); | 1797 | snd_soc_free_pcms(socdev); |
1798 | snd_soc_dapm_free(socdev); | 1798 | snd_soc_dapm_free(socdev); |
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 89efe40c7c33..e26cfcf0b4fc 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -571,23 +571,23 @@ struct snd_soc_codec_dai wm9712_dai[] = { | |||
571 | }; | 571 | }; |
572 | EXPORT_SYMBOL_GPL(wm9712_dai); | 572 | EXPORT_SYMBOL_GPL(wm9712_dai); |
573 | 573 | ||
574 | static int wm9712_dapm_event(struct snd_soc_codec *codec, int event) | 574 | static int wm9712_set_bias_level(struct snd_soc_codec *codec, |
575 | enum snd_soc_bias_level level) | ||
575 | { | 576 | { |
576 | switch (event) { | 577 | switch (level) { |
577 | case SNDRV_CTL_POWER_D0: /* full On */ | 578 | case SND_SOC_BIAS_ON: |
578 | case SNDRV_CTL_POWER_D1: /* partial On */ | 579 | case SND_SOC_BIAS_PREPARE: |
579 | case SNDRV_CTL_POWER_D2: /* partial On */ | ||
580 | break; | 580 | break; |
581 | case SNDRV_CTL_POWER_D3hot: /* Off, with power */ | 581 | case SND_SOC_BIAS_STANDBY: |
582 | ac97_write(codec, AC97_POWERDOWN, 0x0000); | 582 | ac97_write(codec, AC97_POWERDOWN, 0x0000); |
583 | break; | 583 | break; |
584 | case SNDRV_CTL_POWER_D3cold: /* Off, without power */ | 584 | case SND_SOC_BIAS_OFF: |
585 | /* disable everything including AC link */ | 585 | /* disable everything including AC link */ |
586 | ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); | 586 | ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); |
587 | ac97_write(codec, AC97_POWERDOWN, 0xffff); | 587 | ac97_write(codec, AC97_POWERDOWN, 0xffff); |
588 | break; | 588 | break; |
589 | } | 589 | } |
590 | codec->dapm_state = event; | 590 | codec->bias_level = level; |
591 | return 0; | 591 | return 0; |
592 | } | 592 | } |
593 | 593 | ||
@@ -615,7 +615,7 @@ static int wm9712_soc_suspend(struct platform_device *pdev, | |||
615 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 615 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
616 | struct snd_soc_codec *codec = socdev->codec; | 616 | struct snd_soc_codec *codec = socdev->codec; |
617 | 617 | ||
618 | wm9712_dapm_event(codec, SNDRV_CTL_POWER_D3cold); | 618 | wm9712_set_bias_level(codec, SND_SOC_BIAS_OFF); |
619 | return 0; | 619 | return 0; |
620 | } | 620 | } |
621 | 621 | ||
@@ -632,7 +632,7 @@ static int wm9712_soc_resume(struct platform_device *pdev) | |||
632 | return ret; | 632 | return ret; |
633 | } | 633 | } |
634 | 634 | ||
635 | wm9712_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 635 | wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
636 | 636 | ||
637 | if (ret == 0) { | 637 | if (ret == 0) { |
638 | /* Sync reg_cache with the hardware after cold reset */ | 638 | /* Sync reg_cache with the hardware after cold reset */ |
@@ -644,8 +644,8 @@ static int wm9712_soc_resume(struct platform_device *pdev) | |||
644 | } | 644 | } |
645 | } | 645 | } |
646 | 646 | ||
647 | if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) | 647 | if (codec->suspend_bias_level == SND_SOC_BIAS_ON) |
648 | wm9712_dapm_event(codec, SNDRV_CTL_POWER_D0); | 648 | wm9712_set_bias_level(codec, SND_SOC_BIAS_ON); |
649 | 649 | ||
650 | return ret; | 650 | return ret; |
651 | } | 651 | } |
@@ -679,7 +679,7 @@ static int wm9712_soc_probe(struct platform_device *pdev) | |||
679 | codec->num_dai = ARRAY_SIZE(wm9712_dai); | 679 | codec->num_dai = ARRAY_SIZE(wm9712_dai); |
680 | codec->write = ac97_write; | 680 | codec->write = ac97_write; |
681 | codec->read = ac97_read; | 681 | codec->read = ac97_read; |
682 | codec->dapm_event = wm9712_dapm_event; | 682 | codec->set_bias_level = wm9712_set_bias_level; |
683 | INIT_LIST_HEAD(&codec->dapm_widgets); | 683 | INIT_LIST_HEAD(&codec->dapm_widgets); |
684 | INIT_LIST_HEAD(&codec->dapm_paths); | 684 | INIT_LIST_HEAD(&codec->dapm_paths); |
685 | 685 | ||
@@ -703,7 +703,7 @@ static int wm9712_soc_probe(struct platform_device *pdev) | |||
703 | /* set alc mux to none */ | 703 | /* set alc mux to none */ |
704 | ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); | 704 | ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); |
705 | 705 | ||
706 | wm9712_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 706 | wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
707 | wm9712_add_controls(codec); | 707 | wm9712_add_controls(codec); |
708 | wm9712_add_widgets(codec); | 708 | wm9712_add_widgets(codec); |
709 | ret = snd_soc_register_card(socdev); | 709 | ret = snd_soc_register_card(socdev); |
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 9e6b2fd7262b..4863636e9d56 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1094,33 +1094,33 @@ int wm9713_reset(struct snd_soc_codec *codec, int try_warm) | |||
1094 | } | 1094 | } |
1095 | EXPORT_SYMBOL_GPL(wm9713_reset); | 1095 | EXPORT_SYMBOL_GPL(wm9713_reset); |
1096 | 1096 | ||
1097 | static int wm9713_dapm_event(struct snd_soc_codec *codec, int event) | 1097 | static int wm9713_set_bias_level(struct snd_soc_codec *codec, |
1098 | enum snd_soc_bias_level level) | ||
1098 | { | 1099 | { |
1099 | u16 reg; | 1100 | u16 reg; |
1100 | 1101 | ||
1101 | switch (event) { | 1102 | switch (level) { |
1102 | case SNDRV_CTL_POWER_D0: /* full On */ | 1103 | case SND_SOC_BIAS_ON: |
1103 | /* enable thermal shutdown */ | 1104 | /* enable thermal shutdown */ |
1104 | reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff; | 1105 | reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff; |
1105 | ac97_write(codec, AC97_EXTENDED_MID, reg); | 1106 | ac97_write(codec, AC97_EXTENDED_MID, reg); |
1106 | break; | 1107 | break; |
1107 | case SNDRV_CTL_POWER_D1: /* partial On */ | 1108 | case SND_SOC_BIAS_PREPARE: |
1108 | case SNDRV_CTL_POWER_D2: /* partial On */ | ||
1109 | break; | 1109 | break; |
1110 | case SNDRV_CTL_POWER_D3hot: /* Off, with power */ | 1110 | case SND_SOC_BIAS_STANDBY: |
1111 | /* enable master bias and vmid */ | 1111 | /* enable master bias and vmid */ |
1112 | reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff; | 1112 | reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff; |
1113 | ac97_write(codec, AC97_EXTENDED_MID, reg); | 1113 | ac97_write(codec, AC97_EXTENDED_MID, reg); |
1114 | ac97_write(codec, AC97_POWERDOWN, 0x0000); | 1114 | ac97_write(codec, AC97_POWERDOWN, 0x0000); |
1115 | break; | 1115 | break; |
1116 | case SNDRV_CTL_POWER_D3cold: /* Off, without power */ | 1116 | case SND_SOC_BIAS_OFF: |
1117 | /* disable everything including AC link */ | 1117 | /* disable everything including AC link */ |
1118 | ac97_write(codec, AC97_EXTENDED_MID, 0xffff); | 1118 | ac97_write(codec, AC97_EXTENDED_MID, 0xffff); |
1119 | ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); | 1119 | ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); |
1120 | ac97_write(codec, AC97_POWERDOWN, 0xffff); | 1120 | ac97_write(codec, AC97_POWERDOWN, 0xffff); |
1121 | break; | 1121 | break; |
1122 | } | 1122 | } |
1123 | codec->dapm_state = event; | 1123 | codec->bias_level = level; |
1124 | return 0; | 1124 | return 0; |
1125 | } | 1125 | } |
1126 | 1126 | ||
@@ -1157,7 +1157,7 @@ static int wm9713_soc_resume(struct platform_device *pdev) | |||
1157 | return ret; | 1157 | return ret; |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | wm9713_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 1160 | wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1161 | 1161 | ||
1162 | /* do we need to re-start the PLL ? */ | 1162 | /* do we need to re-start the PLL ? */ |
1163 | if (wm9713->pll_out) | 1163 | if (wm9713->pll_out) |
@@ -1173,8 +1173,8 @@ static int wm9713_soc_resume(struct platform_device *pdev) | |||
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) | 1176 | if (codec->suspend_bias_level == SND_SOC_BIAS_ON) |
1177 | wm9713_dapm_event(codec, SNDRV_CTL_POWER_D0); | 1177 | wm9713_set_bias_level(codec, SND_SOC_BIAS_ON); |
1178 | 1178 | ||
1179 | return ret; | 1179 | return ret; |
1180 | } | 1180 | } |
@@ -1213,7 +1213,7 @@ static int wm9713_soc_probe(struct platform_device *pdev) | |||
1213 | codec->num_dai = ARRAY_SIZE(wm9713_dai); | 1213 | codec->num_dai = ARRAY_SIZE(wm9713_dai); |
1214 | codec->write = ac97_write; | 1214 | codec->write = ac97_write; |
1215 | codec->read = ac97_read; | 1215 | codec->read = ac97_read; |
1216 | codec->dapm_event = wm9713_dapm_event; | 1216 | codec->set_bias_level = wm9713_set_bias_level; |
1217 | INIT_LIST_HEAD(&codec->dapm_widgets); | 1217 | INIT_LIST_HEAD(&codec->dapm_widgets); |
1218 | INIT_LIST_HEAD(&codec->dapm_paths); | 1218 | INIT_LIST_HEAD(&codec->dapm_paths); |
1219 | 1219 | ||
@@ -1235,7 +1235,7 @@ static int wm9713_soc_probe(struct platform_device *pdev) | |||
1235 | goto reset_err; | 1235 | goto reset_err; |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | wm9713_dapm_event(codec, SNDRV_CTL_POWER_D3hot); | 1238 | wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1239 | 1239 | ||
1240 | /* unmute the adc - move to kcontrol */ | 1240 | /* unmute the adc - move to kcontrol */ |
1241 | reg = ac97_read(codec, AC97_CD) & 0x7fff; | 1241 | reg = ac97_read(codec, AC97_CD) & 0x7fff; |