Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'topic/dapm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-tas751x

+149 -168
+34
include/sound/soc-dapm.h
··· 444 444 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( 445 445 struct snd_kcontrol *kcontrol); 446 446 447 + int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, 448 + enum snd_soc_bias_level level); 449 + 447 450 /* dapm widget types */ 448 451 enum snd_soc_dapm_type { 449 452 snd_soc_dapm_input = 0, /* input pin */ ··· 625 622 int path_checks; 626 623 int neighbour_checks; 627 624 }; 625 + 626 + /** 627 + * snd_soc_dapm_init_bias_level() - Initialize DAPM bias level 628 + * @dapm: The DAPM context to initialize 629 + * @level: The DAPM level to initialize to 630 + * 631 + * This function only sets the driver internal state of the DAPM level and will 632 + * not modify the state of the device. Hence it should not be used during normal 633 + * operation, but only to synchronize the internal state to the device state. 634 + * E.g. during driver probe to set the DAPM level to the one corresponding with 635 + * the power-on reset state of the device. 636 + * 637 + * To change the DAPM state of the device use snd_soc_dapm_set_bias_level(). 638 + */ 639 + static inline void snd_soc_dapm_init_bias_level( 640 + struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) 641 + { 642 + dapm->bias_level = level; 643 + } 644 + 645 + /** 646 + * snd_soc_dapm_get_bias_level() - Get current DAPM bias level 647 + * @dapm: The context for which to get the bias level 648 + * 649 + * Returns: The current bias level of the passed DAPM context. 650 + */ 651 + static inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level( 652 + struct snd_soc_dapm_context *dapm) 653 + { 654 + return dapm->bias_level; 655 + } 628 656 629 657 #endif
+53 -1
include/sound/soc.h
··· 807 807 /* component */ 808 808 struct snd_soc_component component; 809 809 810 - /* dapm */ 810 + /* Don't access this directly, use snd_soc_codec_get_dapm() */ 811 811 struct snd_soc_dapm_context dapm; 812 812 813 813 #ifdef CONFIG_DEBUG_FS ··· 1267 1267 struct snd_soc_component *component) 1268 1268 { 1269 1269 return component->dapm_ptr; 1270 + } 1271 + 1272 + /** 1273 + * snd_soc_codec_get_dapm() - Returns the DAPM context for the CODEC 1274 + * @codec: The CODEC for which to get the DAPM context 1275 + * 1276 + * Note: Use this function instead of directly accessing the CODEC's dapm field 1277 + */ 1278 + static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm( 1279 + struct snd_soc_codec *codec) 1280 + { 1281 + return &codec->dapm; 1282 + } 1283 + 1284 + /** 1285 + * snd_soc_dapm_init_bias_level() - Initialize CODEC DAPM bias level 1286 + * @dapm: The CODEC for which to initialize the DAPM bias level 1287 + * @level: The DAPM level to initialize to 1288 + * 1289 + * Initializes the CODEC DAPM bias level. See snd_soc_dapm_init_bias_level(). 1290 + */ 1291 + static inline void snd_soc_codec_init_bias_level(struct snd_soc_codec *codec, 1292 + enum snd_soc_bias_level level) 1293 + { 1294 + snd_soc_dapm_init_bias_level(snd_soc_codec_get_dapm(codec), level); 1295 + } 1296 + 1297 + /** 1298 + * snd_soc_dapm_get_bias_level() - Get current CODEC DAPM bias level 1299 + * @codec: The CODEC for which to get the DAPM bias level 1300 + * 1301 + * Returns: The current DAPM bias level of the CODEC. 1302 + */ 1303 + static inline enum snd_soc_bias_level snd_soc_codec_get_bias_level( 1304 + struct snd_soc_codec *codec) 1305 + { 1306 + return snd_soc_dapm_get_bias_level(snd_soc_codec_get_dapm(codec)); 1307 + } 1308 + 1309 + /** 1310 + * snd_soc_codec_force_bias_level() - Set the CODEC DAPM bias level 1311 + * @codec: The CODEC for which to set the level 1312 + * @level: The level to set to 1313 + * 1314 + * Forces the CODEC bias level to a specific state. See 1315 + * snd_soc_dapm_force_bias_level(). 1316 + */ 1317 + static inline int snd_soc_codec_force_bias_level(struct snd_soc_codec *codec, 1318 + enum snd_soc_bias_level level) 1319 + { 1320 + return snd_soc_dapm_force_bias_level(snd_soc_codec_get_dapm(codec), 1321 + level); 1270 1322 } 1271 1323 1272 1324 /**
-1
sound/soc/codecs/88pm860x-codec.c
··· 1156 1156 pm860x_set_bits(pm860x->i2c, REG_MISC2, data, 0); 1157 1157 break; 1158 1158 } 1159 - codec->dapm.bias_level = level; 1160 1159 return 0; 1161 1160 } 1162 1161
-1
sound/soc/codecs/adau1373.c
··· 1444 1444 ADAU1373_PWDN_CTRL3_PWR_EN, 0); 1445 1445 break; 1446 1446 } 1447 - codec->dapm.bias_level = level; 1448 1447 return 0; 1449 1448 } 1450 1449
-1
sound/soc/codecs/adau1701.c
··· 565 565 break; 566 566 } 567 567 568 - codec->dapm.bias_level = level; 569 568 return 0; 570 569 } 571 570
-1
sound/soc/codecs/adau1761.c
··· 466 466 break; 467 467 468 468 } 469 - codec->dapm.bias_level = level; 470 469 return 0; 471 470 } 472 471
-1
sound/soc/codecs/adau1781.c
··· 339 339 break; 340 340 } 341 341 342 - codec->dapm.bias_level = level; 343 342 return 0; 344 343 } 345 344
+1 -6
sound/soc/codecs/adau1977.c
··· 493 493 break; 494 494 } 495 495 496 - if (ret) 497 - return ret; 498 - 499 - codec->dapm.bias_level = level; 500 - 501 - return 0; 496 + return ret; 502 497 } 503 498 504 499 static int adau1977_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
-1
sound/soc/codecs/adav80x.c
··· 714 714 break; 715 715 } 716 716 717 - codec->dapm.bias_level = level; 718 717 return 0; 719 718 } 720 719
-1
sound/soc/codecs/ak4535.c
··· 341 341 snd_soc_update_bits(codec, AK4535_PM1, 0x80, 0); 342 342 break; 343 343 } 344 - codec->dapm.bias_level = level; 345 344 return 0; 346 345 } 347 346
-1
sound/soc/codecs/ak4641.c
··· 439 439 regcache_mark_dirty(ak4641->regmap); 440 440 break; 441 441 } 442 - codec->dapm.bias_level = level; 443 442 return 0; 444 443 } 445 444
-1
sound/soc/codecs/ak4642.c
··· 482 482 snd_soc_update_bits(codec, PW_MGMT1, PMVCM, PMVCM); 483 483 break; 484 484 } 485 - codec->dapm.bias_level = level; 486 485 487 486 return 0; 488 487 }
-1
sound/soc/codecs/ak4671.c
··· 577 577 snd_soc_write(codec, AK4671_AD_DA_POWER_MANAGEMENT, 0x00); 578 578 break; 579 579 } 580 - codec->dapm.bias_level = level; 581 580 return 0; 582 581 } 583 582
-1
sound/soc/codecs/alc5623.c
··· 826 826 snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, 0); 827 827 break; 828 828 } 829 - codec->dapm.bias_level = level; 830 829 return 0; 831 830 } 832 831
-1
sound/soc/codecs/alc5632.c
··· 1000 1000 ALC5632_PWR_MANAG_ADD1_MASK, 0); 1001 1001 break; 1002 1002 } 1003 - codec->dapm.bias_level = level; 1004 1003 return 0; 1005 1004 } 1006 1005
-1
sound/soc/codecs/cq93vc.c
··· 92 92 DAVINCI_VC_REG12_POWER_ALL_OFF); 93 93 break; 94 94 } 95 - codec->dapm.bias_level = level; 96 95 97 96 return 0; 98 97 }
-1
sound/soc/codecs/cs4265.c
··· 503 503 CS4265_PWRCTL_PDN); 504 504 break; 505 505 } 506 - codec->dapm.bias_level = level; 507 506 return 0; 508 507 } 509 508
-1
sound/soc/codecs/cs42l52.c
··· 908 908 regcache_cache_only(cs42l52->regmap, true); 909 909 break; 910 910 } 911 - codec->dapm.bias_level = level; 912 911 913 912 return 0; 914 913 }
-1
sound/soc/codecs/cs42l56.c
··· 978 978 cs42l56->supplies); 979 979 break; 980 980 } 981 - codec->dapm.bias_level = level; 982 981 983 982 return 0; 984 983 }
-1
sound/soc/codecs/cs42l73.c
··· 1228 1228 snd_soc_update_bits(codec, CS42L73_DMMCC, CS42L73_MCLKDIS, 1); 1229 1229 break; 1230 1230 } 1231 - codec->dapm.bias_level = level; 1232 1231 return 0; 1233 1232 } 1234 1233
-2
sound/soc/codecs/cx20442.c
··· 351 351 default: 352 352 break; 353 353 } 354 - if (!err) 355 - codec->dapm.bias_level = level; 356 354 357 355 return err; 358 356 }
-1
sound/soc/codecs/da7213.c
··· 1387 1387 DA7213_VMID_EN | DA7213_BIAS_EN, 0); 1388 1388 break; 1389 1389 } 1390 - codec->dapm.bias_level = level; 1391 1390 return 0; 1392 1391 } 1393 1392
-2
sound/soc/codecs/da732x.c
··· 1502 1502 break; 1503 1503 } 1504 1504 1505 - codec->dapm.bias_level = level; 1506 - 1507 1505 return 0; 1508 1506 } 1509 1507
-1
sound/soc/codecs/da9055.c
··· 1377 1377 DA9055_VMID_EN | DA9055_BIAS_EN, 0); 1378 1378 break; 1379 1379 } 1380 - codec->dapm.bias_level = level; 1381 1380 return 0; 1382 1381 } 1383 1382
-1
sound/soc/codecs/es8328.c
··· 566 566 0); 567 567 break; 568 568 } 569 - codec->dapm.bias_level = level; 570 569 return 0; 571 570 } 572 571
-2
sound/soc/codecs/isabelle.c
··· 909 909 break; 910 910 } 911 911 912 - codec->dapm.bias_level = level; 913 - 914 912 return 0; 915 913 } 916 914
-2
sound/soc/codecs/jz4740.c
··· 281 281 break; 282 282 } 283 283 284 - codec->dapm.bias_level = level; 285 - 286 284 return 0; 287 285 } 288 286
-2
sound/soc/codecs/lm4857.c
··· 89 89 break; 90 90 } 91 91 92 - codec->dapm.bias_level = level; 93 - 94 92 return 0; 95 93 } 96 94
-2
sound/soc/codecs/lm49453.c
··· 1284 1284 break; 1285 1285 } 1286 1286 1287 - codec->dapm.bias_level = level; 1288 - 1289 1287 return 0; 1290 1288 } 1291 1289
-1
sound/soc/codecs/max98088.c
··· 1584 1584 regcache_mark_dirty(max98088->regmap); 1585 1585 break; 1586 1586 } 1587 - codec->dapm.bias_level = level; 1588 1587 return 0; 1589 1588 } 1590 1589
-1
sound/soc/codecs/max98090.c
··· 1824 1824 regcache_mark_dirty(max98090->regmap); 1825 1825 break; 1826 1826 } 1827 - codec->dapm.bias_level = level; 1828 1827 return 0; 1829 1828 } 1830 1829
+2 -3
sound/soc/codecs/max98095.c
··· 1678 1678 regcache_mark_dirty(max98095->regmap); 1679 1679 break; 1680 1680 } 1681 - codec->dapm.bias_level = level; 1682 1681 return 0; 1683 1682 } 1684 1683 ··· 2197 2198 if (max98095->headphone_jack || max98095->mic_jack) 2198 2199 max98095_jack_detect_disable(codec); 2199 2200 2200 - max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); 2201 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 2201 2202 2202 2203 return 0; 2203 2204 } ··· 2207 2208 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 2208 2209 struct i2c_client *client = to_i2c_client(codec->dev); 2209 2210 2210 - max98095_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 2211 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 2211 2212 2212 2213 if (max98095->headphone_jack || max98095->mic_jack) { 2213 2214 max98095_jack_detect_enable(codec);
-1
sound/soc/codecs/max9850.c
··· 264 264 case SND_SOC_BIAS_OFF: 265 265 break; 266 266 } 267 - codec->dapm.bias_level = level; 268 267 return 0; 269 268 } 270 269
-1
sound/soc/codecs/ml26124.c
··· 536 536 ML26124_VMID, 0); 537 537 break; 538 538 } 539 - codec->dapm.bias_level = level; 540 539 return 0; 541 540 } 542 541
-2
sound/soc/codecs/pcm512x.c
··· 641 641 break; 642 642 } 643 643 644 - codec->dapm.bias_level = level; 645 - 646 644 return 0; 647 645 } 648 646
-1
sound/soc/codecs/rt286.c
··· 1012 1012 default: 1013 1013 break; 1014 1014 } 1015 - codec->dapm.bias_level = level; 1016 1015 1017 1016 return 0; 1018 1017 }
-1
sound/soc/codecs/rt5631.c
··· 1569 1569 default: 1570 1570 break; 1571 1571 } 1572 - codec->dapm.bias_level = level; 1573 1572 1574 1573 return 0; 1575 1574 }
+2 -3
sound/soc/codecs/rt5640.c
··· 1902 1902 default: 1903 1903 break; 1904 1904 } 1905 - codec->dapm.bias_level = level; 1906 1905 1907 1906 return 0; 1908 1907 } ··· 1938 1939 1939 1940 rt5640->codec = codec; 1940 1941 1941 - rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); 1942 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 1942 1943 1943 1944 snd_soc_update_bits(codec, RT5640_DUMMY1, 0x0301, 0x0301); 1944 1945 snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030); ··· 1990 1991 { 1991 1992 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); 1992 1993 1993 - rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); 1994 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 1994 1995 rt5640_reset(codec); 1995 1996 regcache_cache_only(rt5640->regmap, true); 1996 1997 regcache_mark_dirty(rt5640->regmap);
+1 -2
sound/soc/codecs/rt5645.c
··· 2409 2409 default: 2410 2410 break; 2411 2411 } 2412 - codec->dapm.bias_level = level; 2413 2412 2414 2413 return 0; 2415 2414 } ··· 2519 2520 break; 2520 2521 } 2521 2522 2522 - rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF); 2523 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 2523 2524 2524 2525 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200); 2525 2526
+1 -2
sound/soc/codecs/rt5651.c
··· 1604 1604 default: 1605 1605 break; 1606 1606 } 1607 - codec->dapm.bias_level = level; 1608 1607 1609 1608 return 0; 1610 1609 } ··· 1624 1625 RT5651_PWR_FV1 | RT5651_PWR_FV2, 1625 1626 RT5651_PWR_FV1 | RT5651_PWR_FV2); 1626 1627 1627 - rt5651_set_bias_level(codec, SND_SOC_BIAS_OFF); 1628 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 1628 1629 1629 1630 return 0; 1630 1631 }
-1
sound/soc/codecs/rt5670.c
··· 2647 2647 default: 2648 2648 break; 2649 2649 } 2650 - codec->dapm.bias_level = level; 2651 2650 2652 2651 return 0; 2653 2652 }
+1 -2
sound/soc/codecs/rt5677.c
··· 4392 4392 default: 4393 4393 break; 4394 4394 } 4395 - codec->dapm.bias_level = level; 4396 4395 4397 4396 return 0; 4398 4397 } ··· 4617 4618 ARRAY_SIZE(rt5677_dmic2_clk_1)); 4618 4619 } 4619 4620 4620 - rt5677_set_bias_level(codec, SND_SOC_BIAS_OFF); 4621 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 4621 4622 4622 4623 regmap_write(rt5677->regmap, RT5677_DIG_MISC, 0x0020); 4623 4624 regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00);
-1
sound/soc/codecs/sgtl5000.c
··· 979 979 break; 980 980 } 981 981 982 - codec->dapm.bias_level = level; 983 982 return 0; 984 983 } 985 984
-1
sound/soc/codecs/sn95031.c
··· 226 226 break; 227 227 } 228 228 229 - codec->dapm.bias_level = level; 230 229 return 0; 231 230 } 232 231
+1 -6
sound/soc/codecs/ssm2518.c
··· 518 518 break; 519 519 } 520 520 521 - if (ret) 522 - return ret; 523 - 524 - codec->dapm.bias_level = level; 525 - 526 - return 0; 521 + return ret; 527 522 } 528 523 529 524 static int ssm2518_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
-1
sound/soc/codecs/ssm2602.c
··· 473 473 break; 474 474 475 475 } 476 - codec->dapm.bias_level = level; 477 476 return 0; 478 477 } 479 478
+1 -6
sound/soc/codecs/ssm4567.c
··· 361 361 break; 362 362 } 363 363 364 - if (ret) 365 - return ret; 366 - 367 - codec->dapm.bias_level = level; 368 - 369 - return 0; 364 + return ret; 370 365 } 371 366 372 367 static const struct snd_soc_dai_ops ssm4567_dai_ops = {
+1 -2
sound/soc/codecs/sta32x.c
··· 854 854 sta32x->supplies); 855 855 break; 856 856 } 857 - codec->dapm.bias_level = level; 858 857 return 0; 859 858 } 860 859 ··· 969 970 if (sta32x->pdata->needs_esd_watchdog) 970 971 INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog); 971 972 972 - sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 973 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 973 974 /* Bias level configuration will have done an extra enable */ 974 975 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 975 976
+1 -2
sound/soc/codecs/sta350.c
··· 890 890 sta350->supplies); 891 891 break; 892 892 } 893 - codec->dapm.bias_level = level; 894 893 return 0; 895 894 } 896 895 ··· 1036 1037 sta350->coef_shadow[60] = 0x400000; 1037 1038 sta350->coef_shadow[61] = 0x400000; 1038 1039 1039 - sta350_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1040 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1040 1041 /* Bias level configuration will have done an extra enable */ 1041 1042 regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies); 1042 1043
-6
sound/soc/codecs/sta529.c
··· 179 179 break; 180 180 } 181 181 182 - /* 183 - * store the label for powers down audio subsystem for suspend.This is 184 - * used by soc core layer 185 - */ 186 - codec->dapm.bias_level = level; 187 - 188 182 return 0; 189 183 190 184 }
-1
sound/soc/codecs/stac9766.c
··· 236 236 stac9766_ac97_write(codec, AC97_POWERDOWN, 0xffff); 237 237 break; 238 238 } 239 - codec->dapm.bias_level = level; 240 239 return 0; 241 240 } 242 241
-1
sound/soc/codecs/tlv320aic23.c
··· 506 506 snd_soc_write(codec, TLV320AIC23_PWR, 0x1ff); 507 507 break; 508 508 } 509 - codec->dapm.bias_level = level; 510 509 return 0; 511 510 } 512 511
-1
sound/soc/codecs/tlv320aic31xx.c
··· 1053 1053 aic31xx_power_off(codec); 1054 1054 break; 1055 1055 } 1056 - codec->dapm.bias_level = level; 1057 1056 1058 1057 return 0; 1059 1058 }
-1
sound/soc/codecs/tlv320aic32x4.c
··· 564 564 case SND_SOC_BIAS_OFF: 565 565 break; 566 566 } 567 - codec->dapm.bias_level = level; 568 567 return 0; 569 568 } 570 569
-1
sound/soc/codecs/tlv320aic3x.c
··· 1406 1406 aic3x_set_power(codec, 0); 1407 1407 break; 1408 1408 } 1409 - codec->dapm.bias_level = level; 1410 1409 1411 1410 return 0; 1412 1411 }
-1
sound/soc/codecs/tlv320dac33.c
··· 651 651 return ret; 652 652 break; 653 653 } 654 - codec->dapm.bias_level = level; 655 654 656 655 return 0; 657 656 }
-1
sound/soc/codecs/twl4030.c
··· 1595 1595 twl4030_codec_enable(codec, 0); 1596 1596 break; 1597 1597 } 1598 - codec->dapm.bias_level = level; 1599 1598 1600 1599 return 0; 1601 1600 }
+1 -3
sound/soc/codecs/twl6040.c
··· 853 853 break; 854 854 } 855 855 856 - codec->dapm.bias_level = level; 857 - 858 856 return 0; 859 857 } 860 858 ··· 1128 1130 return ret; 1129 1131 } 1130 1132 1131 - twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1133 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1132 1134 twl6040_init_chip(codec); 1133 1135 1134 1136 return 0;
-1
sound/soc/codecs/uda134x.c
··· 350 350 pd->power(0); 351 351 break; 352 352 } 353 - codec->dapm.bias_level = level; 354 353 return 0; 355 354 } 356 355
-1
sound/soc/codecs/uda1380.c
··· 623 623 for (reg = UDA1380_MVOL; reg < UDA1380_CACHEREGNUM; reg++) 624 624 set_bit(reg - 0x10, &uda1380_cache_dirty); 625 625 } 626 - codec->dapm.bias_level = level; 627 626 return 0; 628 627 } 629 628
-2
sound/soc/codecs/wm0010.c
··· 767 767 break; 768 768 } 769 769 770 - codec->dapm.bias_level = level; 771 - 772 770 return 0; 773 771 } 774 772
-2
sound/soc/codecs/wm1250-ev1.c
··· 61 61 break; 62 62 } 63 63 64 - codec->dapm.bias_level = level; 65 - 66 64 return 0; 67 65 } 68 66
-1
sound/soc/codecs/wm8350.c
··· 1235 1235 priv->supplies); 1236 1236 break; 1237 1237 } 1238 - codec->dapm.bias_level = level; 1239 1238 return 0; 1240 1239 } 1241 1240
-1
sound/soc/codecs/wm8400.c
··· 1232 1232 break; 1233 1233 } 1234 1234 1235 - codec->dapm.bias_level = level; 1236 1235 return 0; 1237 1236 } 1238 1237
-1
sound/soc/codecs/wm8510.c
··· 538 538 break; 539 539 } 540 540 541 - codec->dapm.bias_level = level; 542 541 return 0; 543 542 } 544 543
-1
sound/soc/codecs/wm8523.c
··· 344 344 wm8523->supplies); 345 345 break; 346 346 } 347 - codec->dapm.bias_level = level; 348 347 return 0; 349 348 } 350 349
-1
sound/soc/codecs/wm8580.c
··· 812 812 WM8580_PWRDN1_PWDN, WM8580_PWRDN1_PWDN); 813 813 break; 814 814 } 815 - codec->dapm.bias_level = level; 816 815 return 0; 817 816 } 818 817
-1
sound/soc/codecs/wm8711.c
··· 320 320 snd_soc_write(codec, WM8711_PWR, 0xffff); 321 321 break; 322 322 } 323 - codec->dapm.bias_level = level; 324 323 return 0; 325 324 } 326 325
-1
sound/soc/codecs/wm8728.c
··· 185 185 snd_soc_write(codec, WM8728_DACCTL, reg | 0x4); 186 186 break; 187 187 } 188 - codec->dapm.bias_level = level; 189 188 return 0; 190 189 } 191 190
+1 -2
sound/soc/codecs/wm8731.c
··· 523 523 regcache_mark_dirty(wm8731->regmap); 524 524 break; 525 525 } 526 - codec->dapm.bias_level = level; 527 526 return 0; 528 527 } 529 528 ··· 598 599 goto err_regulator_enable; 599 600 } 600 601 601 - wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 602 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 602 603 603 604 /* Latch the update bits */ 604 605 snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0);
+1 -2
sound/soc/codecs/wm8737.c
··· 510 510 break; 511 511 } 512 512 513 - codec->dapm.bias_level = level; 514 513 return 0; 515 514 } 516 515 ··· 559 560 snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU, 560 561 WM8737_RVU); 561 562 562 - wm8737_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 563 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 563 564 564 565 /* Bias level configuration will have done an extra enable */ 565 566 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
-1
sound/soc/codecs/wm8750.c
··· 651 651 snd_soc_write(codec, WM8750_PWR1, 0x0001); 652 652 break; 653 653 } 654 - codec->dapm.bias_level = level; 655 654 return 0; 656 655 } 657 656
-1
sound/soc/codecs/wm8753.c
··· 1367 1367 snd_soc_write(codec, WM8753_PWR1, 0x0001); 1368 1368 break; 1369 1369 } 1370 - codec->dapm.bias_level = level; 1371 1370 return 0; 1372 1371 } 1373 1372
-1
sound/soc/codecs/wm8770.c
··· 534 534 break; 535 535 } 536 536 537 - codec->dapm.bias_level = level; 538 537 return 0; 539 538 } 540 539
-1
sound/soc/codecs/wm8776.c
··· 357 357 break; 358 358 } 359 359 360 - codec->dapm.bias_level = level; 361 360 return 0; 362 361 } 363 362
+3 -4
sound/soc/codecs/wm8900.c
··· 1117 1117 WM8900_REG_POWER2_SYSCLK_ENA); 1118 1118 break; 1119 1119 } 1120 - codec->dapm.bias_level = level; 1121 1120 return 0; 1122 1121 } 1123 1122 ··· 1137 1138 wm8900->fll_out = fll_out; 1138 1139 wm8900->fll_in = fll_in; 1139 1140 1140 - wm8900_set_bias_level(codec, SND_SOC_BIAS_OFF); 1141 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 1141 1142 1142 1143 return 0; 1143 1144 } ··· 1155 1156 return ret; 1156 1157 } 1157 1158 1158 - wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1159 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1159 1160 1160 1161 /* Restart the FLL? */ 1161 1162 if (wm8900->fll_out) { ··· 1188 1189 wm8900_reset(codec); 1189 1190 1190 1191 /* Turn the chip on */ 1191 - wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1192 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1192 1193 1193 1194 /* Latch the volume update bits */ 1194 1195 snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
-2
sound/soc/codecs/wm8903.c
··· 1200 1200 break; 1201 1201 } 1202 1202 1203 - codec->dapm.bias_level = level; 1204 - 1205 1203 return 0; 1206 1204 } 1207 1205
-1
sound/soc/codecs/wm8904.c
··· 1907 1907 clk_disable_unprepare(wm8904->mclk); 1908 1908 break; 1909 1909 } 1910 - codec->dapm.bias_level = level; 1911 1910 return 0; 1912 1911 } 1913 1912
+1 -3
sound/soc/codecs/wm8940.c
··· 510 510 break; 511 511 } 512 512 513 - codec->dapm.bias_level = level; 514 - 515 513 return ret; 516 514 } 517 515 ··· 705 707 return ret; 706 708 } 707 709 708 - wm8940_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 710 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 709 711 710 712 ret = snd_soc_write(codec, WM8940_POWER1, 0x180); 711 713 if (ret < 0)
+1 -2
sound/soc/codecs/wm8955.c
··· 838 838 wm8955->supplies); 839 839 break; 840 840 } 841 - codec->dapm.bias_level = level; 842 841 return 0; 843 842 } 844 843 ··· 928 929 WM8955_DMEN, WM8955_DMEN); 929 930 } 930 931 931 - wm8955_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 932 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 932 933 933 934 /* Bias level configuration will have done an extra enable */ 934 935 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies);
-4
sound/soc/codecs/wm8960.c
··· 691 691 break; 692 692 } 693 693 694 - codec->dapm.bias_level = level; 695 - 696 694 return 0; 697 695 } 698 696 ··· 799 801 case SND_SOC_BIAS_OFF: 800 802 break; 801 803 } 802 - 803 - codec->dapm.bias_level = level; 804 804 805 805 return 0; 806 806 }
-2
sound/soc/codecs/wm8961.c
··· 795 795 break; 796 796 } 797 797 798 - codec->dapm.bias_level = level; 799 - 800 798 return 0; 801 799 } 802 800
-1
sound/soc/codecs/wm8962.c
··· 2538 2538 break; 2539 2539 } 2540 2540 2541 - codec->dapm.bias_level = level; 2542 2541 return 0; 2543 2542 } 2544 2543
-1
sound/soc/codecs/wm8971.c
··· 594 594 snd_soc_write(codec, WM8971_PWR1, 0x0001); 595 595 break; 596 596 } 597 - codec->dapm.bias_level = level; 598 597 return 0; 599 598 } 600 599
-1
sound/soc/codecs/wm8974.c
··· 533 533 break; 534 534 } 535 535 536 - codec->dapm.bias_level = level; 537 536 return 0; 538 537 } 539 538
+2 -3
sound/soc/codecs/wm8978.c
··· 888 888 889 889 dev_dbg(codec->dev, "%s: %d, %x\n", __func__, level, power1); 890 890 891 - codec->dapm.bias_level = level; 892 891 return 0; 893 892 } 894 893 ··· 927 928 { 928 929 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec); 929 930 930 - wm8978_set_bias_level(codec, SND_SOC_BIAS_OFF); 931 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 931 932 /* Also switch PLL off */ 932 933 snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0); 933 934 ··· 943 944 /* Sync reg_cache with the hardware */ 944 945 regcache_sync(wm8978->regmap); 945 946 946 - wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 947 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 947 948 948 949 if (wm8978->f_pllout) 949 950 /* Switch PLL on */
-1
sound/soc/codecs/wm8983.c
··· 963 963 break; 964 964 } 965 965 966 - codec->dapm.bias_level = level; 967 966 return 0; 968 967 } 969 968
-1
sound/soc/codecs/wm8985.c
··· 957 957 break; 958 958 } 959 959 960 - codec->dapm.bias_level = level; 961 960 return 0; 962 961 } 963 962
-1
sound/soc/codecs/wm8988.c
··· 756 756 snd_soc_write(codec, WM8988_PWR1, 0x0000); 757 757 break; 758 758 } 759 - codec->dapm.bias_level = level; 760 759 return 0; 761 760 } 762 761
+1 -2
sound/soc/codecs/wm8990.c
··· 1227 1227 break; 1228 1228 } 1229 1229 1230 - codec->dapm.bias_level = level; 1231 1230 return 0; 1232 1231 } 1233 1232 ··· 1280 1281 wm8990_reset(codec); 1281 1282 1282 1283 /* charge output caps */ 1283 - wm8990_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1284 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1284 1285 1285 1286 snd_soc_update_bits(codec, WM8990_AUDIO_INTERFACE_4, 1286 1287 WM8990_ALRCGPIO1, WM8990_ALRCGPIO1);
-1
sound/soc/codecs/wm8991.c
··· 1224 1224 break; 1225 1225 } 1226 1226 1227 - codec->dapm.bias_level = level; 1228 1227 return 0; 1229 1228 } 1230 1229
+2 -4
sound/soc/codecs/wm8993.c
··· 1065 1065 break; 1066 1066 } 1067 1067 1068 - codec->dapm.bias_level = level; 1069 - 1070 1068 return 0; 1071 1069 } 1072 1070 ··· 1561 1563 wm8993->fll_fout = fll_fout; 1562 1564 wm8993->fll_fref = fll_fref; 1563 1565 1564 - wm8993_set_bias_level(codec, SND_SOC_BIAS_OFF); 1566 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 1565 1567 1566 1568 return 0; 1567 1569 } ··· 1571 1573 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); 1572 1574 int ret; 1573 1575 1574 - wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1576 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1575 1577 1576 1578 /* Restart the FLL? */ 1577 1579 if (wm8993->fll_fout) {
+1 -3
sound/soc/codecs/wm8994.c
··· 2546 2546 break; 2547 2547 } 2548 2548 2549 - codec->dapm.bias_level = level; 2550 - 2551 2549 return 0; 2552 2550 } 2553 2551 ··· 3161 3163 i + 1, ret); 3162 3164 } 3163 3165 3164 - wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); 3166 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); 3165 3167 3166 3168 return 0; 3167 3169 }
-1
sound/soc/codecs/wm8995.c
··· 1990 1990 break; 1991 1991 } 1992 1992 1993 - codec->dapm.bias_level = level; 1994 1993 return 0; 1995 1994 } 1996 1995
-2
sound/soc/codecs/wm8996.c
··· 1628 1628 break; 1629 1629 } 1630 1630 1631 - codec->dapm.bias_level = level; 1632 - 1633 1631 return 0; 1634 1632 } 1635 1633
-2
sound/soc/codecs/wm9081.c
··· 898 898 break; 899 899 } 900 900 901 - codec->dapm.bias_level = level; 902 - 903 901 return 0; 904 902 } 905 903
-2
sound/soc/codecs/wm9090.c
··· 515 515 break; 516 516 } 517 517 518 - codec->dapm.bias_level = level; 519 - 520 518 return 0; 521 519 } 522 520
+1 -2
sound/soc/codecs/wm9712.c
··· 610 610 ac97_write(codec, AC97_POWERDOWN, 0xffff); 611 611 break; 612 612 } 613 - codec->dapm.bias_level = level; 614 613 return 0; 615 614 } 616 615 ··· 645 646 if (ret < 0) 646 647 return ret; 647 648 648 - wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 649 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 649 650 650 651 if (ret == 0) { 651 652 /* Sync reg_cache with the hardware after cold reset */
+1 -2
sound/soc/codecs/wm9713.c
··· 1171 1171 ac97_write(codec, AC97_POWERDOWN, 0xffff); 1172 1172 break; 1173 1173 } 1174 - codec->dapm.bias_level = level; 1175 1174 return 0; 1176 1175 } 1177 1176 ··· 1200 1201 if (ret < 0) 1201 1202 return ret; 1202 1203 1203 - wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1204 + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); 1204 1205 1205 1206 /* do we need to re-start the PLL ? */ 1206 1207 if (wm9713->pll_in)
+34 -4
sound/soc/soc-dapm.c
··· 526 526 } 527 527 528 528 /** 529 + * snd_soc_dapm_force_bias_level() - Sets the DAPM bias level 530 + * @dapm: The DAPM context for which to set the level 531 + * @level: The level to set 532 + * 533 + * Forces the DAPM bias level to a specific state. It will call the bias level 534 + * callback of DAPM context with the specified level. This will even happen if 535 + * the context is already at the same level. Furthermore it will not go through 536 + * the normal bias level sequencing, meaning any intermediate states between the 537 + * current and the target state will not be entered. 538 + * 539 + * Note that the change in bias level is only temporary and the next time 540 + * snd_soc_dapm_sync() is called the state will be set to the level as 541 + * determined by the DAPM core. The function is mainly intended to be used to 542 + * used during probe or resume from suspend to power up the device so 543 + * initialization can be done, before the DAPM core takes over. 544 + */ 545 + int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, 546 + enum snd_soc_bias_level level) 547 + { 548 + int ret = 0; 549 + 550 + if (dapm->set_bias_level) 551 + ret = dapm->set_bias_level(dapm, level); 552 + 553 + if (ret == 0) 554 + dapm->bias_level = level; 555 + 556 + return ret; 557 + } 558 + EXPORT_SYMBOL_GPL(snd_soc_dapm_force_bias_level); 559 + 560 + /** 529 561 * snd_soc_dapm_set_bias_level - set the bias level for the system 530 562 * @dapm: DAPM context 531 563 * @level: level to configure ··· 579 547 if (ret != 0) 580 548 goto out; 581 549 582 - if (dapm->set_bias_level) 583 - ret = dapm->set_bias_level(dapm, level); 584 - else if (!card || dapm != &card->dapm) 585 - dapm->bias_level = level; 550 + if (!card || dapm != &card->dapm) 551 + ret = snd_soc_dapm_force_bias_level(dapm, level); 586 552 587 553 if (ret != 0) 588 554 goto out;