diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-09-16 02:29:04 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-16 02:29:04 -0400 |
commit | 0308110615acb4b6409fe042caf22bb9fb075d85 (patch) | |
tree | d129f11ebdbe49b21246a72e6ba52c50e81e8e7e | |
parent | c731bc96ad641a5fa3d50a87b474652505507282 (diff) | |
parent | 763437a9e7737535b2fc72175ad4974048769be6 (diff) |
Merge branch 'fix/misc' into topic/misc
33 files changed, 222 insertions, 120 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 46e3e6b99220..0b4ccdd35bbb 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 |
@@ -7199,6 +7200,9 @@ W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices | |||
7199 | S: Supported | 7200 | S: Supported |
7200 | F: Documentation/hwmon/wm83?? | 7201 | F: Documentation/hwmon/wm83?? |
7201 | F: drivers/leds/leds-wm83*.c | 7202 | F: drivers/leds/leds-wm83*.c |
7203 | F: drivers/input/misc/wm831x-on.c | ||
7204 | F: drivers/input/touchscreen/wm831x-ts.c | ||
7205 | F: drivers/input/touchscreen/wm97*.c | ||
7202 | F: drivers/mfd/wm8*.c | 7206 | F: drivers/mfd/wm8*.c |
7203 | F: drivers/power/wm83*.c | 7207 | F: drivers/power/wm83*.c |
7204 | F: drivers/rtc/rtc-wm83*.c | 7208 | F: drivers/rtc/rtc-wm83*.c |
@@ -7208,6 +7212,7 @@ F: drivers/watchdog/wm83*_wdt.c | |||
7208 | F: include/linux/mfd/wm831x/ | 7212 | F: include/linux/mfd/wm831x/ |
7209 | F: include/linux/mfd/wm8350/ | 7213 | F: include/linux/mfd/wm8350/ |
7210 | F: include/linux/mfd/wm8400* | 7214 | F: include/linux/mfd/wm8400* |
7215 | F: include/linux/wm97xx.h | ||
7211 | F: include/sound/wm????.h | 7216 | F: include/sound/wm????.h |
7212 | F: sound/soc/codecs/wm* | 7217 | F: sound/soc/codecs/wm* |
7213 | 7218 | ||
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 3fd1a7e24928..552b97afbca5 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c | |||
@@ -1073,10 +1073,10 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) | |||
1073 | sdev->pcmid = -1; | 1073 | sdev->pcmid = -1; |
1074 | list_del(&ldev->list); | 1074 | list_del(&ldev->list); |
1075 | layouts_list_items--; | 1075 | layouts_list_items--; |
1076 | kfree(ldev); | ||
1076 | outnodev: | 1077 | outnodev: |
1077 | of_node_put(sound); | 1078 | of_node_put(sound); |
1078 | layout_device = NULL; | 1079 | layout_device = NULL; |
1079 | kfree(ldev); | ||
1080 | return -ENODEV; | 1080 | return -ENODEV; |
1081 | } | 1081 | } |
1082 | 1082 | ||
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 86d0caf91b35..62e90b862a0d 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -1761,6 +1761,10 @@ static int wait_for_avail(struct snd_pcm_substream *substream, | |||
1761 | snd_pcm_uframes_t avail = 0; | 1761 | snd_pcm_uframes_t avail = 0; |
1762 | long wait_time, tout; | 1762 | long wait_time, tout; |
1763 | 1763 | ||
1764 | init_waitqueue_entry(&wait, current); | ||
1765 | set_current_state(TASK_INTERRUPTIBLE); | ||
1766 | add_wait_queue(&runtime->tsleep, &wait); | ||
1767 | |||
1764 | if (runtime->no_period_wakeup) | 1768 | if (runtime->no_period_wakeup) |
1765 | wait_time = MAX_SCHEDULE_TIMEOUT; | 1769 | wait_time = MAX_SCHEDULE_TIMEOUT; |
1766 | else { | 1770 | else { |
@@ -1771,16 +1775,32 @@ static int wait_for_avail(struct snd_pcm_substream *substream, | |||
1771 | } | 1775 | } |
1772 | wait_time = msecs_to_jiffies(wait_time * 1000); | 1776 | wait_time = msecs_to_jiffies(wait_time * 1000); |
1773 | } | 1777 | } |
1774 | init_waitqueue_entry(&wait, current); | 1778 | |
1775 | add_wait_queue(&runtime->tsleep, &wait); | ||
1776 | for (;;) { | 1779 | for (;;) { |
1777 | if (signal_pending(current)) { | 1780 | if (signal_pending(current)) { |
1778 | err = -ERESTARTSYS; | 1781 | err = -ERESTARTSYS; |
1779 | break; | 1782 | break; |
1780 | } | 1783 | } |
1784 | |||
1785 | /* | ||
1786 | * We need to check if space became available already | ||
1787 | * (and thus the wakeup happened already) first to close | ||
1788 | * the race of space already having become available. | ||
1789 | * This check must happen after been added to the waitqueue | ||
1790 | * and having current state be INTERRUPTIBLE. | ||
1791 | */ | ||
1792 | if (is_playback) | ||
1793 | avail = snd_pcm_playback_avail(runtime); | ||
1794 | else | ||
1795 | avail = snd_pcm_capture_avail(runtime); | ||
1796 | if (avail >= runtime->twake) | ||
1797 | break; | ||
1781 | snd_pcm_stream_unlock_irq(substream); | 1798 | snd_pcm_stream_unlock_irq(substream); |
1782 | tout = schedule_timeout_interruptible(wait_time); | 1799 | |
1800 | tout = schedule_timeout(wait_time); | ||
1801 | |||
1783 | snd_pcm_stream_lock_irq(substream); | 1802 | snd_pcm_stream_lock_irq(substream); |
1803 | set_current_state(TASK_INTERRUPTIBLE); | ||
1784 | switch (runtime->status->state) { | 1804 | switch (runtime->status->state) { |
1785 | case SNDRV_PCM_STATE_SUSPENDED: | 1805 | case SNDRV_PCM_STATE_SUSPENDED: |
1786 | err = -ESTRPIPE; | 1806 | err = -ESTRPIPE; |
@@ -1806,14 +1826,9 @@ static int wait_for_avail(struct snd_pcm_substream *substream, | |||
1806 | err = -EIO; | 1826 | err = -EIO; |
1807 | break; | 1827 | break; |
1808 | } | 1828 | } |
1809 | if (is_playback) | ||
1810 | avail = snd_pcm_playback_avail(runtime); | ||
1811 | else | ||
1812 | avail = snd_pcm_capture_avail(runtime); | ||
1813 | if (avail >= runtime->twake) | ||
1814 | break; | ||
1815 | } | 1829 | } |
1816 | _endloop: | 1830 | _endloop: |
1831 | set_current_state(TASK_RUNNING); | ||
1817 | remove_wait_queue(&runtime->tsleep, &wait); | 1832 | remove_wait_queue(&runtime->tsleep, &wait); |
1818 | *availp = avail; | 1833 | *availp = avail; |
1819 | return err; | 1834 | return err; |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 3e7850c238c3..f3aefef37216 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -579,9 +579,13 @@ int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux, | |||
579 | return -1; | 579 | return -1; |
580 | } | 580 | } |
581 | recursive++; | 581 | recursive++; |
582 | for (i = 0; i < nums; i++) | 582 | for (i = 0; i < nums; i++) { |
583 | unsigned int type = get_wcaps_type(get_wcaps(codec, conn[i])); | ||
584 | if (type == AC_WID_PIN || type == AC_WID_AUD_OUT) | ||
585 | continue; | ||
583 | if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0) | 586 | if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0) |
584 | return i; | 587 | return i; |
588 | } | ||
585 | return -1; | 589 | return -1; |
586 | } | 590 | } |
587 | EXPORT_SYMBOL_HDA(snd_hda_get_conn_index); | 591 | EXPORT_SYMBOL_HDA(snd_hda_get_conn_index); |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index 28ce17d09c33..c34f730f4815 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -144,25 +144,17 @@ static int cea_sampling_frequencies[8] = { | |||
144 | SNDRV_PCM_RATE_192000, /* 7: 192000Hz */ | 144 | SNDRV_PCM_RATE_192000, /* 7: 192000Hz */ |
145 | }; | 145 | }; |
146 | 146 | ||
147 | static unsigned char hdmi_get_eld_byte(struct hda_codec *codec, hda_nid_t nid, | 147 | static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid, |
148 | int byte_index) | 148 | int byte_index) |
149 | { | 149 | { |
150 | unsigned int val; | 150 | unsigned int val; |
151 | 151 | ||
152 | val = snd_hda_codec_read(codec, nid, 0, | 152 | val = snd_hda_codec_read(codec, nid, 0, |
153 | AC_VERB_GET_HDMI_ELDD, byte_index); | 153 | AC_VERB_GET_HDMI_ELDD, byte_index); |
154 | |||
155 | #ifdef BE_PARANOID | 154 | #ifdef BE_PARANOID |
156 | printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); | 155 | printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); |
157 | #endif | 156 | #endif |
158 | 157 | return val; | |
159 | if ((val & AC_ELDD_ELD_VALID) == 0) { | ||
160 | snd_printd(KERN_INFO "HDMI: invalid ELD data byte %d\n", | ||
161 | byte_index); | ||
162 | val = 0; | ||
163 | } | ||
164 | |||
165 | return val & AC_ELDD_ELD_DATA; | ||
166 | } | 158 | } |
167 | 159 | ||
168 | #define GRAB_BITS(buf, byte, lowbit, bits) \ | 160 | #define GRAB_BITS(buf, byte, lowbit, bits) \ |
@@ -344,11 +336,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, | |||
344 | if (!buf) | 336 | if (!buf) |
345 | return -ENOMEM; | 337 | return -ENOMEM; |
346 | 338 | ||
347 | for (i = 0; i < size; i++) | 339 | for (i = 0; i < size; i++) { |
348 | buf[i] = hdmi_get_eld_byte(codec, nid, i); | 340 | unsigned int val = hdmi_get_eld_data(codec, nid, i); |
341 | if (!(val & AC_ELDD_ELD_VALID)) { | ||
342 | if (!i) { | ||
343 | snd_printd(KERN_INFO | ||
344 | "HDMI: invalid ELD data\n"); | ||
345 | ret = -EINVAL; | ||
346 | goto error; | ||
347 | } | ||
348 | snd_printd(KERN_INFO | ||
349 | "HDMI: invalid ELD data byte %d\n", i); | ||
350 | val = 0; | ||
351 | } else | ||
352 | val &= AC_ELDD_ELD_DATA; | ||
353 | buf[i] = val; | ||
354 | } | ||
349 | 355 | ||
350 | ret = hdmi_update_eld(eld, buf, size); | 356 | ret = hdmi_update_eld(eld, buf, size); |
351 | 357 | ||
358 | error: | ||
352 | kfree(buf); | 359 | kfree(buf); |
353 | return ret; | 360 | return ret; |
354 | } | 361 | } |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 47d6ffc9b5b5..c45f3e69bcf0 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -375,7 +375,7 @@ static int is_ext_mic(struct hda_codec *codec, unsigned int idx) | |||
375 | static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, | 375 | static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, |
376 | unsigned int *idxp) | 376 | unsigned int *idxp) |
377 | { | 377 | { |
378 | int i; | 378 | int i, idx; |
379 | hda_nid_t nid; | 379 | hda_nid_t nid; |
380 | 380 | ||
381 | nid = codec->start_nid; | 381 | nid = codec->start_nid; |
@@ -384,9 +384,11 @@ static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, | |||
384 | type = get_wcaps_type(get_wcaps(codec, nid)); | 384 | type = get_wcaps_type(get_wcaps(codec, nid)); |
385 | if (type != AC_WID_AUD_IN) | 385 | if (type != AC_WID_AUD_IN) |
386 | continue; | 386 | continue; |
387 | *idxp = snd_hda_get_conn_index(codec, nid, pin, false); | 387 | idx = snd_hda_get_conn_index(codec, nid, pin, false); |
388 | if (*idxp >= 0) | 388 | if (idx >= 0) { |
389 | *idxp = idx; | ||
389 | return nid; | 390 | return nid; |
391 | } | ||
390 | } | 392 | } |
391 | return 0; | 393 | return 0; |
392 | } | 394 | } |
@@ -533,7 +535,7 @@ static int add_volume(struct hda_codec *codec, const char *name, | |||
533 | int index, unsigned int pval, int dir, | 535 | int index, unsigned int pval, int dir, |
534 | struct snd_kcontrol **kctlp) | 536 | struct snd_kcontrol **kctlp) |
535 | { | 537 | { |
536 | char tmp[32]; | 538 | char tmp[44]; |
537 | struct snd_kcontrol_new knew = | 539 | struct snd_kcontrol_new knew = |
538 | HDA_CODEC_VOLUME_IDX(tmp, index, 0, 0, HDA_OUTPUT); | 540 | HDA_CODEC_VOLUME_IDX(tmp, index, 0, 0, HDA_OUTPUT); |
539 | knew.private_value = pval; | 541 | knew.private_value = pval; |
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..5956584ea3a4 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 | ||
@@ -103,7 +103,7 @@ static struct snd_soc_dai_link bf5xx_ad193x_dai[] = { | |||
103 | .cpu_dai_name = "bfin-tdm.0", | 103 | .cpu_dai_name = "bfin-tdm.0", |
104 | .codec_dai_name ="ad193x-hifi", | 104 | .codec_dai_name ="ad193x-hifi", |
105 | .platform_name = "bfin-tdm-pcm-audio", | 105 | .platform_name = "bfin-tdm-pcm-audio", |
106 | .codec_name = "ad193x.5", | 106 | .codec_name = "spi0.5", |
107 | .ops = &bf5xx_ad193x_ops, | 107 | .ops = &bf5xx_ad193x_ops, |
108 | }, | 108 | }, |
109 | { | 109 | { |
@@ -112,7 +112,7 @@ static struct snd_soc_dai_link bf5xx_ad193x_dai[] = { | |||
112 | .cpu_dai_name = "bfin-tdm.1", | 112 | .cpu_dai_name = "bfin-tdm.1", |
113 | .codec_dai_name ="ad193x-hifi", | 113 | .codec_dai_name ="ad193x-hifi", |
114 | .platform_name = "bfin-tdm-pcm-audio", | 114 | .platform_name = "bfin-tdm-pcm-audio", |
115 | .codec_name = "ad193x.5", | 115 | .codec_name = "spi0.5", |
116 | .ops = &bf5xx_ad193x_ops, | 116 | .ops = &bf5xx_ad193x_ops, |
117 | }, | 117 | }, |
118 | }; | 118 | }; |
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/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index fd0dc46afc34..5c6c2457386e 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c | |||
@@ -369,7 +369,7 @@ static struct snd_soc_platform_driver mpc5200_audio_dma_platform = { | |||
369 | .pcm_free = &psc_dma_free, | 369 | .pcm_free = &psc_dma_free, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | static int mpc5200_hpcd_probe(struct of_device *op) | 372 | static int mpc5200_hpcd_probe(struct platform_device *op) |
373 | { | 373 | { |
374 | phys_addr_t fifo; | 374 | phys_addr_t fifo; |
375 | struct psc_dma *psc_dma; | 375 | struct psc_dma *psc_dma; |
@@ -487,7 +487,7 @@ out_unmap: | |||
487 | return ret; | 487 | return ret; |
488 | } | 488 | } |
489 | 489 | ||
490 | static int mpc5200_hpcd_remove(struct of_device *op) | 490 | static int mpc5200_hpcd_remove(struct platform_device *op) |
491 | { | 491 | { |
492 | struct psc_dma *psc_dma = dev_get_drvdata(&op->dev); | 492 | struct psc_dma *psc_dma = dev_get_drvdata(&op->dev); |
493 | 493 | ||
@@ -519,7 +519,7 @@ MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match); | |||
519 | static struct platform_driver mpc5200_hpcd_of_driver = { | 519 | static struct platform_driver mpc5200_hpcd_of_driver = { |
520 | .probe = mpc5200_hpcd_probe, | 520 | .probe = mpc5200_hpcd_probe, |
521 | .remove = mpc5200_hpcd_remove, | 521 | .remove = mpc5200_hpcd_remove, |
522 | .dev = { | 522 | .driver = { |
523 | .owner = THIS_MODULE, | 523 | .owner = THIS_MODULE, |
524 | .name = "mpc5200-pcm-audio", | 524 | .name = "mpc5200-pcm-audio", |
525 | .of_match_table = mpc5200_hpcd_match, | 525 | .of_match_table = mpc5200_hpcd_match, |
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/imx/imx-pcm-fiq.c b/sound/soc/imx/imx-pcm-fiq.c index 309c59e6fb6c..7945625e0e08 100644 --- a/sound/soc/imx/imx-pcm-fiq.c +++ b/sound/soc/imx/imx-pcm-fiq.c | |||
@@ -240,7 +240,6 @@ static int ssi_irq = 0; | |||
240 | 240 | ||
241 | static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd) | 241 | static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd) |
242 | { | 242 | { |
243 | struct snd_card *card = rtd->card->snd_card; | ||
244 | struct snd_soc_dai *dai = rtd->cpu_dai; | 243 | struct snd_soc_dai *dai = rtd->cpu_dai; |
245 | struct snd_pcm *pcm = rtd->pcm; | 244 | struct snd_pcm *pcm = rtd->pcm; |
246 | int ret; | 245 | int ret; |
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index a33fc51f363b..d0bcf3fcea01 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 err_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-cache.c b/sound/soc/soc-cache.c index d9f8aded51f3..20b7f3b003a3 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
@@ -203,14 +203,14 @@ static int snd_soc_rbtree_cache_sync(struct snd_soc_codec *codec) | |||
203 | rbnode = rb_entry(node, struct snd_soc_rbtree_node, node); | 203 | rbnode = rb_entry(node, struct snd_soc_rbtree_node, node); |
204 | for (i = 0; i < rbnode->blklen; ++i) { | 204 | for (i = 0; i < rbnode->blklen; ++i) { |
205 | regtmp = rbnode->base_reg + i; | 205 | regtmp = rbnode->base_reg + i; |
206 | WARN_ON(codec->writable_register && | ||
207 | codec->writable_register(codec, regtmp)); | ||
208 | val = snd_soc_rbtree_get_register(rbnode, i); | 206 | val = snd_soc_rbtree_get_register(rbnode, i); |
209 | def = snd_soc_get_cache_val(codec->reg_def_copy, i, | 207 | def = snd_soc_get_cache_val(codec->reg_def_copy, i, |
210 | rbnode->word_size); | 208 | rbnode->word_size); |
211 | if (val == def) | 209 | if (val == def) |
212 | continue; | 210 | continue; |
213 | 211 | ||
212 | WARN_ON(!snd_soc_codec_writable_register(codec, regtmp)); | ||
213 | |||
214 | codec->cache_bypass = 1; | 214 | codec->cache_bypass = 1; |
215 | ret = snd_soc_write(codec, regtmp, val); | 215 | ret = snd_soc_write(codec, regtmp, val); |
216 | codec->cache_bypass = 0; | 216 | codec->cache_bypass = 0; |
@@ -563,8 +563,7 @@ static int snd_soc_lzo_cache_sync(struct snd_soc_codec *codec) | |||
563 | 563 | ||
564 | lzo_blocks = codec->reg_cache; | 564 | lzo_blocks = codec->reg_cache; |
565 | for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) { | 565 | for_each_set_bit(i, lzo_blocks[0]->sync_bmp, lzo_blocks[0]->sync_bmp_nbits) { |
566 | WARN_ON(codec->writable_register && | 566 | WARN_ON(!snd_soc_codec_writable_register(codec, i)); |
567 | codec->writable_register(codec, i)); | ||
568 | ret = snd_soc_cache_read(codec, i, &val); | 567 | ret = snd_soc_cache_read(codec, i, &val); |
569 | if (ret) | 568 | if (ret) |
570 | return ret; | 569 | return ret; |
@@ -823,8 +822,6 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec) | |||
823 | 822 | ||
824 | codec_drv = codec->driver; | 823 | codec_drv = codec->driver; |
825 | for (i = 0; i < codec_drv->reg_cache_size; ++i) { | 824 | for (i = 0; i < codec_drv->reg_cache_size; ++i) { |
826 | WARN_ON(codec->writable_register && | ||
827 | codec->writable_register(codec, i)); | ||
828 | ret = snd_soc_cache_read(codec, i, &val); | 825 | ret = snd_soc_cache_read(codec, i, &val); |
829 | if (ret) | 826 | if (ret) |
830 | return ret; | 827 | return ret; |
@@ -832,6 +829,9 @@ static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec) | |||
832 | if (snd_soc_get_cache_val(codec->reg_def_copy, | 829 | if (snd_soc_get_cache_val(codec->reg_def_copy, |
833 | i, codec_drv->reg_word_size) == val) | 830 | i, codec_drv->reg_word_size) == val) |
834 | continue; | 831 | continue; |
832 | |||
833 | WARN_ON(!snd_soc_codec_writable_register(codec, i)); | ||
834 | |||
835 | ret = snd_soc_write(codec, i, val); | 835 | ret = snd_soc_write(codec, i, val); |
836 | if (ret) | 836 | if (ret) |
837 | return ret; | 837 | return ret; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 83ad8ca27490..d2ef014af215 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1633,7 +1633,7 @@ int snd_soc_codec_readable_register(struct snd_soc_codec *codec, | |||
1633 | if (codec->readable_register) | 1633 | if (codec->readable_register) |
1634 | return codec->readable_register(codec, reg); | 1634 | return codec->readable_register(codec, reg); |
1635 | else | 1635 | else |
1636 | return 0; | 1636 | return 1; |
1637 | } | 1637 | } |
1638 | EXPORT_SYMBOL_GPL(snd_soc_codec_readable_register); | 1638 | EXPORT_SYMBOL_GPL(snd_soc_codec_readable_register); |
1639 | 1639 | ||
@@ -1651,7 +1651,7 @@ int snd_soc_codec_writable_register(struct snd_soc_codec *codec, | |||
1651 | if (codec->writable_register) | 1651 | if (codec->writable_register) |
1652 | return codec->writable_register(codec, reg); | 1652 | return codec->writable_register(codec, reg); |
1653 | else | 1653 | else |
1654 | return 0; | 1654 | return 1; |
1655 | } | 1655 | } |
1656 | EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register); | 1656 | EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register); |
1657 | 1657 | ||
@@ -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-dapm.c b/sound/soc/soc-dapm.c index 7e15914b3633..d67c637557a7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2763,7 +2763,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_ignore_suspend); | |||
2763 | 2763 | ||
2764 | /** | 2764 | /** |
2765 | * snd_soc_dapm_free - free dapm resources | 2765 | * snd_soc_dapm_free - free dapm resources |
2766 | * @card: SoC device | 2766 | * @dapm: DAPM context |
2767 | * | 2767 | * |
2768 | * Free all dapm widgets and resources. | 2768 | * Free all dapm widgets and resources. |
2769 | */ | 2769 | */ |
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..fa31d9c2abd8 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c | |||
@@ -105,7 +105,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) | |||
105 | 105 | ||
106 | snd_soc_dapm_sync(dapm); | 106 | snd_soc_dapm_sync(dapm); |
107 | 107 | ||
108 | snd_jack_report(jack->jack, status); | 108 | snd_jack_report(jack->jack, jack->status); |
109 | 109 | ||
110 | out: | 110 | out: |
111 | mutex_unlock(&codec->mutex); | 111 | mutex_unlock(&codec->mutex); |
@@ -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()) { |