diff options
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/cq93vc.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cx20442.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 28 | ||||
-rw-r--r-- | sound/soc/codecs/wm8995.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm_hubs.c | 15 |
5 files changed, 35 insertions, 15 deletions
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 46dbfd067f79..347a567b01e1 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c | |||
@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec) | |||
153 | 153 | ||
154 | static int cq93vc_probe(struct snd_soc_codec *codec) | 154 | static int cq93vc_probe(struct snd_soc_codec *codec) |
155 | { | 155 | { |
156 | struct davinci_vc *davinci_vc = codec->dev->platform_data; | 156 | struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec); |
157 | 157 | ||
158 | davinci_vc->cq93vc.codec = codec; | 158 | davinci_vc->cq93vc.codec = codec; |
159 | codec->control_data = davinci_vc; | 159 | codec->control_data = davinci_vc; |
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 03d1e860d229..bb4bf65b9e7e 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; | ||
371 | |||
370 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
371 | .probe = cx20442_codec_probe, | 373 | .probe = cx20442_codec_probe, |
372 | .remove = cx20442_codec_remove, | 374 | .remove = cx20442_codec_remove, |
375 | .reg_cache_default = &cx20442_reg, | ||
373 | .reg_cache_size = 1, | 376 | .reg_cache_size = 1, |
374 | .reg_word_size = sizeof(u8), | 377 | .reg_word_size = sizeof(u8), |
375 | .read = cx20442_read_reg_cache, | 378 | .read = cx20442_read_reg_cache, |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 247a6a99feb8..37b8aa8a680f 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1287,9 +1287,9 @@ SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), | |||
1287 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), | 1287 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), |
1288 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), | 1288 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), |
1289 | 1289 | ||
1290 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", "AIF1 Capture", | 1290 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, |
1291 | 0, WM8994_POWER_MANAGEMENT_4, 9, 0), | 1291 | 0, WM8994_POWER_MANAGEMENT_4, 9, 0), |
1292 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", "AIF1 Capture", | 1292 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL, |
1293 | 0, WM8994_POWER_MANAGEMENT_4, 8, 0), | 1293 | 0, WM8994_POWER_MANAGEMENT_4, 8, 0), |
1294 | SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0, | 1294 | SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0, |
1295 | WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev, | 1295 | WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev, |
@@ -1298,9 +1298,9 @@ SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0, | |||
1298 | WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev, | 1298 | WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev, |
1299 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), | 1299 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), |
1300 | 1300 | ||
1301 | SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", "AIF1 Capture", | 1301 | SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL, |
1302 | 0, WM8994_POWER_MANAGEMENT_4, 11, 0), | 1302 | 0, WM8994_POWER_MANAGEMENT_4, 11, 0), |
1303 | SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", "AIF1 Capture", | 1303 | SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL, |
1304 | 0, WM8994_POWER_MANAGEMENT_4, 10, 0), | 1304 | 0, WM8994_POWER_MANAGEMENT_4, 10, 0), |
1305 | SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0, | 1305 | SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0, |
1306 | WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev, | 1306 | WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev, |
@@ -1345,6 +1345,7 @@ SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0, | |||
1345 | 1345 | ||
1346 | SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), | 1346 | SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), |
1347 | SND_SOC_DAPM_AIF_IN("AIF2DACDAT", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0), | 1347 | SND_SOC_DAPM_AIF_IN("AIF2DACDAT", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0), |
1348 | SND_SOC_DAPM_AIF_OUT("AIF1ADCDAT", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), | ||
1348 | SND_SOC_DAPM_AIF_OUT("AIF2ADCDAT", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0), | 1349 | SND_SOC_DAPM_AIF_OUT("AIF2ADCDAT", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0), |
1349 | 1350 | ||
1350 | SND_SOC_DAPM_MUX("AIF1DAC Mux", SND_SOC_NOPM, 0, 0, &aif1dac_mux), | 1351 | SND_SOC_DAPM_MUX("AIF1DAC Mux", SND_SOC_NOPM, 0, 0, &aif1dac_mux), |
@@ -1546,6 +1547,11 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1546 | { "AIF2DAC2R Mixer", "Left Sidetone Switch", "Left Sidetone" }, | 1547 | { "AIF2DAC2R Mixer", "Left Sidetone Switch", "Left Sidetone" }, |
1547 | { "AIF2DAC2R Mixer", "Right Sidetone Switch", "Right Sidetone" }, | 1548 | { "AIF2DAC2R Mixer", "Right Sidetone Switch", "Right Sidetone" }, |
1548 | 1549 | ||
1550 | { "AIF1ADCDAT", NULL, "AIF1ADC1L" }, | ||
1551 | { "AIF1ADCDAT", NULL, "AIF1ADC1R" }, | ||
1552 | { "AIF1ADCDAT", NULL, "AIF1ADC2L" }, | ||
1553 | { "AIF1ADCDAT", NULL, "AIF1ADC2R" }, | ||
1554 | |||
1549 | { "AIF2ADCDAT", NULL, "AIF2ADC Mux" }, | 1555 | { "AIF2ADCDAT", NULL, "AIF2ADC Mux" }, |
1550 | 1556 | ||
1551 | /* AIF3 output */ | 1557 | /* AIF3 output */ |
@@ -1578,6 +1584,13 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1578 | { "Right Headphone Mux", "DAC", "DAC1R" }, | 1584 | { "Right Headphone Mux", "DAC", "DAC1R" }, |
1579 | }; | 1585 | }; |
1580 | 1586 | ||
1587 | static const struct snd_soc_dapm_route wm8994_revd_intercon[] = { | ||
1588 | { "AIF1DACDAT", NULL, "AIF2DACDAT" }, | ||
1589 | { "AIF2DACDAT", NULL, "AIF1DACDAT" }, | ||
1590 | { "AIF1ADCDAT", NULL, "AIF2ADCDAT" }, | ||
1591 | { "AIF2ADCDAT", NULL, "AIF1ADCDAT" }, | ||
1592 | }; | ||
1593 | |||
1581 | static const struct snd_soc_dapm_route wm8994_intercon[] = { | 1594 | static const struct snd_soc_dapm_route wm8994_intercon[] = { |
1582 | { "AIF2DACL", NULL, "AIF2DAC Mux" }, | 1595 | { "AIF2DACL", NULL, "AIF2DAC Mux" }, |
1583 | { "AIF2DACR", NULL, "AIF2DAC Mux" }, | 1596 | { "AIF2DACR", NULL, "AIF2DAC Mux" }, |
@@ -2386,7 +2399,7 @@ static int wm8994_set_tristate(struct snd_soc_dai *codec_dai, int tristate) | |||
2386 | else | 2399 | else |
2387 | val = 0; | 2400 | val = 0; |
2388 | 2401 | ||
2389 | return snd_soc_update_bits(codec, reg, mask, reg); | 2402 | return snd_soc_update_bits(codec, reg, mask, val); |
2390 | } | 2403 | } |
2391 | 2404 | ||
2392 | #define WM8994_RATES SNDRV_PCM_RATE_8000_96000 | 2405 | #define WM8994_RATES SNDRV_PCM_RATE_8000_96000 |
@@ -3129,6 +3142,11 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3129 | case WM8994: | 3142 | case WM8994: |
3130 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, | 3143 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, |
3131 | ARRAY_SIZE(wm8994_intercon)); | 3144 | ARRAY_SIZE(wm8994_intercon)); |
3145 | |||
3146 | if (wm8994->revision < 4) | ||
3147 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, | ||
3148 | ARRAY_SIZE(wm8994_revd_intercon)); | ||
3149 | |||
3132 | break; | 3150 | break; |
3133 | case WM8958: | 3151 | case WM8958: |
3134 | snd_soc_dapm_add_routes(dapm, wm8958_intercon, | 3152 | snd_soc_dapm_add_routes(dapm, wm8958_intercon, |
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 6045cbde492b..608c84c5aa8e 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c | |||
@@ -1223,7 +1223,7 @@ static int wm8995_set_tristate(struct snd_soc_dai *codec_dai, int tristate) | |||
1223 | else | 1223 | else |
1224 | val = 0; | 1224 | val = 0; |
1225 | 1225 | ||
1226 | return snd_soc_update_bits(codec, reg, mask, reg); | 1226 | return snd_soc_update_bits(codec, reg, mask, val); |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | /* The size in bits of the FLL divide multiplied by 10 | 1229 | /* The size in bits of the FLL divide multiplied by 10 |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index c466982eed23..613df5db0b32 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -91,6 +91,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op) | |||
91 | static void calibrate_dc_servo(struct snd_soc_codec *codec) | 91 | static void calibrate_dc_servo(struct snd_soc_codec *codec) |
92 | { | 92 | { |
93 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); | 93 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
94 | s8 offset; | ||
94 | u16 reg, reg_l, reg_r, dcs_cfg; | 95 | u16 reg, reg_l, reg_r, dcs_cfg; |
95 | 96 | ||
96 | /* If we're using a digital only path and have a previously | 97 | /* If we're using a digital only path and have a previously |
@@ -149,16 +150,14 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) | |||
149 | hubs->dcs_codes); | 150 | hubs->dcs_codes); |
150 | 151 | ||
151 | /* HPOUT1L */ | 152 | /* HPOUT1L */ |
152 | if (reg_l + hubs->dcs_codes > 0 && | 153 | offset = reg_l; |
153 | reg_l + hubs->dcs_codes < 0xff) | 154 | offset += hubs->dcs_codes; |
154 | reg_l += hubs->dcs_codes; | 155 | dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
155 | dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT; | ||
156 | 156 | ||
157 | /* HPOUT1R */ | 157 | /* HPOUT1R */ |
158 | if (reg_r + hubs->dcs_codes > 0 && | 158 | offset = reg_r; |
159 | reg_r + hubs->dcs_codes < 0xff) | 159 | offset += hubs->dcs_codes; |
160 | reg_r += hubs->dcs_codes; | 160 | dcs_cfg |= (u8)offset; |
161 | dcs_cfg |= reg_r; | ||
162 | 161 | ||
163 | dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); | 162 | dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); |
164 | 163 | ||