diff options
| -rw-r--r-- | include/sound/uda134x.h | 12 | ||||
| -rw-r--r-- | sound/soc/codecs/twl6040.c | 23 | ||||
| -rw-r--r-- | sound/soc/codecs/uda134x.c | 32 | ||||
| -rw-r--r-- | sound/soc/codecs/uda1380.c | 20 | ||||
| -rw-r--r-- | sound/soc/codecs/wl1273.c | 10 |
5 files changed, 8 insertions, 89 deletions
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h index e475659bd3be..509efb050176 100644 --- a/include/sound/uda134x.h +++ b/include/sound/uda134x.h | |||
| @@ -18,18 +18,6 @@ struct uda134x_platform_data { | |||
| 18 | struct l3_pins l3; | 18 | struct l3_pins l3; |
| 19 | void (*power) (int); | 19 | void (*power) (int); |
| 20 | int model; | 20 | int model; |
| 21 | /* | ||
| 22 | ALSA SOC usually puts the device in standby mode when it's not used | ||
| 23 | for sometime. If you unset is_powered_on_standby the driver will | ||
| 24 | turn off the ADC/DAC when this callback is invoked and turn it back | ||
| 25 | on when needed. Unfortunately this will result in a very light bump | ||
| 26 | (it can be audible only with good earphones). If this bothers you | ||
| 27 | set is_powered_on_standby, you will have slightly higher power | ||
| 28 | consumption. Please note that sending the L3 command for ADC is | ||
| 29 | enough to make the bump, so it doesn't make difference if you | ||
| 30 | completely take off power from the codec. | ||
| 31 | */ | ||
| 32 | int is_powered_on_standby; | ||
| 33 | #define UDA134X_UDA1340 1 | 21 | #define UDA134X_UDA1340 1 |
| 34 | #define UDA134X_UDA1341 2 | 22 | #define UDA134X_UDA1341 2 |
| 35 | #define UDA134X_UDA1344 3 | 23 | #define UDA134X_UDA1344 3 |
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 0f6067f04e29..5ff2b1e4638e 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
| @@ -1095,25 +1095,6 @@ static struct snd_soc_dai_driver twl6040_dai[] = { | |||
| 1095 | }, | 1095 | }, |
| 1096 | }; | 1096 | }; |
| 1097 | 1097 | ||
| 1098 | #ifdef CONFIG_PM | ||
| 1099 | static int twl6040_suspend(struct snd_soc_codec *codec) | ||
| 1100 | { | ||
| 1101 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 1102 | |||
| 1103 | return 0; | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | static int twl6040_resume(struct snd_soc_codec *codec) | ||
| 1107 | { | ||
| 1108 | twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 1109 | |||
| 1110 | return 0; | ||
| 1111 | } | ||
| 1112 | #else | ||
| 1113 | #define twl6040_suspend NULL | ||
| 1114 | #define twl6040_resume NULL | ||
| 1115 | #endif | ||
| 1116 | |||
| 1117 | static int twl6040_probe(struct snd_soc_codec *codec) | 1098 | static int twl6040_probe(struct snd_soc_codec *codec) |
| 1118 | { | 1099 | { |
| 1119 | struct twl6040_data *priv; | 1100 | struct twl6040_data *priv; |
| @@ -1160,7 +1141,6 @@ static int twl6040_remove(struct snd_soc_codec *codec) | |||
| 1160 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); | 1141 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); |
| 1161 | 1142 | ||
| 1162 | free_irq(priv->plug_irq, codec); | 1143 | free_irq(priv->plug_irq, codec); |
| 1163 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 1164 | 1144 | ||
| 1165 | return 0; | 1145 | return 0; |
| 1166 | } | 1146 | } |
| @@ -1168,11 +1148,10 @@ static int twl6040_remove(struct snd_soc_codec *codec) | |||
| 1168 | static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { | 1148 | static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { |
| 1169 | .probe = twl6040_probe, | 1149 | .probe = twl6040_probe, |
| 1170 | .remove = twl6040_remove, | 1150 | .remove = twl6040_remove, |
| 1171 | .suspend = twl6040_suspend, | ||
| 1172 | .resume = twl6040_resume, | ||
| 1173 | .read = twl6040_read, | 1151 | .read = twl6040_read, |
| 1174 | .write = twl6040_write, | 1152 | .write = twl6040_write, |
| 1175 | .set_bias_level = twl6040_set_bias_level, | 1153 | .set_bias_level = twl6040_set_bias_level, |
| 1154 | .suspend_bias_off = true, | ||
| 1176 | .ignore_pmdown_time = true, | 1155 | .ignore_pmdown_time = true, |
| 1177 | 1156 | ||
| 1178 | .controls = twl6040_snd_controls, | 1157 | .controls = twl6040_snd_controls, |
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 32b2f78aa62c..4056260a502e 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
| @@ -518,11 +518,6 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) | |||
| 518 | 518 | ||
| 519 | uda134x_reset(codec); | 519 | uda134x_reset(codec); |
| 520 | 520 | ||
| 521 | if (pd->is_powered_on_standby) | ||
| 522 | uda134x_set_bias_level(codec, SND_SOC_BIAS_ON); | ||
| 523 | else | ||
| 524 | uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 525 | |||
| 526 | if (pd->model == UDA134X_UDA1341) { | 521 | if (pd->model == UDA134X_UDA1341) { |
| 527 | widgets = uda1341_dapm_widgets; | 522 | widgets = uda1341_dapm_widgets; |
| 528 | num_widgets = ARRAY_SIZE(uda1341_dapm_widgets); | 523 | num_widgets = ARRAY_SIZE(uda1341_dapm_widgets); |
| @@ -574,44 +569,21 @@ static int uda134x_soc_remove(struct snd_soc_codec *codec) | |||
| 574 | { | 569 | { |
| 575 | struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); | 570 | struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); |
| 576 | 571 | ||
| 577 | uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 578 | uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 579 | |||
| 580 | kfree(uda134x); | 572 | kfree(uda134x); |
| 581 | return 0; | 573 | return 0; |
| 582 | } | 574 | } |
| 583 | 575 | ||
| 584 | #if defined(CONFIG_PM) | ||
| 585 | static int uda134x_soc_suspend(struct snd_soc_codec *codec) | ||
| 586 | { | ||
| 587 | uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 588 | uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 589 | return 0; | ||
| 590 | } | ||
| 591 | |||
| 592 | static int uda134x_soc_resume(struct snd_soc_codec *codec) | ||
| 593 | { | ||
| 594 | uda134x_set_bias_level(codec, SND_SOC_BIAS_PREPARE); | ||
| 595 | uda134x_set_bias_level(codec, SND_SOC_BIAS_ON); | ||
| 596 | return 0; | ||
| 597 | } | ||
| 598 | #else | ||
| 599 | #define uda134x_soc_suspend NULL | ||
| 600 | #define uda134x_soc_resume NULL | ||
| 601 | #endif /* CONFIG_PM */ | ||
| 602 | |||
| 603 | static struct snd_soc_codec_driver soc_codec_dev_uda134x = { | 576 | static struct snd_soc_codec_driver soc_codec_dev_uda134x = { |
| 604 | .probe = uda134x_soc_probe, | 577 | .probe = uda134x_soc_probe, |
| 605 | .remove = uda134x_soc_remove, | 578 | .remove = uda134x_soc_remove, |
| 606 | .suspend = uda134x_soc_suspend, | ||
| 607 | .resume = uda134x_soc_resume, | ||
| 608 | .reg_cache_size = sizeof(uda134x_reg), | 579 | .reg_cache_size = sizeof(uda134x_reg), |
| 609 | .reg_word_size = sizeof(u8), | 580 | .reg_word_size = sizeof(u8), |
| 610 | .reg_cache_default = uda134x_reg, | 581 | .reg_cache_default = uda134x_reg, |
| 611 | .reg_cache_step = 1, | 582 | .reg_cache_step = 1, |
| 612 | .read = uda134x_read_reg_cache, | 583 | .read = uda134x_read_reg_cache, |
| 613 | .write = uda134x_write, | ||
| 614 | .set_bias_level = uda134x_set_bias_level, | 584 | .set_bias_level = uda134x_set_bias_level, |
| 585 | .suspend_bias_off = true, | ||
| 586 | |||
| 615 | .dapm_widgets = uda134x_dapm_widgets, | 587 | .dapm_widgets = uda134x_dapm_widgets, |
| 616 | .num_dapm_widgets = ARRAY_SIZE(uda134x_dapm_widgets), | 588 | .num_dapm_widgets = ARRAY_SIZE(uda134x_dapm_widgets), |
| 617 | .dapm_routes = uda134x_dapm_routes, | 589 | .dapm_routes = uda134x_dapm_routes, |
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index e62e70781ec2..dc7778b6dd7f 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
| @@ -693,18 +693,6 @@ static struct snd_soc_dai_driver uda1380_dai[] = { | |||
| 693 | }, | 693 | }, |
| 694 | }; | 694 | }; |
| 695 | 695 | ||
| 696 | static int uda1380_suspend(struct snd_soc_codec *codec) | ||
| 697 | { | ||
| 698 | uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 699 | return 0; | ||
| 700 | } | ||
| 701 | |||
| 702 | static int uda1380_resume(struct snd_soc_codec *codec) | ||
| 703 | { | ||
| 704 | uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 705 | return 0; | ||
| 706 | } | ||
| 707 | |||
| 708 | static int uda1380_probe(struct snd_soc_codec *codec) | 696 | static int uda1380_probe(struct snd_soc_codec *codec) |
| 709 | { | 697 | { |
| 710 | struct uda1380_platform_data *pdata =codec->dev->platform_data; | 698 | struct uda1380_platform_data *pdata =codec->dev->platform_data; |
| @@ -739,8 +727,6 @@ static int uda1380_probe(struct snd_soc_codec *codec) | |||
| 739 | 727 | ||
| 740 | INIT_WORK(&uda1380->work, uda1380_flush_work); | 728 | INIT_WORK(&uda1380->work, uda1380_flush_work); |
| 741 | 729 | ||
| 742 | /* power on device */ | ||
| 743 | uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
| 744 | /* set clock input */ | 730 | /* set clock input */ |
| 745 | switch (pdata->dac_clk) { | 731 | switch (pdata->dac_clk) { |
| 746 | case UDA1380_DAC_CLK_SYSCLK: | 732 | case UDA1380_DAC_CLK_SYSCLK: |
| @@ -766,8 +752,6 @@ static int uda1380_remove(struct snd_soc_codec *codec) | |||
| 766 | { | 752 | { |
| 767 | struct uda1380_platform_data *pdata =codec->dev->platform_data; | 753 | struct uda1380_platform_data *pdata =codec->dev->platform_data; |
| 768 | 754 | ||
| 769 | uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
| 770 | |||
| 771 | gpio_free(pdata->gpio_reset); | 755 | gpio_free(pdata->gpio_reset); |
| 772 | gpio_free(pdata->gpio_power); | 756 | gpio_free(pdata->gpio_power); |
| 773 | 757 | ||
| @@ -777,11 +761,11 @@ static int uda1380_remove(struct snd_soc_codec *codec) | |||
| 777 | static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { | 761 | static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { |
| 778 | .probe = uda1380_probe, | 762 | .probe = uda1380_probe, |
| 779 | .remove = uda1380_remove, | 763 | .remove = uda1380_remove, |
| 780 | .suspend = uda1380_suspend, | ||
| 781 | .resume = uda1380_resume, | ||
| 782 | .read = uda1380_read_reg_cache, | 764 | .read = uda1380_read_reg_cache, |
| 783 | .write = uda1380_write, | 765 | .write = uda1380_write, |
| 784 | .set_bias_level = uda1380_set_bias_level, | 766 | .set_bias_level = uda1380_set_bias_level, |
| 767 | .suspend_bias_off = true, | ||
| 768 | |||
| 785 | .reg_cache_size = ARRAY_SIZE(uda1380_reg), | 769 | .reg_cache_size = ARRAY_SIZE(uda1380_reg), |
| 786 | .reg_word_size = sizeof(u16), | 770 | .reg_word_size = sizeof(u16), |
| 787 | .reg_cache_default = uda1380_reg, | 771 | .reg_cache_default = uda1380_reg, |
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index f3d4e88d0b7b..00aea4100bb3 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c | |||
| @@ -452,7 +452,6 @@ static int wl1273_probe(struct snd_soc_codec *codec) | |||
| 452 | { | 452 | { |
| 453 | struct wl1273_core **core = codec->dev->platform_data; | 453 | struct wl1273_core **core = codec->dev->platform_data; |
| 454 | struct wl1273_priv *wl1273; | 454 | struct wl1273_priv *wl1273; |
| 455 | int r; | ||
| 456 | 455 | ||
| 457 | dev_dbg(codec->dev, "%s.\n", __func__); | 456 | dev_dbg(codec->dev, "%s.\n", __func__); |
| 458 | 457 | ||
| @@ -470,12 +469,7 @@ static int wl1273_probe(struct snd_soc_codec *codec) | |||
| 470 | 469 | ||
| 471 | snd_soc_codec_set_drvdata(codec, wl1273); | 470 | snd_soc_codec_set_drvdata(codec, wl1273); |
| 472 | 471 | ||
| 473 | r = snd_soc_add_codec_controls(codec, wl1273_controls, | 472 | return 0; |
| 474 | ARRAY_SIZE(wl1273_controls)); | ||
| 475 | if (r) | ||
| 476 | kfree(wl1273); | ||
| 477 | |||
| 478 | return r; | ||
| 479 | } | 473 | } |
| 480 | 474 | ||
| 481 | static int wl1273_remove(struct snd_soc_codec *codec) | 475 | static int wl1273_remove(struct snd_soc_codec *codec) |
| @@ -492,6 +486,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wl1273 = { | |||
| 492 | .probe = wl1273_probe, | 486 | .probe = wl1273_probe, |
| 493 | .remove = wl1273_remove, | 487 | .remove = wl1273_remove, |
| 494 | 488 | ||
| 489 | .controls = wl1273_controls, | ||
| 490 | .num_controls = ARRAY_SIZE(wl1273_controls), | ||
| 495 | .dapm_widgets = wl1273_dapm_widgets, | 491 | .dapm_widgets = wl1273_dapm_widgets, |
| 496 | .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), | 492 | .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), |
| 497 | .dapm_routes = wl1273_dapm_routes, | 493 | .dapm_routes = wl1273_dapm_routes, |
