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

Merge branch 'for-2.6.38' into for-2.6.39

+196 -23
+3 -7
include/sound/wm8903.h
··· 17 17 /* 18 18 * R6 (0x06) - Mic Bias Control 0 19 19 */ 20 - #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ 21 - #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ 22 - #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ 23 - #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ 24 - #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ 25 - #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ 26 - #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ 20 + #define WM8903_MICDET_THR_MASK 0x0030 /* MICDET_THR - [5:4] */ 21 + #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [5:4] */ 22 + #define WM8903_MICDET_THR_WIDTH 2 /* MICDET_THR - [5:4] */ 27 23 #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ 28 24 #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ 29 25 #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
+1 -1
sound/soc/codecs/wm8903.c
··· 1620 1620 WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, 1621 1621 irq_mask); 1622 1622 1623 - if (det && shrt) { 1623 + if (det || shrt) { 1624 1624 /* Enable mic detection, this may not have been set through 1625 1625 * platform data (eg, if the defaults are OK). */ 1626 1626 snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
+183 -14
sound/soc/codecs/wm8994.c
··· 107 107 108 108 int revision; 109 109 struct wm8994_pdata *pdata; 110 + 111 + unsigned int aif1clk_enable:1; 112 + unsigned int aif2clk_enable:1; 110 113 }; 111 114 112 115 static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg) ··· 1007 1004 } 1008 1005 } 1009 1006 1007 + static int late_enable_ev(struct snd_soc_dapm_widget *w, 1008 + struct snd_kcontrol *kcontrol, int event) 1009 + { 1010 + struct snd_soc_codec *codec = w->codec; 1011 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1012 + 1013 + switch (event) { 1014 + case SND_SOC_DAPM_PRE_PMU: 1015 + if (wm8994->aif1clk_enable) 1016 + snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1017 + WM8994_AIF1CLK_ENA_MASK, 1018 + WM8994_AIF1CLK_ENA); 1019 + if (wm8994->aif2clk_enable) 1020 + snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1021 + WM8994_AIF2CLK_ENA_MASK, 1022 + WM8994_AIF2CLK_ENA); 1023 + break; 1024 + } 1025 + 1026 + return 0; 1027 + } 1028 + 1029 + static int late_disable_ev(struct snd_soc_dapm_widget *w, 1030 + struct snd_kcontrol *kcontrol, int event) 1031 + { 1032 + struct snd_soc_codec *codec = w->codec; 1033 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1034 + 1035 + switch (event) { 1036 + case SND_SOC_DAPM_POST_PMD: 1037 + if (wm8994->aif1clk_enable) { 1038 + snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1039 + WM8994_AIF1CLK_ENA_MASK, 0); 1040 + wm8994->aif1clk_enable = 0; 1041 + } 1042 + if (wm8994->aif2clk_enable) { 1043 + snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1044 + WM8994_AIF2CLK_ENA_MASK, 0); 1045 + wm8994->aif2clk_enable = 0; 1046 + } 1047 + break; 1048 + } 1049 + 1050 + return 0; 1051 + } 1052 + 1053 + static int aif1clk_ev(struct snd_soc_dapm_widget *w, 1054 + struct snd_kcontrol *kcontrol, int event) 1055 + { 1056 + struct snd_soc_codec *codec = w->codec; 1057 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1058 + 1059 + switch (event) { 1060 + case SND_SOC_DAPM_PRE_PMU: 1061 + wm8994->aif1clk_enable = 1; 1062 + break; 1063 + } 1064 + 1065 + return 0; 1066 + } 1067 + 1068 + static int aif2clk_ev(struct snd_soc_dapm_widget *w, 1069 + struct snd_kcontrol *kcontrol, int event) 1070 + { 1071 + struct snd_soc_codec *codec = w->codec; 1072 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1073 + 1074 + switch (event) { 1075 + case SND_SOC_DAPM_PRE_PMU: 1076 + wm8994->aif2clk_enable = 1; 1077 + break; 1078 + } 1079 + 1080 + return 0; 1081 + } 1082 + 1083 + static int dac_ev(struct snd_soc_dapm_widget *w, 1084 + struct snd_kcontrol *kcontrol, int event) 1085 + { 1086 + struct snd_soc_codec *codec = w->codec; 1087 + unsigned int mask = 1 << w->shift; 1088 + 1089 + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 1090 + mask, mask); 1091 + return 0; 1092 + } 1093 + 1010 1094 static const char *hp_mux_text[] = { 1011 1095 "Mixer", 1012 1096 "DAC", ··· 1362 1272 static const struct snd_kcontrol_new aif2dacr_src_mux = 1363 1273 SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); 1364 1274 1275 + static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { 1276 + SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, 1277 + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1278 + SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, 1279 + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1280 + 1281 + SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1282 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1283 + SND_SOC_DAPM_PGA_E("Late DAC1R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1284 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1285 + SND_SOC_DAPM_PGA_E("Late DAC2L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1286 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1287 + SND_SOC_DAPM_PGA_E("Late DAC2R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1288 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1289 + 1290 + SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) 1291 + }; 1292 + 1293 + static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { 1294 + SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1295 + SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0) 1296 + }; 1297 + 1298 + static const struct snd_soc_dapm_widget wm8994_dac_revd_widgets[] = { 1299 + SND_SOC_DAPM_DAC_E("DAC2L", NULL, SND_SOC_NOPM, 3, 0, 1300 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1301 + SND_SOC_DAPM_DAC_E("DAC2R", NULL, SND_SOC_NOPM, 2, 0, 1302 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1303 + SND_SOC_DAPM_DAC_E("DAC1L", NULL, SND_SOC_NOPM, 1, 0, 1304 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1305 + SND_SOC_DAPM_DAC_E("DAC1R", NULL, SND_SOC_NOPM, 0, 0, 1306 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1307 + }; 1308 + 1309 + static const struct snd_soc_dapm_widget wm8994_dac_widgets[] = { 1310 + SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), 1311 + SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), 1312 + SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), 1313 + SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), 1314 + }; 1315 + 1365 1316 static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { 1366 1317 SND_SOC_DAPM_INPUT("DMIC1DAT"), 1367 1318 SND_SOC_DAPM_INPUT("DMIC2DAT"), ··· 1414 1283 SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0), 1415 1284 SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), 1416 1285 SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), 1417 - 1418 - SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1419 - SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), 1420 1286 1421 1287 SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, 1422 1288 0, WM8994_POWER_MANAGEMENT_4, 9, 0), ··· 1499 1371 1500 1372 SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), 1501 1373 SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), 1502 - 1503 - SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), 1504 - SND_SOC_DAPM_DAC("DAC2R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), 1505 - SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), 1506 - SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), 1507 1374 1508 1375 SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux), 1509 1376 SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux), ··· 1639 1516 { "AIF2ADC Mux", "AIF3DACDAT", "AIF3ADCDAT" }, 1640 1517 1641 1518 /* DAC1 inputs */ 1642 - { "DAC1L", NULL, "DAC1L Mixer" }, 1643 1519 { "DAC1L Mixer", "AIF2 Switch", "AIF2DACL" }, 1644 1520 { "DAC1L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, 1645 1521 { "DAC1L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, 1646 1522 { "DAC1L Mixer", "Left Sidetone Switch", "Left Sidetone" }, 1647 1523 { "DAC1L Mixer", "Right Sidetone Switch", "Right Sidetone" }, 1648 1524 1649 - { "DAC1R", NULL, "DAC1R Mixer" }, 1650 1525 { "DAC1R Mixer", "AIF2 Switch", "AIF2DACR" }, 1651 1526 { "DAC1R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, 1652 1527 { "DAC1R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, ··· 1653 1532 1654 1533 /* DAC2/AIF2 outputs */ 1655 1534 { "AIF2ADCL", NULL, "AIF2DAC2L Mixer" }, 1656 - { "DAC2L", NULL, "AIF2DAC2L Mixer" }, 1657 1535 { "AIF2DAC2L Mixer", "AIF2 Switch", "AIF2DACL" }, 1658 1536 { "AIF2DAC2L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, 1659 1537 { "AIF2DAC2L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, ··· 1660 1540 { "AIF2DAC2L Mixer", "Right Sidetone Switch", "Right Sidetone" }, 1661 1541 1662 1542 { "AIF2ADCR", NULL, "AIF2DAC2R Mixer" }, 1663 - { "DAC2R", NULL, "AIF2DAC2R Mixer" }, 1664 1543 { "AIF2DAC2R Mixer", "AIF2 Switch", "AIF2DACR" }, 1665 1544 { "AIF2DAC2R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, 1666 1545 { "AIF2DAC2R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, ··· 1701 1582 1702 1583 { "Left Headphone Mux", "DAC", "DAC1L" }, 1703 1584 { "Right Headphone Mux", "DAC", "DAC1R" }, 1585 + }; 1586 + 1587 + static const struct snd_soc_dapm_route wm8994_lateclk_revd_intercon[] = { 1588 + { "DAC1L", NULL, "Late DAC1L Enable PGA" }, 1589 + { "Late DAC1L Enable PGA", NULL, "DAC1L Mixer" }, 1590 + { "DAC1R", NULL, "Late DAC1R Enable PGA" }, 1591 + { "Late DAC1R Enable PGA", NULL, "DAC1R Mixer" }, 1592 + { "DAC2L", NULL, "Late DAC2L Enable PGA" }, 1593 + { "Late DAC2L Enable PGA", NULL, "AIF2DAC2L Mixer" }, 1594 + { "DAC2R", NULL, "Late DAC2R Enable PGA" }, 1595 + { "Late DAC2R Enable PGA", NULL, "AIF2DAC2R Mixer" } 1596 + }; 1597 + 1598 + static const struct snd_soc_dapm_route wm8994_lateclk_intercon[] = { 1599 + { "DAC1L", NULL, "DAC1L Mixer" }, 1600 + { "DAC1R", NULL, "DAC1R Mixer" }, 1601 + { "DAC2L", NULL, "AIF2DAC2L Mixer" }, 1602 + { "DAC2R", NULL, "AIF2DAC2R Mixer" }, 1704 1603 }; 1705 1604 1706 1605 static const struct snd_soc_dapm_route wm8994_revd_intercon[] = { ··· 2651 2514 { 2652 2515 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 2653 2516 int i, ret; 2517 + unsigned int val, mask; 2518 + 2519 + if (wm8994->revision < 4) { 2520 + /* force a HW read */ 2521 + val = wm8994_reg_read(codec->control_data, 2522 + WM8994_POWER_MANAGEMENT_5); 2523 + 2524 + /* modify the cache only */ 2525 + codec->cache_only = 1; 2526 + mask = WM8994_DAC1R_ENA | WM8994_DAC1L_ENA | 2527 + WM8994_DAC2R_ENA | WM8994_DAC2L_ENA; 2528 + val &= mask; 2529 + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 2530 + mask, val); 2531 + codec->cache_only = 0; 2532 + } 2654 2533 2655 2534 /* Restore the registers */ 2656 2535 ret = snd_soc_cache_sync(codec); ··· 3278 3125 case WM8994: 3279 3126 snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, 3280 3127 ARRAY_SIZE(wm8994_specific_dapm_widgets)); 3128 + if (wm8994->revision < 4) { 3129 + snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, 3130 + ARRAY_SIZE(wm8994_lateclk_revd_widgets)); 3131 + snd_soc_dapm_new_controls(dapm, wm8994_dac_revd_widgets, 3132 + ARRAY_SIZE(wm8994_dac_revd_widgets)); 3133 + } else { 3134 + snd_soc_dapm_new_controls(dapm, wm8994_lateclk_widgets, 3135 + ARRAY_SIZE(wm8994_lateclk_widgets)); 3136 + snd_soc_dapm_new_controls(dapm, wm8994_dac_widgets, 3137 + ARRAY_SIZE(wm8994_dac_widgets)); 3138 + } 3281 3139 break; 3282 3140 case WM8958: 3283 3141 snd_soc_add_controls(codec, wm8958_snd_controls, ··· 3307 3143 snd_soc_dapm_add_routes(dapm, wm8994_intercon, 3308 3144 ARRAY_SIZE(wm8994_intercon)); 3309 3145 3310 - if (wm8994->revision < 4) 3146 + if (wm8994->revision < 4) { 3311 3147 snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, 3312 3148 ARRAY_SIZE(wm8994_revd_intercon)); 3313 - 3149 + snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, 3150 + ARRAY_SIZE(wm8994_lateclk_revd_intercon)); 3151 + } else { 3152 + snd_soc_dapm_add_routes(dapm, wm8994_lateclk_intercon, 3153 + ARRAY_SIZE(wm8994_lateclk_intercon)); 3154 + } 3314 3155 break; 3315 3156 case WM8958: 3316 3157 snd_soc_dapm_add_routes(dapm, wm8958_intercon,
+9 -1
sound/soc/soc-dapm.c
··· 712 712 !path->connected(path->source, path->sink)) 713 713 continue; 714 714 715 - if (path->sink && path->sink->power_check && 715 + if (!path->sink) 716 + continue; 717 + 718 + if (path->sink->force) { 719 + power = 1; 720 + break; 721 + } 722 + 723 + if (path->sink->power_check && 716 724 path->sink->power_check(path->sink)) { 717 725 power = 1; 718 726 break;