diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-26 12:01:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-26 12:01:30 -0400 |
commit | 1e8d4e8be2e104514564983239af9dd9521c7779 (patch) | |
tree | 15d4ba08c3f22d1893bea672909753a8f55b625a | |
parent | 671ee7f0ce62e4b991b47fcf1c161c3f710dabbc (diff) | |
parent | 26b9b559ed9ff3bef5642ef731748d28d894705f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (32 commits)
ALSA: hda: Conexant: Allow different output types to share DAC
ASoC: Correct element count for WM8996 sidetone HPF
ASoC: Tegra: wm8903 machine driver: Drop Ventana support
ASoC: Add samsung maintainer
ASoC: Add Springbank I/O card to Speyside Kconfig
ALSA: hda/conexant - Enable ADC-switching for auto-mic mode, too
ALSA: hda - Fix double-headphone/speaker paths for Cxt auto-parser
ALSA: hda - Update jack-sense info even when no automute is set
ALSA: hda - Fix output-path initialization for Realtek auto-parser
sound/soc/fsl/mpc8610_hpcd.c: add missing of_node_put
sound/soc/fsl/p1022_ds.c: add missing of_node_put
sound/soc/ep93xx/ep93xx-i2s.c: add missing kfree
sound/soc/kirkwood/kirkwood-i2s.c: add missing kfree
ASoC: soc-core: use GFP_KERNEL flag for kmalloc in snd_soc_cnew
sound/soc/fsl/fsl_dma.c: add missing of_node_put
ASoC: Clear completions from late WM8996 FLL lock IRQs
ASoC: Clear any outstanding WM8962 FLL lock completions before waiting
ASoC: Ensure we only run Speyside WM8962 bias level callbacks once
ASoC: Fix configuration of WM8996 input enables
ASoC: WM8996 record paths need AIFCLK
...
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 57 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 28 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad193x.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/ad193x.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/ad193x.h | 5 | ||||
-rw-r--r-- | sound/soc/codecs/sta32x.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 12 | ||||
-rw-r--r-- | sound/soc/codecs/wm8996.c | 28 | ||||
-rw-r--r-- | sound/soc/ep93xx/ep93xx-i2s.c | 5 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dma.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 18 | ||||
-rw-r--r-- | sound/soc/fsl/p1022_ds.c | 4 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-i2s.c | 2 | ||||
-rw-r--r-- | sound/soc/omap/ams-delta.c | 6 | ||||
-rw-r--r-- | sound/soc/samsung/Kconfig | 1 | ||||
-rw-r--r-- | sound/soc/samsung/h1940_uda1380.c | 1 | ||||
-rw-r--r-- | sound/soc/samsung/rx1950_uda1380.c | 1 | ||||
-rw-r--r-- | sound/soc/samsung/speyside_wm8962.c | 6 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-io.c | 23 | ||||
-rw-r--r-- | sound/soc/soc-jack.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-pcm.c | 3 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_wm8903.c | 4 |
24 files changed, 148 insertions, 77 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index d94292065359..1a8cc600067d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -5532,6 +5532,7 @@ F: include/media/*7146* | |||
5532 | 5532 | ||
5533 | SAMSUNG AUDIO (ASoC) DRIVERS | 5533 | SAMSUNG AUDIO (ASoC) DRIVERS |
5534 | M: Jassi Brar <jassisinghbrar@gmail.com> | 5534 | M: Jassi Brar <jassisinghbrar@gmail.com> |
5535 | M: Sangbeom Kim <sbkim73@samsung.com> | ||
5535 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) | 5536 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
5536 | S: Supported | 5537 | S: Supported |
5537 | F: sound/soc/samsung | 5538 | F: sound/soc/samsung |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 502fc9499453..7696d05b9356 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -3348,6 +3348,8 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t pin, | |||
3348 | 3348 | ||
3349 | #define MAX_AUTO_DACS 5 | 3349 | #define MAX_AUTO_DACS 5 |
3350 | 3350 | ||
3351 | #define DAC_SLAVE_FLAG 0x8000 /* filled dac is a slave */ | ||
3352 | |||
3351 | /* fill analog DAC list from the widget tree */ | 3353 | /* fill analog DAC list from the widget tree */ |
3352 | static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs) | 3354 | static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs) |
3353 | { | 3355 | { |
@@ -3370,16 +3372,26 @@ static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs) | |||
3370 | /* fill pin_dac_pair list from the pin and dac list */ | 3372 | /* fill pin_dac_pair list from the pin and dac list */ |
3371 | static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins, | 3373 | static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins, |
3372 | int num_pins, hda_nid_t *dacs, int *rest, | 3374 | int num_pins, hda_nid_t *dacs, int *rest, |
3373 | struct pin_dac_pair *filled, int type) | 3375 | struct pin_dac_pair *filled, int nums, |
3376 | int type) | ||
3374 | { | 3377 | { |
3375 | int i, nums; | 3378 | int i, start = nums; |
3376 | 3379 | ||
3377 | nums = 0; | 3380 | for (i = 0; i < num_pins; i++, nums++) { |
3378 | for (i = 0; i < num_pins; i++) { | ||
3379 | filled[nums].pin = pins[i]; | 3381 | filled[nums].pin = pins[i]; |
3380 | filled[nums].type = type; | 3382 | filled[nums].type = type; |
3381 | filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest); | 3383 | filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest); |
3382 | nums++; | 3384 | if (filled[nums].dac) |
3385 | continue; | ||
3386 | if (filled[start].dac && get_connection_index(codec, pins[i], filled[start].dac) >= 0) { | ||
3387 | filled[nums].dac = filled[start].dac | DAC_SLAVE_FLAG; | ||
3388 | continue; | ||
3389 | } | ||
3390 | if (filled[0].dac && get_connection_index(codec, pins[i], filled[0].dac) >= 0) { | ||
3391 | filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG; | ||
3392 | continue; | ||
3393 | } | ||
3394 | snd_printdd("Failed to find a DAC for pin 0x%x", pins[i]); | ||
3383 | } | 3395 | } |
3384 | return nums; | 3396 | return nums; |
3385 | } | 3397 | } |
@@ -3395,19 +3407,19 @@ static void cx_auto_parse_output(struct hda_codec *codec) | |||
3395 | rest = fill_cx_auto_dacs(codec, dacs); | 3407 | rest = fill_cx_auto_dacs(codec, dacs); |
3396 | /* parse all analog output pins */ | 3408 | /* parse all analog output pins */ |
3397 | nums = fill_dacs_for_pins(codec, cfg->line_out_pins, cfg->line_outs, | 3409 | nums = fill_dacs_for_pins(codec, cfg->line_out_pins, cfg->line_outs, |
3398 | dacs, &rest, spec->dac_info, | 3410 | dacs, &rest, spec->dac_info, 0, |
3399 | AUTO_PIN_LINE_OUT); | 3411 | AUTO_PIN_LINE_OUT); |
3400 | nums += fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs, | 3412 | nums = fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs, |
3401 | dacs, &rest, spec->dac_info + nums, | 3413 | dacs, &rest, spec->dac_info, nums, |
3402 | AUTO_PIN_HP_OUT); | 3414 | AUTO_PIN_HP_OUT); |
3403 | nums += fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs, | 3415 | nums = fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs, |
3404 | dacs, &rest, spec->dac_info + nums, | 3416 | dacs, &rest, spec->dac_info, nums, |
3405 | AUTO_PIN_SPEAKER_OUT); | 3417 | AUTO_PIN_SPEAKER_OUT); |
3406 | spec->dac_info_filled = nums; | 3418 | spec->dac_info_filled = nums; |
3407 | /* fill multiout struct */ | 3419 | /* fill multiout struct */ |
3408 | for (i = 0; i < nums; i++) { | 3420 | for (i = 0; i < nums; i++) { |
3409 | hda_nid_t dac = spec->dac_info[i].dac; | 3421 | hda_nid_t dac = spec->dac_info[i].dac; |
3410 | if (!dac) | 3422 | if (!dac || (dac & DAC_SLAVE_FLAG)) |
3411 | continue; | 3423 | continue; |
3412 | switch (spec->dac_info[i].type) { | 3424 | switch (spec->dac_info[i].type) { |
3413 | case AUTO_PIN_LINE_OUT: | 3425 | case AUTO_PIN_LINE_OUT: |
@@ -3862,7 +3874,7 @@ static void cx_auto_parse_input(struct hda_codec *codec) | |||
3862 | } | 3874 | } |
3863 | if (imux->num_items >= 2 && cfg->num_inputs == imux->num_items) | 3875 | if (imux->num_items >= 2 && cfg->num_inputs == imux->num_items) |
3864 | cx_auto_check_auto_mic(codec); | 3876 | cx_auto_check_auto_mic(codec); |
3865 | if (imux->num_items > 1 && !spec->auto_mic) { | 3877 | if (imux->num_items > 1) { |
3866 | for (i = 1; i < imux->num_items; i++) { | 3878 | for (i = 1; i < imux->num_items; i++) { |
3867 | if (spec->imux_info[i].adc != spec->imux_info[0].adc) { | 3879 | if (spec->imux_info[i].adc != spec->imux_info[0].adc) { |
3868 | spec->adc_switching = 1; | 3880 | spec->adc_switching = 1; |
@@ -4035,6 +4047,8 @@ static void cx_auto_init_output(struct hda_codec *codec) | |||
4035 | nid = spec->dac_info[i].dac; | 4047 | nid = spec->dac_info[i].dac; |
4036 | if (!nid) | 4048 | if (!nid) |
4037 | nid = spec->multiout.dac_nids[0]; | 4049 | nid = spec->multiout.dac_nids[0]; |
4050 | else if (nid & DAC_SLAVE_FLAG) | ||
4051 | nid &= ~DAC_SLAVE_FLAG; | ||
4038 | select_connection(codec, spec->dac_info[i].pin, nid); | 4052 | select_connection(codec, spec->dac_info[i].pin, nid); |
4039 | } | 4053 | } |
4040 | if (spec->auto_mute) { | 4054 | if (spec->auto_mute) { |
@@ -4167,9 +4181,11 @@ static int try_add_pb_volume(struct hda_codec *codec, hda_nid_t dac, | |||
4167 | hda_nid_t pin, const char *name, int idx) | 4181 | hda_nid_t pin, const char *name, int idx) |
4168 | { | 4182 | { |
4169 | unsigned int caps; | 4183 | unsigned int caps; |
4170 | caps = query_amp_caps(codec, dac, HDA_OUTPUT); | 4184 | if (dac && !(dac & DAC_SLAVE_FLAG)) { |
4171 | if (caps & AC_AMPCAP_NUM_STEPS) | 4185 | caps = query_amp_caps(codec, dac, HDA_OUTPUT); |
4172 | return cx_auto_add_pb_volume(codec, dac, name, idx); | 4186 | if (caps & AC_AMPCAP_NUM_STEPS) |
4187 | return cx_auto_add_pb_volume(codec, dac, name, idx); | ||
4188 | } | ||
4173 | caps = query_amp_caps(codec, pin, HDA_OUTPUT); | 4189 | caps = query_amp_caps(codec, pin, HDA_OUTPUT); |
4174 | if (caps & AC_AMPCAP_NUM_STEPS) | 4190 | if (caps & AC_AMPCAP_NUM_STEPS) |
4175 | return cx_auto_add_pb_volume(codec, pin, name, idx); | 4191 | return cx_auto_add_pb_volume(codec, pin, name, idx); |
@@ -4191,8 +4207,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec) | |||
4191 | for (i = 0; i < spec->dac_info_filled; i++) { | 4207 | for (i = 0; i < spec->dac_info_filled; i++) { |
4192 | const char *label; | 4208 | const char *label; |
4193 | int idx, type; | 4209 | int idx, type; |
4194 | if (!spec->dac_info[i].dac) | 4210 | hda_nid_t dac = spec->dac_info[i].dac; |
4195 | continue; | ||
4196 | type = spec->dac_info[i].type; | 4211 | type = spec->dac_info[i].type; |
4197 | if (type == AUTO_PIN_LINE_OUT) | 4212 | if (type == AUTO_PIN_LINE_OUT) |
4198 | type = spec->autocfg.line_out_type; | 4213 | type = spec->autocfg.line_out_type; |
@@ -4211,7 +4226,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec) | |||
4211 | idx = num_spk++; | 4226 | idx = num_spk++; |
4212 | break; | 4227 | break; |
4213 | } | 4228 | } |
4214 | err = try_add_pb_volume(codec, spec->dac_info[i].dac, | 4229 | err = try_add_pb_volume(codec, dac, |
4215 | spec->dac_info[i].pin, | 4230 | spec->dac_info[i].pin, |
4216 | label, idx); | 4231 | label, idx); |
4217 | if (err < 0) | 4232 | if (err < 0) |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index fcb11af9ad24..7cabd7317163 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -565,11 +565,11 @@ static void alc_hp_automute(struct hda_codec *codec) | |||
565 | { | 565 | { |
566 | struct alc_spec *spec = codec->spec; | 566 | struct alc_spec *spec = codec->spec; |
567 | 567 | ||
568 | if (!spec->automute) | ||
569 | return; | ||
570 | spec->jack_present = | 568 | spec->jack_present = |
571 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins), | 569 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins), |
572 | spec->autocfg.hp_pins); | 570 | spec->autocfg.hp_pins); |
571 | if (!spec->automute) | ||
572 | return; | ||
573 | update_speakers(codec); | 573 | update_speakers(codec); |
574 | } | 574 | } |
575 | 575 | ||
@@ -578,11 +578,11 @@ static void alc_line_automute(struct hda_codec *codec) | |||
578 | { | 578 | { |
579 | struct alc_spec *spec = codec->spec; | 579 | struct alc_spec *spec = codec->spec; |
580 | 580 | ||
581 | if (!spec->automute || !spec->detect_line) | ||
582 | return; | ||
583 | spec->line_jack_present = | 581 | spec->line_jack_present = |
584 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), | 582 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), |
585 | spec->autocfg.line_out_pins); | 583 | spec->autocfg.line_out_pins); |
584 | if (!spec->automute || !spec->detect_line) | ||
585 | return; | ||
586 | update_speakers(codec); | 586 | update_speakers(codec); |
587 | } | 587 | } |
588 | 588 | ||
@@ -3083,16 +3083,22 @@ static void alc_auto_init_multi_out(struct hda_codec *codec) | |||
3083 | static void alc_auto_init_extra_out(struct hda_codec *codec) | 3083 | static void alc_auto_init_extra_out(struct hda_codec *codec) |
3084 | { | 3084 | { |
3085 | struct alc_spec *spec = codec->spec; | 3085 | struct alc_spec *spec = codec->spec; |
3086 | hda_nid_t pin; | 3086 | hda_nid_t pin, dac; |
3087 | 3087 | ||
3088 | pin = spec->autocfg.hp_pins[0]; | 3088 | pin = spec->autocfg.hp_pins[0]; |
3089 | if (pin) | 3089 | if (pin) { |
3090 | alc_auto_set_output_and_unmute(codec, pin, PIN_HP, | 3090 | dac = spec->multiout.hp_nid; |
3091 | spec->multiout.hp_nid); | 3091 | if (!dac) |
3092 | dac = spec->multiout.dac_nids[0]; | ||
3093 | alc_auto_set_output_and_unmute(codec, pin, PIN_HP, dac); | ||
3094 | } | ||
3092 | pin = spec->autocfg.speaker_pins[0]; | 3095 | pin = spec->autocfg.speaker_pins[0]; |
3093 | if (pin) | 3096 | if (pin) { |
3094 | alc_auto_set_output_and_unmute(codec, pin, PIN_OUT, | 3097 | dac = spec->multiout.extra_out_nid[0]; |
3095 | spec->multiout.extra_out_nid[0]); | 3098 | if (!dac) |
3099 | dac = spec->multiout.dac_nids[0]; | ||
3100 | alc_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac); | ||
3101 | } | ||
3096 | } | 3102 | } |
3097 | 3103 | ||
3098 | /* | 3104 | /* |
diff --git a/sound/soc/blackfin/bf5xx-ad193x.c b/sound/soc/blackfin/bf5xx-ad193x.c index d6651c033cb7..a118a0fb9d81 100644 --- a/sound/soc/blackfin/bf5xx-ad193x.c +++ b/sound/soc/blackfin/bf5xx-ad193x.c | |||
@@ -56,7 +56,7 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, | |||
56 | 56 | ||
57 | switch (params_rate(params)) { | 57 | switch (params_rate(params)) { |
58 | case 48000: | 58 | case 48000: |
59 | clk = 12288000; | 59 | clk = 24576000; |
60 | break; | 60 | break; |
61 | } | 61 | } |
62 | 62 | ||
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 2374ca5ffe68..eedb6f5e5823 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c | |||
@@ -27,11 +27,6 @@ struct ad193x_priv { | |||
27 | int sysclk; | 27 | int sysclk; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | /* ad193x register cache & default register settings */ | ||
31 | static const u8 ad193x_reg[AD193X_NUM_REGS] = { | ||
32 | 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, | ||
33 | }; | ||
34 | |||
35 | /* | 30 | /* |
36 | * AD193X volume/mute/de-emphasis etc. controls | 31 | * AD193X volume/mute/de-emphasis etc. controls |
37 | */ | 32 | */ |
@@ -307,7 +302,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, | |||
307 | snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg); | 302 | snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg); |
308 | 303 | ||
309 | reg = snd_soc_read(codec, AD193X_DAC_CTRL2); | 304 | reg = snd_soc_read(codec, AD193X_DAC_CTRL2); |
310 | reg = (reg & (~AD193X_DAC_WORD_LEN_MASK)) | word_len; | 305 | reg = (reg & (~AD193X_DAC_WORD_LEN_MASK)) |
306 | | (word_len << AD193X_DAC_WORD_LEN_SHFT); | ||
311 | snd_soc_write(codec, AD193X_DAC_CTRL2, reg); | 307 | snd_soc_write(codec, AD193X_DAC_CTRL2, reg); |
312 | 308 | ||
313 | reg = snd_soc_read(codec, AD193X_ADC_CTRL1); | 309 | reg = snd_soc_read(codec, AD193X_ADC_CTRL1); |
@@ -389,9 +385,6 @@ static int ad193x_probe(struct snd_soc_codec *codec) | |||
389 | 385 | ||
390 | static struct snd_soc_codec_driver soc_codec_dev_ad193x = { | 386 | static struct snd_soc_codec_driver soc_codec_dev_ad193x = { |
391 | .probe = ad193x_probe, | 387 | .probe = ad193x_probe, |
392 | .reg_cache_default = ad193x_reg, | ||
393 | .reg_cache_size = AD193X_NUM_REGS, | ||
394 | .reg_word_size = sizeof(u16), | ||
395 | }; | 388 | }; |
396 | 389 | ||
397 | #if defined(CONFIG_SPI_MASTER) | 390 | #if defined(CONFIG_SPI_MASTER) |
diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h index 9747b5497877..cccc2e8e5fbd 100644 --- a/sound/soc/codecs/ad193x.h +++ b/sound/soc/codecs/ad193x.h | |||
@@ -34,7 +34,8 @@ | |||
34 | #define AD193X_DAC_LEFT_HIGH (1 << 3) | 34 | #define AD193X_DAC_LEFT_HIGH (1 << 3) |
35 | #define AD193X_DAC_BCLK_INV (1 << 7) | 35 | #define AD193X_DAC_BCLK_INV (1 << 7) |
36 | #define AD193X_DAC_CTRL2 0x804 | 36 | #define AD193X_DAC_CTRL2 0x804 |
37 | #define AD193X_DAC_WORD_LEN_MASK 0xC | 37 | #define AD193X_DAC_WORD_LEN_SHFT 3 |
38 | #define AD193X_DAC_WORD_LEN_MASK 0x18 | ||
38 | #define AD193X_DAC_MASTER_MUTE 1 | 39 | #define AD193X_DAC_MASTER_MUTE 1 |
39 | #define AD193X_DAC_CHNL_MUTE 0x805 | 40 | #define AD193X_DAC_CHNL_MUTE 0x805 |
40 | #define AD193X_DACL1_MUTE 0 | 41 | #define AD193X_DACL1_MUTE 0 |
@@ -63,7 +64,7 @@ | |||
63 | #define AD193X_ADC_CTRL1 0x80f | 64 | #define AD193X_ADC_CTRL1 0x80f |
64 | #define AD193X_ADC_SERFMT_MASK 0x60 | 65 | #define AD193X_ADC_SERFMT_MASK 0x60 |
65 | #define AD193X_ADC_SERFMT_STEREO (0 << 5) | 66 | #define AD193X_ADC_SERFMT_STEREO (0 << 5) |
66 | #define AD193X_ADC_SERFMT_TDM (1 << 2) | 67 | #define AD193X_ADC_SERFMT_TDM (1 << 5) |
67 | #define AD193X_ADC_SERFMT_AUX (2 << 5) | 68 | #define AD193X_ADC_SERFMT_AUX (2 << 5) |
68 | #define AD193X_ADC_WORD_LEN_MASK 0x3 | 69 | #define AD193X_ADC_WORD_LEN_MASK 0x3 |
69 | #define AD193X_ADC_CTRL2 0x810 | 70 | #define AD193X_ADC_CTRL2 0x810 |
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 409d89d1f34c..fbd7eb9e61ce 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
@@ -857,6 +857,7 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c, | |||
857 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); | 857 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); |
858 | if (ret != 0) { | 858 | if (ret != 0) { |
859 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); | 859 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); |
860 | kfree(sta32x); | ||
860 | return ret; | 861 | return ret; |
861 | } | 862 | } |
862 | 863 | ||
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 60d740ebeb5b..1725550c293e 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -2221,6 +2221,8 @@ static int sysclk_event(struct snd_soc_dapm_widget *w, | |||
2221 | switch (event) { | 2221 | switch (event) { |
2222 | case SND_SOC_DAPM_PRE_PMU: | 2222 | case SND_SOC_DAPM_PRE_PMU: |
2223 | if (fll) { | 2223 | if (fll) { |
2224 | try_wait_for_completion(&wm8962->fll_lock); | ||
2225 | |||
2224 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, | 2226 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
2225 | WM8962_FLL_ENA, WM8962_FLL_ENA); | 2227 | WM8962_FLL_ENA, WM8962_FLL_ENA); |
2226 | if (wm8962->irq) { | 2228 | if (wm8962->irq) { |
@@ -2927,10 +2929,6 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec, | |||
2927 | WM8962_BIAS_ENA | 0x180); | 2929 | WM8962_BIAS_ENA | 0x180); |
2928 | 2930 | ||
2929 | msleep(5); | 2931 | msleep(5); |
2930 | |||
2931 | snd_soc_update_bits(codec, WM8962_CLOCKING2, | ||
2932 | WM8962_CLKREG_OVD, | ||
2933 | WM8962_CLKREG_OVD); | ||
2934 | } | 2932 | } |
2935 | 2933 | ||
2936 | /* VMID 2*250k */ | 2934 | /* VMID 2*250k */ |
@@ -3288,6 +3286,8 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
3288 | snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda); | 3286 | snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda); |
3289 | snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n); | 3287 | snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n); |
3290 | 3288 | ||
3289 | try_wait_for_completion(&wm8962->fll_lock); | ||
3290 | |||
3291 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, | 3291 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
3292 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | | 3292 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | |
3293 | WM8962_FLL_ENA, fll1); | 3293 | WM8962_FLL_ENA, fll1); |
@@ -3868,6 +3868,10 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3868 | */ | 3868 | */ |
3869 | snd_soc_update_bits(codec, WM8962_CLOCKING2, WM8962_SYSCLK_ENA, 0); | 3869 | snd_soc_update_bits(codec, WM8962_CLOCKING2, WM8962_SYSCLK_ENA, 0); |
3870 | 3870 | ||
3871 | /* Ensure we have soft control over all registers */ | ||
3872 | snd_soc_update_bits(codec, WM8962_CLOCKING2, | ||
3873 | WM8962_CLKREG_OVD, WM8962_CLKREG_OVD); | ||
3874 | |||
3871 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | 3875 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); |
3872 | 3876 | ||
3873 | if (pdata) { | 3877 | if (pdata) { |
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index ab8e9d1aaff0..0cdb9d105671 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -420,7 +420,7 @@ static const char *sidetone_hpf_text[] = { | |||
420 | }; | 420 | }; |
421 | 421 | ||
422 | static const struct soc_enum sidetone_hpf = | 422 | static const struct soc_enum sidetone_hpf = |
423 | SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 6, sidetone_hpf_text); | 423 | SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 7, sidetone_hpf_text); |
424 | 424 | ||
425 | static const char *hpf_mode_text[] = { | 425 | static const char *hpf_mode_text[] = { |
426 | "HiFi", "Custom", "Voice" | 426 | "HiFi", "Custom", "Voice" |
@@ -988,15 +988,10 @@ SND_SOC_DAPM_MICBIAS("MICB1", WM8996_POWER_MANAGEMENT_1, 8, 0), | |||
988 | SND_SOC_DAPM_PGA("IN1L PGA", WM8996_POWER_MANAGEMENT_2, 5, 0, NULL, 0), | 988 | SND_SOC_DAPM_PGA("IN1L PGA", WM8996_POWER_MANAGEMENT_2, 5, 0, NULL, 0), |
989 | SND_SOC_DAPM_PGA("IN1R PGA", WM8996_POWER_MANAGEMENT_2, 4, 0, NULL, 0), | 989 | SND_SOC_DAPM_PGA("IN1R PGA", WM8996_POWER_MANAGEMENT_2, 4, 0, NULL, 0), |
990 | 990 | ||
991 | SND_SOC_DAPM_MUX("IN1L Mux", SND_SOC_NOPM, 0, 0, &in1_mux), | 991 | SND_SOC_DAPM_MUX("IN1L Mux", WM8996_POWER_MANAGEMENT_7, 2, 0, &in1_mux), |
992 | SND_SOC_DAPM_MUX("IN1R Mux", SND_SOC_NOPM, 0, 0, &in1_mux), | 992 | SND_SOC_DAPM_MUX("IN1R Mux", WM8996_POWER_MANAGEMENT_7, 3, 0, &in1_mux), |
993 | SND_SOC_DAPM_MUX("IN2L Mux", SND_SOC_NOPM, 0, 0, &in2_mux), | 993 | SND_SOC_DAPM_MUX("IN2L Mux", WM8996_POWER_MANAGEMENT_7, 6, 0, &in2_mux), |
994 | SND_SOC_DAPM_MUX("IN2R Mux", SND_SOC_NOPM, 0, 0, &in2_mux), | 994 | SND_SOC_DAPM_MUX("IN2R Mux", WM8996_POWER_MANAGEMENT_7, 7, 0, &in2_mux), |
995 | |||
996 | SND_SOC_DAPM_PGA("IN1L", WM8996_POWER_MANAGEMENT_7, 2, 0, NULL, 0), | ||
997 | SND_SOC_DAPM_PGA("IN1R", WM8996_POWER_MANAGEMENT_7, 3, 0, NULL, 0), | ||
998 | SND_SOC_DAPM_PGA("IN2L", WM8996_POWER_MANAGEMENT_7, 6, 0, NULL, 0), | ||
999 | SND_SOC_DAPM_PGA("IN2R", WM8996_POWER_MANAGEMENT_7, 7, 0, NULL, 0), | ||
1000 | 995 | ||
1001 | SND_SOC_DAPM_SUPPLY("DMIC2", WM8996_POWER_MANAGEMENT_7, 9, 0, NULL, 0), | 996 | SND_SOC_DAPM_SUPPLY("DMIC2", WM8996_POWER_MANAGEMENT_7, 9, 0, NULL, 0), |
1002 | SND_SOC_DAPM_SUPPLY("DMIC1", WM8996_POWER_MANAGEMENT_7, 8, 0, NULL, 0), | 997 | SND_SOC_DAPM_SUPPLY("DMIC1", WM8996_POWER_MANAGEMENT_7, 8, 0, NULL, 0), |
@@ -1213,6 +1208,16 @@ static const struct snd_soc_dapm_route wm8996_dapm_routes[] = { | |||
1213 | { "AIF2RX0", NULL, "AIFCLK" }, | 1208 | { "AIF2RX0", NULL, "AIFCLK" }, |
1214 | { "AIF2RX1", NULL, "AIFCLK" }, | 1209 | { "AIF2RX1", NULL, "AIFCLK" }, |
1215 | 1210 | ||
1211 | { "AIF1TX0", NULL, "AIFCLK" }, | ||
1212 | { "AIF1TX1", NULL, "AIFCLK" }, | ||
1213 | { "AIF1TX2", NULL, "AIFCLK" }, | ||
1214 | { "AIF1TX3", NULL, "AIFCLK" }, | ||
1215 | { "AIF1TX4", NULL, "AIFCLK" }, | ||
1216 | { "AIF1TX5", NULL, "AIFCLK" }, | ||
1217 | |||
1218 | { "AIF2TX0", NULL, "AIFCLK" }, | ||
1219 | { "AIF2TX1", NULL, "AIFCLK" }, | ||
1220 | |||
1216 | { "DSP1RXL", NULL, "SYSDSPCLK" }, | 1221 | { "DSP1RXL", NULL, "SYSDSPCLK" }, |
1217 | { "DSP1RXR", NULL, "SYSDSPCLK" }, | 1222 | { "DSP1RXR", NULL, "SYSDSPCLK" }, |
1218 | { "DSP2RXL", NULL, "SYSDSPCLK" }, | 1223 | { "DSP2RXL", NULL, "SYSDSPCLK" }, |
@@ -2106,6 +2111,9 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
2106 | 2111 | ||
2107 | snd_soc_write(codec, WM8996_FLL_EFS_1, fll_div.lambda); | 2112 | snd_soc_write(codec, WM8996_FLL_EFS_1, fll_div.lambda); |
2108 | 2113 | ||
2114 | /* Clear any pending completions (eg, from failed startups) */ | ||
2115 | try_wait_for_completion(&wm8996->fll_lock); | ||
2116 | |||
2109 | snd_soc_update_bits(codec, WM8996_FLL_CONTROL_1, | 2117 | snd_soc_update_bits(codec, WM8996_FLL_CONTROL_1, |
2110 | WM8996_FLL_ENA, WM8996_FLL_ENA); | 2118 | WM8996_FLL_ENA, WM8996_FLL_ENA); |
2111 | 2119 | ||
diff --git a/sound/soc/ep93xx/ep93xx-i2s.c b/sound/soc/ep93xx/ep93xx-i2s.c index 56efa0c1c9a9..099614e16651 100644 --- a/sound/soc/ep93xx/ep93xx-i2s.c +++ b/sound/soc/ep93xx/ep93xx-i2s.c | |||
@@ -385,14 +385,14 @@ static int ep93xx_i2s_probe(struct platform_device *pdev) | |||
385 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 385 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
386 | if (!res) { | 386 | if (!res) { |
387 | err = -ENODEV; | 387 | err = -ENODEV; |
388 | goto fail; | 388 | goto fail_free_info; |
389 | } | 389 | } |
390 | 390 | ||
391 | info->mem = request_mem_region(res->start, resource_size(res), | 391 | info->mem = request_mem_region(res->start, resource_size(res), |
392 | pdev->name); | 392 | pdev->name); |
393 | if (!info->mem) { | 393 | if (!info->mem) { |
394 | err = -EBUSY; | 394 | err = -EBUSY; |
395 | goto fail; | 395 | goto fail_free_info; |
396 | } | 396 | } |
397 | 397 | ||
398 | info->regs = ioremap(info->mem->start, resource_size(info->mem)); | 398 | info->regs = ioremap(info->mem->start, resource_size(info->mem)); |
@@ -435,6 +435,7 @@ fail_unmap_mem: | |||
435 | iounmap(info->regs); | 435 | iounmap(info->regs); |
436 | fail_release_mem: | 436 | fail_release_mem: |
437 | release_mem_region(info->mem->start, resource_size(info->mem)); | 437 | release_mem_region(info->mem->start, resource_size(info->mem)); |
438 | fail_free_info: | ||
438 | kfree(info); | 439 | kfree(info); |
439 | fail: | 440 | fail: |
440 | return err; | 441 | return err; |
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 732208c8c0b4..cb50598338e9 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c | |||
@@ -879,10 +879,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np) | |||
879 | * assume that device_node pointers are a valid comparison. | 879 | * assume that device_node pointers are a valid comparison. |
880 | */ | 880 | */ |
881 | np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0); | 881 | np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0); |
882 | of_node_put(np); | ||
882 | if (np == dma_channel_np) | 883 | if (np == dma_channel_np) |
883 | return ssi_np; | 884 | return ssi_np; |
884 | 885 | ||
885 | np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0); | 886 | np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0); |
887 | of_node_put(np); | ||
886 | if (np == dma_channel_np) | 888 | if (np == dma_channel_np) |
887 | return ssi_np; | 889 | return ssi_np; |
888 | } | 890 | } |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index a19297959587..358f0baaf71b 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -345,8 +345,10 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
345 | } | 345 | } |
346 | 346 | ||
347 | machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); | 347 | machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); |
348 | if (!machine_data) | 348 | if (!machine_data) { |
349 | return -ENOMEM; | 349 | ret = -ENOMEM; |
350 | goto error_alloc; | ||
351 | } | ||
350 | 352 | ||
351 | machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); | 353 | machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); |
352 | machine_data->dai[0].ops = &mpc8610_hpcd_ops; | 354 | machine_data->dai[0].ops = &mpc8610_hpcd_ops; |
@@ -494,7 +496,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
494 | ret = platform_device_add(sound_device); | 496 | ret = platform_device_add(sound_device); |
495 | if (ret) { | 497 | if (ret) { |
496 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
497 | goto error; | 499 | goto error_sound; |
498 | } | 500 | } |
499 | dev_set_drvdata(&pdev->dev, sound_device); | 501 | dev_set_drvdata(&pdev->dev, sound_device); |
500 | 502 | ||
@@ -502,14 +504,12 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
502 | 504 | ||
503 | return 0; | 505 | return 0; |
504 | 506 | ||
507 | error_sound: | ||
508 | platform_device_unregister(sound_device); | ||
505 | error: | 509 | error: |
506 | of_node_put(codec_np); | ||
507 | |||
508 | if (sound_device) | ||
509 | platform_device_unregister(sound_device); | ||
510 | |||
511 | kfree(machine_data); | 510 | kfree(machine_data); |
512 | 511 | error_alloc: | |
512 | of_node_put(codec_np); | ||
513 | return ret; | 513 | return ret; |
514 | } | 514 | } |
515 | 515 | ||
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 8fa4d5f8eda1..fcb862eb0c73 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c | |||
@@ -297,8 +297,10 @@ static int get_dma_channel(struct device_node *ssi_np, | |||
297 | * dai->platform name should already point to an allocated buffer. | 297 | * dai->platform name should already point to an allocated buffer. |
298 | */ | 298 | */ |
299 | ret = of_address_to_resource(dma_channel_np, 0, &res); | 299 | ret = of_address_to_resource(dma_channel_np, 0, &res); |
300 | if (ret) | 300 | if (ret) { |
301 | of_node_put(dma_channel_np); | ||
301 | return ret; | 302 | return ret; |
303 | } | ||
302 | snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s", | 304 | snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s", |
303 | (unsigned long long) res.start, dma_channel_np->name); | 305 | (unsigned long long) res.start, dma_channel_np->name); |
304 | 306 | ||
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index a33fc51f363b..8f16cd37c2af 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c | |||
@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev) | |||
424 | if (!priv->mem) { | 424 | if (!priv->mem) { |
425 | dev_err(&pdev->dev, "request_mem_region failed\n"); | 425 | dev_err(&pdev->dev, "request_mem_region failed\n"); |
426 | err = -EBUSY; | 426 | err = -EBUSY; |
427 | goto error; | 427 | goto error_alloc; |
428 | } | 428 | } |
429 | 429 | ||
430 | priv->io = ioremap(priv->mem->start, SZ_16K); | 430 | priv->io = ioremap(priv->mem->start, SZ_16K); |
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 30fe0d0efe1c..0aa475f92efa 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c | |||
@@ -514,7 +514,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) | |||
514 | } | 514 | } |
515 | 515 | ||
516 | /* Set codec bias level */ | 516 | /* Set codec bias level */ |
517 | ams_delta_set_bias_level(card, SND_SOC_BIAS_STANDBY); | 517 | ams_delta_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY); |
518 | 518 | ||
519 | /* Add hook switch - can be used to control the codec from userspace | 519 | /* Add hook switch - can be used to control the codec from userspace |
520 | * even if line discipline fails */ | 520 | * even if line discipline fails */ |
@@ -649,7 +649,9 @@ static void __exit ams_delta_module_exit(void) | |||
649 | ams_delta_hook_switch_gpios); | 649 | ams_delta_hook_switch_gpios); |
650 | 650 | ||
651 | /* Keep modem power on */ | 651 | /* Keep modem power on */ |
652 | ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY); | 652 | ams_delta_set_bias_level(&ams_delta_audio_card, |
653 | &ams_delta_audio_card.rtd[0].codec->dapm, | ||
654 | SND_SOC_BIAS_STANDBY); | ||
653 | 655 | ||
654 | platform_device_unregister(cx20442_platform_device); | 656 | platform_device_unregister(cx20442_platform_device); |
655 | platform_device_unregister(ams_delta_audio_platform_device); | 657 | platform_device_unregister(ams_delta_audio_platform_device); |
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index b99091fc34eb..65f980ef2870 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig | |||
@@ -185,6 +185,7 @@ config SND_SOC_SPEYSIDE | |||
185 | select SND_SAMSUNG_I2S | 185 | select SND_SAMSUNG_I2S |
186 | select SND_SOC_WM8996 | 186 | select SND_SOC_WM8996 |
187 | select SND_SOC_WM9081 | 187 | select SND_SOC_WM9081 |
188 | select SND_SOC_WM1250_EV1 | ||
188 | 189 | ||
189 | config SND_SOC_SPEYSIDE_WM8962 | 190 | config SND_SOC_SPEYSIDE_WM8962 |
190 | tristate "Audio support for Wolfson Speyside with WM8962" | 191 | tristate "Audio support for Wolfson Speyside with WM8962" |
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index 241f55d00660..c6c65892294e 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c | |||
@@ -13,6 +13,7 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/types.h> | ||
16 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
17 | 18 | ||
18 | #include <sound/soc.h> | 19 | #include <sound/soc.h> |
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 1e574a5d440d..bc8c1676459f 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/types.h> | ||
20 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
21 | 22 | ||
22 | #include <sound/soc.h> | 23 | #include <sound/soc.h> |
diff --git a/sound/soc/samsung/speyside_wm8962.c b/sound/soc/samsung/speyside_wm8962.c index 0b9eb5f7ec4c..72535f2daaf2 100644 --- a/sound/soc/samsung/speyside_wm8962.c +++ b/sound/soc/samsung/speyside_wm8962.c | |||
@@ -23,6 +23,9 @@ static int speyside_wm8962_set_bias_level(struct snd_soc_card *card, | |||
23 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; | 23 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; |
24 | int ret; | 24 | int ret; |
25 | 25 | ||
26 | if (dapm->dev != codec_dai->dev) | ||
27 | return 0; | ||
28 | |||
26 | switch (level) { | 29 | switch (level) { |
27 | case SND_SOC_BIAS_PREPARE: | 30 | case SND_SOC_BIAS_PREPARE: |
28 | if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { | 31 | if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { |
@@ -57,6 +60,9 @@ static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card, | |||
57 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; | 60 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; |
58 | int ret; | 61 | int ret; |
59 | 62 | ||
63 | if (dapm->dev != codec_dai->dev) | ||
64 | return 0; | ||
65 | |||
60 | switch (level) { | 66 | switch (level) { |
61 | case SND_SOC_BIAS_STANDBY: | 67 | case SND_SOC_BIAS_STANDBY: |
62 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK, | 68 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK, |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 83ad8ca27490..b085d8e87574 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1913,7 +1913,7 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | |||
1913 | 1913 | ||
1914 | if (prefix) { | 1914 | if (prefix) { |
1915 | name_len = strlen(long_name) + strlen(prefix) + 2; | 1915 | name_len = strlen(long_name) + strlen(prefix) + 2; |
1916 | name = kmalloc(name_len, GFP_ATOMIC); | 1916 | name = kmalloc(name_len, GFP_KERNEL); |
1917 | if (!name) | 1917 | if (!name) |
1918 | return NULL; | 1918 | return NULL; |
1919 | 1919 | ||
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index cca490c80589..a62f7dd4ba96 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c | |||
@@ -205,6 +205,25 @@ static unsigned int snd_soc_16_8_read_i2c(struct snd_soc_codec *codec, | |||
205 | #define snd_soc_16_8_read_i2c NULL | 205 | #define snd_soc_16_8_read_i2c NULL |
206 | #endif | 206 | #endif |
207 | 207 | ||
208 | #if defined(CONFIG_SPI_MASTER) | ||
209 | static unsigned int snd_soc_16_8_read_spi(struct snd_soc_codec *codec, | ||
210 | unsigned int r) | ||
211 | { | ||
212 | struct spi_device *spi = codec->control_data; | ||
213 | |||
214 | const u16 reg = cpu_to_be16(r | 0x100); | ||
215 | u8 data; | ||
216 | int ret; | ||
217 | |||
218 | ret = spi_write_then_read(spi, ®, 2, &data, 1); | ||
219 | if (ret < 0) | ||
220 | return 0; | ||
221 | return data; | ||
222 | } | ||
223 | #else | ||
224 | #define snd_soc_16_8_read_spi NULL | ||
225 | #endif | ||
226 | |||
208 | static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg, | 227 | static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg, |
209 | unsigned int value) | 228 | unsigned int value) |
210 | { | 229 | { |
@@ -295,6 +314,7 @@ static struct { | |||
295 | int (*write)(struct snd_soc_codec *codec, unsigned int, unsigned int); | 314 | int (*write)(struct snd_soc_codec *codec, unsigned int, unsigned int); |
296 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | 315 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); |
297 | unsigned int (*i2c_read)(struct snd_soc_codec *, unsigned int); | 316 | unsigned int (*i2c_read)(struct snd_soc_codec *, unsigned int); |
317 | unsigned int (*spi_read)(struct snd_soc_codec *, unsigned int); | ||
298 | } io_types[] = { | 318 | } io_types[] = { |
299 | { | 319 | { |
300 | .addr_bits = 4, .data_bits = 12, | 320 | .addr_bits = 4, .data_bits = 12, |
@@ -318,6 +338,7 @@ static struct { | |||
318 | .addr_bits = 16, .data_bits = 8, | 338 | .addr_bits = 16, .data_bits = 8, |
319 | .write = snd_soc_16_8_write, | 339 | .write = snd_soc_16_8_write, |
320 | .i2c_read = snd_soc_16_8_read_i2c, | 340 | .i2c_read = snd_soc_16_8_read_i2c, |
341 | .spi_read = snd_soc_16_8_read_spi, | ||
321 | }, | 342 | }, |
322 | { | 343 | { |
323 | .addr_bits = 16, .data_bits = 16, | 344 | .addr_bits = 16, .data_bits = 16, |
@@ -383,6 +404,8 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
383 | #ifdef CONFIG_SPI_MASTER | 404 | #ifdef CONFIG_SPI_MASTER |
384 | codec->hw_write = do_spi_write; | 405 | codec->hw_write = do_spi_write; |
385 | #endif | 406 | #endif |
407 | if (io_types[i].spi_read) | ||
408 | codec->hw_read = io_types[i].spi_read; | ||
386 | 409 | ||
387 | codec->control_data = container_of(codec->dev, | 410 | codec->control_data = container_of(codec->dev, |
388 | struct spi_device, | 411 | struct spi_device, |
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 7c17b98d5846..38b00131b2fe 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c | |||
@@ -327,7 +327,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | |||
327 | IRQF_TRIGGER_FALLING, | 327 | IRQF_TRIGGER_FALLING, |
328 | gpios[i].name, | 328 | gpios[i].name, |
329 | &gpios[i]); | 329 | &gpios[i]); |
330 | if (ret) | 330 | if (ret < 0) |
331 | goto err; | 331 | goto err; |
332 | 332 | ||
333 | if (gpios[i].wake) { | 333 | if (gpios[i].wake) { |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b5759397afa3..2879c883eebc 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -290,6 +290,9 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) | |||
290 | codec_dai->active--; | 290 | codec_dai->active--; |
291 | codec->active--; | 291 | codec->active--; |
292 | 292 | ||
293 | if (!cpu_dai->active && !codec_dai->active) | ||
294 | rtd->rate = 0; | ||
295 | |||
293 | /* Muting the DAC suppresses artifacts caused during digital | 296 | /* Muting the DAC suppresses artifacts caused during digital |
294 | * shutdown, for example from stopping clocks. | 297 | * shutdown, for example from stopping clocks. |
295 | */ | 298 | */ |
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 661373c2352a..be27f1d229af 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c | |||
@@ -319,7 +319,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) | |||
319 | snd_soc_dapm_force_enable_pin(dapm, "Mic Bias"); | 319 | snd_soc_dapm_force_enable_pin(dapm, "Mic Bias"); |
320 | 320 | ||
321 | /* FIXME: Calculate automatically based on DAPM routes? */ | 321 | /* FIXME: Calculate automatically based on DAPM routes? */ |
322 | if (!machine_is_harmony() && !machine_is_ventana()) | 322 | if (!machine_is_harmony()) |
323 | snd_soc_dapm_nc_pin(dapm, "IN1L"); | 323 | snd_soc_dapm_nc_pin(dapm, "IN1L"); |
324 | if (!machine_is_seaboard() && !machine_is_aebl()) | 324 | if (!machine_is_seaboard() && !machine_is_aebl()) |
325 | snd_soc_dapm_nc_pin(dapm, "IN1R"); | 325 | snd_soc_dapm_nc_pin(dapm, "IN1R"); |
@@ -395,7 +395,7 @@ static __devinit int tegra_wm8903_driver_probe(struct platform_device *pdev) | |||
395 | platform_set_drvdata(pdev, card); | 395 | platform_set_drvdata(pdev, card); |
396 | snd_soc_card_set_drvdata(card, machine); | 396 | snd_soc_card_set_drvdata(card, machine); |
397 | 397 | ||
398 | if (machine_is_harmony() || machine_is_ventana()) { | 398 | if (machine_is_harmony()) { |
399 | card->dapm_routes = harmony_audio_map; | 399 | card->dapm_routes = harmony_audio_map; |
400 | card->num_dapm_routes = ARRAY_SIZE(harmony_audio_map); | 400 | card->num_dapm_routes = ARRAY_SIZE(harmony_audio_map); |
401 | } else if (machine_is_seaboard()) { | 401 | } else if (machine_is_seaboard()) { |