tangled
alpha
login
or
join now
tjh.dev
/
kernel
Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1
fork
atom
overview
issues
pulls
pipelines
Merge branch 'fix/asoc' into for-linus
Takashi Iwai
15 years ago
2133991d
38c07641
+47
-9
2 changed files
expand all
collapse all
unified
split
sound
soc
codecs
wm8994.c
wm9081.c
+42
-9
sound/soc/codecs/wm8994.c
···
110
110
111
111
unsigned int aif1clk_enable:1;
112
112
unsigned int aif2clk_enable:1;
113
113
+
114
114
+
unsigned int aif1clk_disable:1;
115
115
+
unsigned int aif2clk_disable:1;
113
116
};
114
117
115
118
static int wm8994_readable(unsigned int reg)
···
1018
1015
1019
1016
switch (event) {
1020
1017
case SND_SOC_DAPM_PRE_PMU:
1021
1021
-
if (wm8994->aif1clk_enable)
1018
1018
+
if (wm8994->aif1clk_enable) {
1022
1019
snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
1023
1020
WM8994_AIF1CLK_ENA_MASK,
1024
1021
WM8994_AIF1CLK_ENA);
1025
1025
-
if (wm8994->aif2clk_enable)
1022
1022
+
wm8994->aif1clk_enable = 0;
1023
1023
+
}
1024
1024
+
if (wm8994->aif2clk_enable) {
1026
1025
snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
1027
1026
WM8994_AIF2CLK_ENA_MASK,
1028
1027
WM8994_AIF2CLK_ENA);
1028
1028
+
wm8994->aif2clk_enable = 0;
1029
1029
+
}
1029
1030
break;
1030
1031
}
1031
1032
···
1044
1037
1045
1038
switch (event) {
1046
1039
case SND_SOC_DAPM_POST_PMD:
1047
1047
-
if (wm8994->aif1clk_enable) {
1040
1040
+
if (wm8994->aif1clk_disable) {
1048
1041
snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
1049
1042
WM8994_AIF1CLK_ENA_MASK, 0);
1050
1050
-
wm8994->aif1clk_enable = 0;
1043
1043
+
wm8994->aif1clk_disable = 0;
1051
1044
}
1052
1052
-
if (wm8994->aif2clk_enable) {
1045
1045
+
if (wm8994->aif2clk_disable) {
1053
1046
snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
1054
1047
WM8994_AIF2CLK_ENA_MASK, 0);
1055
1055
-
wm8994->aif2clk_enable = 0;
1048
1048
+
wm8994->aif2clk_disable = 0;
1056
1049
}
1057
1050
break;
1058
1051
}
···
1070
1063
case SND_SOC_DAPM_PRE_PMU:
1071
1064
wm8994->aif1clk_enable = 1;
1072
1065
break;
1066
1066
+
case SND_SOC_DAPM_POST_PMD:
1067
1067
+
wm8994->aif1clk_disable = 1;
1068
1068
+
break;
1073
1069
}
1074
1070
1075
1071
return 0;
···
1088
1078
case SND_SOC_DAPM_PRE_PMU:
1089
1079
wm8994->aif2clk_enable = 1;
1090
1080
break;
1081
1081
+
case SND_SOC_DAPM_POST_PMD:
1082
1082
+
wm8994->aif2clk_disable = 1;
1083
1083
+
break;
1091
1084
}
1092
1085
1086
1086
+
return 0;
1087
1087
+
}
1088
1088
+
1089
1089
+
static int adc_mux_ev(struct snd_soc_dapm_widget *w,
1090
1090
+
struct snd_kcontrol *kcontrol, int event)
1091
1091
+
{
1092
1092
+
late_enable_ev(w, kcontrol, event);
1093
1093
return 0;
1094
1094
}
1095
1095
···
1423
1403
SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0),
1424
1404
};
1425
1405
1406
1406
+
static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = {
1407
1407
+
SND_SOC_DAPM_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux,
1408
1408
+
adc_mux_ev, SND_SOC_DAPM_PRE_PMU),
1409
1409
+
SND_SOC_DAPM_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux,
1410
1410
+
adc_mux_ev, SND_SOC_DAPM_PRE_PMU),
1411
1411
+
};
1412
1412
+
1413
1413
+
static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = {
1414
1414
+
SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux),
1415
1415
+
SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux),
1416
1416
+
};
1417
1417
+
1426
1418
static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = {
1427
1419
SND_SOC_DAPM_INPUT("DMIC1DAT"),
1428
1420
SND_SOC_DAPM_INPUT("DMIC2DAT"),
···
1528
1496
*/
1529
1497
SND_SOC_DAPM_ADC("ADCL", NULL, SND_SOC_NOPM, 1, 0),
1530
1498
SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0),
1531
1531
-
1532
1532
-
SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux),
1533
1533
-
SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux),
1534
1499
1535
1500
SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux),
1536
1501
SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux),
···
3309
3280
if (wm8994->revision < 4) {
3310
3281
snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets,
3311
3282
ARRAY_SIZE(wm8994_lateclk_revd_widgets));
3283
3283
+
snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets,
3284
3284
+
ARRAY_SIZE(wm8994_adc_revd_widgets));
3312
3285
snd_soc_dapm_new_controls(dapm, wm8994_dac_revd_widgets,
3313
3286
ARRAY_SIZE(wm8994_dac_revd_widgets));
3314
3287
} else {
3315
3288
snd_soc_dapm_new_controls(dapm, wm8994_lateclk_widgets,
3316
3289
ARRAY_SIZE(wm8994_lateclk_widgets));
3290
3290
+
snd_soc_dapm_new_controls(dapm, wm8994_adc_widgets,
3291
3291
+
ARRAY_SIZE(wm8994_adc_widgets));
3317
3292
snd_soc_dapm_new_controls(dapm, wm8994_dac_widgets,
3318
3293
ARRAY_SIZE(wm8994_dac_widgets));
3319
3294
}
+5
sound/soc/codecs/wm9081.c
···
15
15
#include <linux/moduleparam.h>
16
16
#include <linux/init.h>
17
17
#include <linux/delay.h>
18
18
+
#include <linux/device.h>
18
19
#include <linux/pm.h>
19
20
#include <linux/i2c.h>
20
21
#include <linux/platform_device.h>
···
1341
1340
i2c_set_clientdata(i2c, wm9081);
1342
1341
wm9081->control_type = SND_SOC_I2C;
1343
1342
wm9081->control_data = i2c;
1343
1343
+
1344
1344
+
if (dev_get_platdata(&i2c->dev))
1345
1345
+
memcpy(&wm9081->retune, dev_get_platdata(&i2c->dev),
1346
1346
+
sizeof(wm9081->retune));
1344
1347
1345
1348
ret = snd_soc_register_codec(&i2c->dev,
1346
1349
&soc_codec_dev_wm9081, &wm9081_dai, 1);