diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 12:31:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 12:31:00 -0400 |
commit | bcc66c0b8881f88459f9ac21038455bcafacdc6e (patch) | |
tree | b402e677253c3fc1038ca4a52fc54fc223261133 /sound | |
parent | 1c1b86215730ef07d8851c2247b9ecf73038d05d (diff) | |
parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) |
Merge 3.5-rc4 into staging-next
This picks up the staging changes made in 3.5-rc4 so that everyone can sync up
properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/compress_offload.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 46 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 19 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/wm2000.c | 59 | ||||
-rw-r--r-- | sound/soc/codecs/wm8904.c | 26 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 105 | ||||
-rw-r--r-- | sound/soc/codecs/wm8996.c | 8 | ||||
-rw-r--r-- | sound/soc/fsl/imx-audmux.c | 8 | ||||
-rw-r--r-- | sound/soc/pxa/pxa-ssp.c | 38 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-pcm.c | 6 | ||||
-rw-r--r-- | sound/soc/tegra/tegra30_ahub.c | 1 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_wm8903.c | 13 | ||||
-rw-r--r-- | sound/usb/6fire/firmware.c | 2 | ||||
-rw-r--r-- | sound/usb/card.h | 1 | ||||
-rw-r--r-- | sound/usb/pcm.c | 21 | ||||
-rw-r--r-- | sound/usb/stream.c | 7 |
20 files changed, 227 insertions, 159 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index a68aed7fce02..ec2118d0e27a 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
@@ -502,10 +502,8 @@ static int snd_compr_pause(struct snd_compr_stream *stream) | |||
502 | if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) | 502 | if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) |
503 | return -EPERM; | 503 | return -EPERM; |
504 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH); | 504 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH); |
505 | if (!retval) { | 505 | if (!retval) |
506 | stream->runtime->state = SNDRV_PCM_STATE_PAUSED; | 506 | stream->runtime->state = SNDRV_PCM_STATE_PAUSED; |
507 | wake_up(&stream->runtime->sleep); | ||
508 | } | ||
509 | return retval; | 507 | return retval; |
510 | } | 508 | } |
511 | 509 | ||
@@ -544,6 +542,10 @@ static int snd_compr_stop(struct snd_compr_stream *stream) | |||
544 | if (!retval) { | 542 | if (!retval) { |
545 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | 543 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; |
546 | wake_up(&stream->runtime->sleep); | 544 | wake_up(&stream->runtime->sleep); |
545 | stream->runtime->hw_pointer = 0; | ||
546 | stream->runtime->app_pointer = 0; | ||
547 | stream->runtime->total_bytes_available = 0; | ||
548 | stream->runtime->total_bytes_transferred = 0; | ||
547 | } | 549 | } |
548 | return retval; | 550 | return retval; |
549 | } | 551 | } |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 41ca803a1fff..7504e62188d6 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4393,20 +4393,19 @@ void snd_hda_update_power_acct(struct hda_codec *codec) | |||
4393 | codec->power_jiffies += delta; | 4393 | codec->power_jiffies += delta; |
4394 | } | 4394 | } |
4395 | 4395 | ||
4396 | /** | 4396 | /* Transition to powered up, if wait_power_down then wait for a pending |
4397 | * snd_hda_power_up - Power-up the codec | 4397 | * transition to D3 to complete. A pending D3 transition is indicated |
4398 | * @codec: HD-audio codec | 4398 | * with power_transition == -1. */ |
4399 | * | 4399 | static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down) |
4400 | * Increment the power-up counter and power up the hardware really when | ||
4401 | * not turned on yet. | ||
4402 | */ | ||
4403 | void snd_hda_power_up(struct hda_codec *codec) | ||
4404 | { | 4400 | { |
4405 | struct hda_bus *bus = codec->bus; | 4401 | struct hda_bus *bus = codec->bus; |
4406 | 4402 | ||
4407 | spin_lock(&codec->power_lock); | 4403 | spin_lock(&codec->power_lock); |
4408 | codec->power_count++; | 4404 | codec->power_count++; |
4409 | if (codec->power_on || codec->power_transition > 0) { | 4405 | /* Return if power_on or transitioning to power_on, unless currently |
4406 | * powering down. */ | ||
4407 | if ((codec->power_on || codec->power_transition > 0) && | ||
4408 | !(wait_power_down && codec->power_transition < 0)) { | ||
4410 | spin_unlock(&codec->power_lock); | 4409 | spin_unlock(&codec->power_lock); |
4411 | return; | 4410 | return; |
4412 | } | 4411 | } |
@@ -4430,8 +4429,37 @@ void snd_hda_power_up(struct hda_codec *codec) | |||
4430 | codec->power_transition = 0; | 4429 | codec->power_transition = 0; |
4431 | spin_unlock(&codec->power_lock); | 4430 | spin_unlock(&codec->power_lock); |
4432 | } | 4431 | } |
4432 | |||
4433 | /** | ||
4434 | * snd_hda_power_up - Power-up the codec | ||
4435 | * @codec: HD-audio codec | ||
4436 | * | ||
4437 | * Increment the power-up counter and power up the hardware really when | ||
4438 | * not turned on yet. | ||
4439 | */ | ||
4440 | void snd_hda_power_up(struct hda_codec *codec) | ||
4441 | { | ||
4442 | __snd_hda_power_up(codec, false); | ||
4443 | } | ||
4433 | EXPORT_SYMBOL_HDA(snd_hda_power_up); | 4444 | EXPORT_SYMBOL_HDA(snd_hda_power_up); |
4434 | 4445 | ||
4446 | /** | ||
4447 | * snd_hda_power_up_d3wait - Power-up the codec after waiting for any pending | ||
4448 | * D3 transition to complete. This differs from snd_hda_power_up() when | ||
4449 | * power_transition == -1. snd_hda_power_up sees this case as a nop, | ||
4450 | * snd_hda_power_up_d3wait waits for the D3 transition to complete then powers | ||
4451 | * back up. | ||
4452 | * @codec: HD-audio codec | ||
4453 | * | ||
4454 | * Cancel any power down operation hapenning on the work queue, then power up. | ||
4455 | */ | ||
4456 | void snd_hda_power_up_d3wait(struct hda_codec *codec) | ||
4457 | { | ||
4458 | /* This will cancel and wait for pending power_work to complete. */ | ||
4459 | __snd_hda_power_up(codec, true); | ||
4460 | } | ||
4461 | EXPORT_SYMBOL_HDA(snd_hda_power_up_d3wait); | ||
4462 | |||
4435 | #define power_save(codec) \ | 4463 | #define power_save(codec) \ |
4436 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | 4464 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) |
4437 | 4465 | ||
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 4fc3960c8591..2fdaadbb4326 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -1056,10 +1056,12 @@ const char *snd_hda_get_jack_location(u32 cfg); | |||
1056 | */ | 1056 | */ |
1057 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1057 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
1058 | void snd_hda_power_up(struct hda_codec *codec); | 1058 | void snd_hda_power_up(struct hda_codec *codec); |
1059 | void snd_hda_power_up_d3wait(struct hda_codec *codec); | ||
1059 | void snd_hda_power_down(struct hda_codec *codec); | 1060 | void snd_hda_power_down(struct hda_codec *codec); |
1060 | void snd_hda_update_power_acct(struct hda_codec *codec); | 1061 | void snd_hda_update_power_acct(struct hda_codec *codec); |
1061 | #else | 1062 | #else |
1062 | static inline void snd_hda_power_up(struct hda_codec *codec) {} | 1063 | static inline void snd_hda_power_up(struct hda_codec *codec) {} |
1064 | static inline void snd_hda_power_up_d3wait(struct hda_codec *codec) {} | ||
1063 | static inline void snd_hda_power_down(struct hda_codec *codec) {} | 1065 | static inline void snd_hda_power_down(struct hda_codec *codec) {} |
1064 | #endif | 1066 | #endif |
1065 | 1067 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2b6392be451c..7757536b9d5f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1766,7 +1766,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) | |||
1766 | buff_step); | 1766 | buff_step); |
1767 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | 1767 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, |
1768 | buff_step); | 1768 | buff_step); |
1769 | snd_hda_power_up(apcm->codec); | 1769 | snd_hda_power_up_d3wait(apcm->codec); |
1770 | err = hinfo->ops.open(hinfo, apcm->codec, substream); | 1770 | err = hinfo->ops.open(hinfo, apcm->codec, substream); |
1771 | if (err < 0) { | 1771 | if (err < 0) { |
1772 | azx_release_device(azx_dev); | 1772 | azx_release_device(azx_dev); |
@@ -2484,9 +2484,9 @@ static void azx_notifier_unregister(struct azx *chip) | |||
2484 | static int DELAYED_INIT_MARK azx_first_init(struct azx *chip); | 2484 | static int DELAYED_INIT_MARK azx_first_init(struct azx *chip); |
2485 | static int DELAYED_INIT_MARK azx_probe_continue(struct azx *chip); | 2485 | static int DELAYED_INIT_MARK azx_probe_continue(struct azx *chip); |
2486 | 2486 | ||
2487 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2487 | static struct pci_dev __devinit *get_bound_vga(struct pci_dev *pci); | 2488 | static struct pci_dev __devinit *get_bound_vga(struct pci_dev *pci); |
2488 | 2489 | ||
2489 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2490 | static void azx_vs_set_state(struct pci_dev *pci, | 2490 | static void azx_vs_set_state(struct pci_dev *pci, |
2491 | enum vga_switcheroo_state state) | 2491 | enum vga_switcheroo_state state) |
2492 | { | 2492 | { |
@@ -2578,6 +2578,7 @@ static int __devinit register_vga_switcheroo(struct azx *chip) | |||
2578 | #else | 2578 | #else |
2579 | #define init_vga_switcheroo(chip) /* NOP */ | 2579 | #define init_vga_switcheroo(chip) /* NOP */ |
2580 | #define register_vga_switcheroo(chip) 0 | 2580 | #define register_vga_switcheroo(chip) 0 |
2581 | #define check_hdmi_disabled(pci) false | ||
2581 | #endif /* SUPPORT_VGA_SWITCHER */ | 2582 | #endif /* SUPPORT_VGA_SWITCHER */ |
2582 | 2583 | ||
2583 | /* | 2584 | /* |
@@ -2638,6 +2639,7 @@ static int azx_dev_free(struct snd_device *device) | |||
2638 | return azx_free(device->device_data); | 2639 | return azx_free(device->device_data); |
2639 | } | 2640 | } |
2640 | 2641 | ||
2642 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2641 | /* | 2643 | /* |
2642 | * Check of disabled HDMI controller by vga-switcheroo | 2644 | * Check of disabled HDMI controller by vga-switcheroo |
2643 | */ | 2645 | */ |
@@ -2670,12 +2672,13 @@ static bool __devinit check_hdmi_disabled(struct pci_dev *pci) | |||
2670 | struct pci_dev *p = get_bound_vga(pci); | 2672 | struct pci_dev *p = get_bound_vga(pci); |
2671 | 2673 | ||
2672 | if (p) { | 2674 | if (p) { |
2673 | if (vga_default_device() && p != vga_default_device()) | 2675 | if (vga_switcheroo_get_client_state(p) == VGA_SWITCHEROO_OFF) |
2674 | vga_inactive = true; | 2676 | vga_inactive = true; |
2675 | pci_dev_put(p); | 2677 | pci_dev_put(p); |
2676 | } | 2678 | } |
2677 | return vga_inactive; | 2679 | return vga_inactive; |
2678 | } | 2680 | } |
2681 | #endif /* SUPPORT_VGA_SWITCHEROO */ | ||
2679 | 2682 | ||
2680 | /* | 2683 | /* |
2681 | * white/black-listing for position_fix | 2684 | * white/black-listing for position_fix |
@@ -3351,6 +3354,11 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
3351 | { PCI_DEVICE(0x6549, 0x1200), | 3354 | { PCI_DEVICE(0x6549, 0x1200), |
3352 | .driver_data = AZX_DRIVER_TERA | AZX_DCAPS_NO_64BIT }, | 3355 | .driver_data = AZX_DRIVER_TERA | AZX_DCAPS_NO_64BIT }, |
3353 | /* Creative X-Fi (CA0110-IBG) */ | 3356 | /* Creative X-Fi (CA0110-IBG) */ |
3357 | /* CTHDA chips */ | ||
3358 | { PCI_DEVICE(0x1102, 0x0010), | ||
3359 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3360 | { PCI_DEVICE(0x1102, 0x0012), | ||
3361 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3354 | #if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE) | 3362 | #if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE) |
3355 | /* the following entry conflicts with snd-ctxfi driver, | 3363 | /* the following entry conflicts with snd-ctxfi driver, |
3356 | * as ctxfi driver mutates from HD-audio to native mode with | 3364 | * as ctxfi driver mutates from HD-audio to native mode with |
@@ -3367,11 +3375,6 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
3367 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | | 3375 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | |
3368 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, | 3376 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, |
3369 | #endif | 3377 | #endif |
3370 | /* CTHDA chips */ | ||
3371 | { PCI_DEVICE(0x1102, 0x0010), | ||
3372 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3373 | { PCI_DEVICE(0x1102, 0x0012), | ||
3374 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3375 | /* Vortex86MX */ | 3378 | /* Vortex86MX */ |
3376 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, | 3379 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, |
3377 | /* VMware HDAudio */ | 3380 | /* VMware HDAudio */ |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 3acb5824ad39..172370b3793b 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -4061,7 +4061,7 @@ static void cx_auto_init_digital(struct hda_codec *codec) | |||
4061 | static int cx_auto_init(struct hda_codec *codec) | 4061 | static int cx_auto_init(struct hda_codec *codec) |
4062 | { | 4062 | { |
4063 | struct conexant_spec *spec = codec->spec; | 4063 | struct conexant_spec *spec = codec->spec; |
4064 | /*snd_hda_sequence_write(codec, cx_auto_init_verbs);*/ | 4064 | snd_hda_gen_apply_verbs(codec); |
4065 | cx_auto_init_output(codec); | 4065 | cx_auto_init_output(codec); |
4066 | cx_auto_init_input(codec); | 4066 | cx_auto_init_input(codec); |
4067 | cx_auto_init_digital(codec); | 4067 | cx_auto_init_digital(codec); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 224410e8e9e7..f8f4906e498d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1896,6 +1896,7 @@ static int alc_init(struct hda_codec *codec) | |||
1896 | alc_fix_pll(codec); | 1896 | alc_fix_pll(codec); |
1897 | alc_auto_init_amp(codec, spec->init_amp); | 1897 | alc_auto_init_amp(codec, spec->init_amp); |
1898 | 1898 | ||
1899 | snd_hda_gen_apply_verbs(codec); | ||
1899 | alc_init_special_input_src(codec); | 1900 | alc_init_special_input_src(codec); |
1900 | alc_auto_init_std(codec); | 1901 | alc_auto_init_std(codec); |
1901 | 1902 | ||
@@ -6439,6 +6440,7 @@ enum { | |||
6439 | ALC662_FIXUP_ASUS_MODE7, | 6440 | ALC662_FIXUP_ASUS_MODE7, |
6440 | ALC662_FIXUP_ASUS_MODE8, | 6441 | ALC662_FIXUP_ASUS_MODE8, |
6441 | ALC662_FIXUP_NO_JACK_DETECT, | 6442 | ALC662_FIXUP_NO_JACK_DETECT, |
6443 | ALC662_FIXUP_ZOTAC_Z68, | ||
6442 | }; | 6444 | }; |
6443 | 6445 | ||
6444 | static const struct alc_fixup alc662_fixups[] = { | 6446 | static const struct alc_fixup alc662_fixups[] = { |
@@ -6588,6 +6590,13 @@ static const struct alc_fixup alc662_fixups[] = { | |||
6588 | .type = ALC_FIXUP_FUNC, | 6590 | .type = ALC_FIXUP_FUNC, |
6589 | .v.func = alc_fixup_no_jack_detect, | 6591 | .v.func = alc_fixup_no_jack_detect, |
6590 | }, | 6592 | }, |
6593 | [ALC662_FIXUP_ZOTAC_Z68] = { | ||
6594 | .type = ALC_FIXUP_PINS, | ||
6595 | .v.pins = (const struct alc_pincfg[]) { | ||
6596 | { 0x1b, 0x02214020 }, /* Front HP */ | ||
6597 | { } | ||
6598 | } | ||
6599 | }, | ||
6591 | }; | 6600 | }; |
6592 | 6601 | ||
6593 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { | 6602 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
@@ -6601,6 +6610,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { | |||
6601 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 6610 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
6602 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), | 6611 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6603 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), | 6612 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
6613 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), | ||
6604 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), | 6614 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
6605 | 6615 | ||
6606 | #if 0 | 6616 | #if 0 |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index a75c3766aede..0418fa11e6bd 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -99,8 +99,9 @@ static void wm2000_reset(struct wm2000_priv *wm2000) | |||
99 | } | 99 | } |
100 | 100 | ||
101 | static int wm2000_poll_bit(struct i2c_client *i2c, | 101 | static int wm2000_poll_bit(struct i2c_client *i2c, |
102 | unsigned int reg, u8 mask, int timeout) | 102 | unsigned int reg, u8 mask) |
103 | { | 103 | { |
104 | int timeout = 4000; | ||
104 | int val; | 105 | int val; |
105 | 106 | ||
106 | val = wm2000_read(i2c, reg); | 107 | val = wm2000_read(i2c, reg); |
@@ -119,7 +120,7 @@ static int wm2000_poll_bit(struct i2c_client *i2c, | |||
119 | static int wm2000_power_up(struct i2c_client *i2c, int analogue) | 120 | static int wm2000_power_up(struct i2c_client *i2c, int analogue) |
120 | { | 121 | { |
121 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | 122 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); |
122 | int ret, timeout; | 123 | int ret; |
123 | 124 | ||
124 | BUG_ON(wm2000->anc_mode != ANC_OFF); | 125 | BUG_ON(wm2000->anc_mode != ANC_OFF); |
125 | 126 | ||
@@ -140,13 +141,13 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) | |||
140 | 141 | ||
141 | /* Wait for ANC engine to become ready */ | 142 | /* Wait for ANC engine to become ready */ |
142 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, | 143 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, |
143 | WM2000_ANC_ENG_IDLE, 1)) { | 144 | WM2000_ANC_ENG_IDLE)) { |
144 | dev_err(&i2c->dev, "ANC engine failed to reset\n"); | 145 | dev_err(&i2c->dev, "ANC engine failed to reset\n"); |
145 | return -ETIMEDOUT; | 146 | return -ETIMEDOUT; |
146 | } | 147 | } |
147 | 148 | ||
148 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 149 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
149 | WM2000_STATUS_BOOT_COMPLETE, 1)) { | 150 | WM2000_STATUS_BOOT_COMPLETE)) { |
150 | dev_err(&i2c->dev, "ANC engine failed to initialise\n"); | 151 | dev_err(&i2c->dev, "ANC engine failed to initialise\n"); |
151 | return -ETIMEDOUT; | 152 | return -ETIMEDOUT; |
152 | } | 153 | } |
@@ -173,16 +174,13 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) | |||
173 | dev_dbg(&i2c->dev, "Download complete\n"); | 174 | dev_dbg(&i2c->dev, "Download complete\n"); |
174 | 175 | ||
175 | if (analogue) { | 176 | if (analogue) { |
176 | timeout = 248; | 177 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PU_TIME, 248 / 4); |
177 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PU_TIME, timeout / 4); | ||
178 | 178 | ||
179 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 179 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
180 | WM2000_MODE_ANA_SEQ_INCLUDE | | 180 | WM2000_MODE_ANA_SEQ_INCLUDE | |
181 | WM2000_MODE_MOUSE_ENABLE | | 181 | WM2000_MODE_MOUSE_ENABLE | |
182 | WM2000_MODE_THERMAL_ENABLE); | 182 | WM2000_MODE_THERMAL_ENABLE); |
183 | } else { | 183 | } else { |
184 | timeout = 10; | ||
185 | |||
186 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 184 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
187 | WM2000_MODE_MOUSE_ENABLE | | 185 | WM2000_MODE_MOUSE_ENABLE | |
188 | WM2000_MODE_THERMAL_ENABLE); | 186 | WM2000_MODE_THERMAL_ENABLE); |
@@ -201,9 +199,8 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) | |||
201 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); | 199 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); |
202 | 200 | ||
203 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 201 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
204 | WM2000_STATUS_MOUSE_ACTIVE, timeout)) { | 202 | WM2000_STATUS_MOUSE_ACTIVE)) { |
205 | dev_err(&i2c->dev, "Timed out waiting for device after %dms\n", | 203 | dev_err(&i2c->dev, "Timed out waiting for device\n"); |
206 | timeout * 10); | ||
207 | return -ETIMEDOUT; | 204 | return -ETIMEDOUT; |
208 | } | 205 | } |
209 | 206 | ||
@@ -218,28 +215,25 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) | |||
218 | static int wm2000_power_down(struct i2c_client *i2c, int analogue) | 215 | static int wm2000_power_down(struct i2c_client *i2c, int analogue) |
219 | { | 216 | { |
220 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | 217 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); |
221 | int timeout; | ||
222 | 218 | ||
223 | if (analogue) { | 219 | if (analogue) { |
224 | timeout = 248; | 220 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PD_TIME, 248 / 4); |
225 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PD_TIME, timeout / 4); | ||
226 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 221 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
227 | WM2000_MODE_ANA_SEQ_INCLUDE | | 222 | WM2000_MODE_ANA_SEQ_INCLUDE | |
228 | WM2000_MODE_POWER_DOWN); | 223 | WM2000_MODE_POWER_DOWN); |
229 | } else { | 224 | } else { |
230 | timeout = 10; | ||
231 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 225 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
232 | WM2000_MODE_POWER_DOWN); | 226 | WM2000_MODE_POWER_DOWN); |
233 | } | 227 | } |
234 | 228 | ||
235 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 229 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
236 | WM2000_STATUS_POWER_DOWN_COMPLETE, timeout)) { | 230 | WM2000_STATUS_POWER_DOWN_COMPLETE)) { |
237 | dev_err(&i2c->dev, "Timeout waiting for ANC power down\n"); | 231 | dev_err(&i2c->dev, "Timeout waiting for ANC power down\n"); |
238 | return -ETIMEDOUT; | 232 | return -ETIMEDOUT; |
239 | } | 233 | } |
240 | 234 | ||
241 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, | 235 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, |
242 | WM2000_ANC_ENG_IDLE, 1)) { | 236 | WM2000_ANC_ENG_IDLE)) { |
243 | dev_err(&i2c->dev, "Timeout waiting for ANC engine idle\n"); | 237 | dev_err(&i2c->dev, "Timeout waiting for ANC engine idle\n"); |
244 | return -ETIMEDOUT; | 238 | return -ETIMEDOUT; |
245 | } | 239 | } |
@@ -268,13 +262,13 @@ static int wm2000_enter_bypass(struct i2c_client *i2c, int analogue) | |||
268 | } | 262 | } |
269 | 263 | ||
270 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 264 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
271 | WM2000_STATUS_ANC_DISABLED, 10)) { | 265 | WM2000_STATUS_ANC_DISABLED)) { |
272 | dev_err(&i2c->dev, "Timeout waiting for ANC disable\n"); | 266 | dev_err(&i2c->dev, "Timeout waiting for ANC disable\n"); |
273 | return -ETIMEDOUT; | 267 | return -ETIMEDOUT; |
274 | } | 268 | } |
275 | 269 | ||
276 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, | 270 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, |
277 | WM2000_ANC_ENG_IDLE, 1)) { | 271 | WM2000_ANC_ENG_IDLE)) { |
278 | dev_err(&i2c->dev, "Timeout waiting for ANC engine idle\n"); | 272 | dev_err(&i2c->dev, "Timeout waiting for ANC engine idle\n"); |
279 | return -ETIMEDOUT; | 273 | return -ETIMEDOUT; |
280 | } | 274 | } |
@@ -311,7 +305,7 @@ static int wm2000_exit_bypass(struct i2c_client *i2c, int analogue) | |||
311 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); | 305 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); |
312 | 306 | ||
313 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 307 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
314 | WM2000_STATUS_MOUSE_ACTIVE, 10)) { | 308 | WM2000_STATUS_MOUSE_ACTIVE)) { |
315 | dev_err(&i2c->dev, "Timed out waiting for MOUSE\n"); | 309 | dev_err(&i2c->dev, "Timed out waiting for MOUSE\n"); |
316 | return -ETIMEDOUT; | 310 | return -ETIMEDOUT; |
317 | } | 311 | } |
@@ -325,38 +319,32 @@ static int wm2000_exit_bypass(struct i2c_client *i2c, int analogue) | |||
325 | static int wm2000_enter_standby(struct i2c_client *i2c, int analogue) | 319 | static int wm2000_enter_standby(struct i2c_client *i2c, int analogue) |
326 | { | 320 | { |
327 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | 321 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); |
328 | int timeout; | ||
329 | 322 | ||
330 | BUG_ON(wm2000->anc_mode != ANC_ACTIVE); | 323 | BUG_ON(wm2000->anc_mode != ANC_ACTIVE); |
331 | 324 | ||
332 | if (analogue) { | 325 | if (analogue) { |
333 | timeout = 248; | 326 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PD_TIME, 248 / 4); |
334 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PD_TIME, timeout / 4); | ||
335 | 327 | ||
336 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 328 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
337 | WM2000_MODE_ANA_SEQ_INCLUDE | | 329 | WM2000_MODE_ANA_SEQ_INCLUDE | |
338 | WM2000_MODE_THERMAL_ENABLE | | 330 | WM2000_MODE_THERMAL_ENABLE | |
339 | WM2000_MODE_STANDBY_ENTRY); | 331 | WM2000_MODE_STANDBY_ENTRY); |
340 | } else { | 332 | } else { |
341 | timeout = 10; | ||
342 | |||
343 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 333 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
344 | WM2000_MODE_THERMAL_ENABLE | | 334 | WM2000_MODE_THERMAL_ENABLE | |
345 | WM2000_MODE_STANDBY_ENTRY); | 335 | WM2000_MODE_STANDBY_ENTRY); |
346 | } | 336 | } |
347 | 337 | ||
348 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 338 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
349 | WM2000_STATUS_ANC_DISABLED, timeout)) { | 339 | WM2000_STATUS_ANC_DISABLED)) { |
350 | dev_err(&i2c->dev, | 340 | dev_err(&i2c->dev, |
351 | "Timed out waiting for ANC disable after 1ms\n"); | 341 | "Timed out waiting for ANC disable after 1ms\n"); |
352 | return -ETIMEDOUT; | 342 | return -ETIMEDOUT; |
353 | } | 343 | } |
354 | 344 | ||
355 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, WM2000_ANC_ENG_IDLE, | 345 | if (!wm2000_poll_bit(i2c, WM2000_REG_ANC_STAT, WM2000_ANC_ENG_IDLE)) { |
356 | 1)) { | ||
357 | dev_err(&i2c->dev, | 346 | dev_err(&i2c->dev, |
358 | "Timed out waiting for standby after %dms\n", | 347 | "Timed out waiting for standby\n"); |
359 | timeout * 10); | ||
360 | return -ETIMEDOUT; | 348 | return -ETIMEDOUT; |
361 | } | 349 | } |
362 | 350 | ||
@@ -374,23 +362,19 @@ static int wm2000_enter_standby(struct i2c_client *i2c, int analogue) | |||
374 | static int wm2000_exit_standby(struct i2c_client *i2c, int analogue) | 362 | static int wm2000_exit_standby(struct i2c_client *i2c, int analogue) |
375 | { | 363 | { |
376 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | 364 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); |
377 | int timeout; | ||
378 | 365 | ||
379 | BUG_ON(wm2000->anc_mode != ANC_STANDBY); | 366 | BUG_ON(wm2000->anc_mode != ANC_STANDBY); |
380 | 367 | ||
381 | wm2000_write(i2c, WM2000_REG_SYS_CTL1, 0); | 368 | wm2000_write(i2c, WM2000_REG_SYS_CTL1, 0); |
382 | 369 | ||
383 | if (analogue) { | 370 | if (analogue) { |
384 | timeout = 248; | 371 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PU_TIME, 248 / 4); |
385 | wm2000_write(i2c, WM2000_REG_ANA_VMID_PU_TIME, timeout / 4); | ||
386 | 372 | ||
387 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 373 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
388 | WM2000_MODE_ANA_SEQ_INCLUDE | | 374 | WM2000_MODE_ANA_SEQ_INCLUDE | |
389 | WM2000_MODE_THERMAL_ENABLE | | 375 | WM2000_MODE_THERMAL_ENABLE | |
390 | WM2000_MODE_MOUSE_ENABLE); | 376 | WM2000_MODE_MOUSE_ENABLE); |
391 | } else { | 377 | } else { |
392 | timeout = 10; | ||
393 | |||
394 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, | 378 | wm2000_write(i2c, WM2000_REG_SYS_MODE_CNTRL, |
395 | WM2000_MODE_THERMAL_ENABLE | | 379 | WM2000_MODE_THERMAL_ENABLE | |
396 | WM2000_MODE_MOUSE_ENABLE); | 380 | WM2000_MODE_MOUSE_ENABLE); |
@@ -400,9 +384,8 @@ static int wm2000_exit_standby(struct i2c_client *i2c, int analogue) | |||
400 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); | 384 | wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_INT_N_CLR); |
401 | 385 | ||
402 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, | 386 | if (!wm2000_poll_bit(i2c, WM2000_REG_SYS_STATUS, |
403 | WM2000_STATUS_MOUSE_ACTIVE, timeout)) { | 387 | WM2000_STATUS_MOUSE_ACTIVE)) { |
404 | dev_err(&i2c->dev, "Timed out waiting for MOUSE after %dms\n", | 388 | dev_err(&i2c->dev, "Timed out waiting for MOUSE\n"); |
405 | timeout * 10); | ||
406 | return -ETIMEDOUT; | 389 | return -ETIMEDOUT; |
407 | } | 390 | } |
408 | 391 | ||
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 65d525d74c54..812acd83fb48 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -1863,6 +1863,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, | |||
1863 | return ret; | 1863 | return ret; |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | regcache_cache_only(wm8904->regmap, false); | ||
1866 | regcache_sync(wm8904->regmap); | 1867 | regcache_sync(wm8904->regmap); |
1867 | 1868 | ||
1868 | /* Enable bias */ | 1869 | /* Enable bias */ |
@@ -1899,14 +1900,8 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, | |||
1899 | snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, | 1900 | snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, |
1900 | WM8904_BIAS_ENA, 0); | 1901 | WM8904_BIAS_ENA, 0); |
1901 | 1902 | ||
1902 | #ifdef CONFIG_REGULATOR | 1903 | regcache_cache_only(wm8904->regmap, true); |
1903 | /* Post 2.6.34 we will be able to get a callback when | 1904 | regcache_mark_dirty(wm8904->regmap); |
1904 | * the regulators are disabled which we can use but | ||
1905 | * for now just assume that the power will be cut if | ||
1906 | * the regulator API is in use. | ||
1907 | */ | ||
1908 | codec->cache_sync = 1; | ||
1909 | #endif | ||
1910 | 1905 | ||
1911 | regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), | 1906 | regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), |
1912 | wm8904->supplies); | 1907 | wm8904->supplies); |
@@ -2084,10 +2079,8 @@ static int wm8904_probe(struct snd_soc_codec *codec) | |||
2084 | { | 2079 | { |
2085 | struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); | 2080 | struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); |
2086 | struct wm8904_pdata *pdata = wm8904->pdata; | 2081 | struct wm8904_pdata *pdata = wm8904->pdata; |
2087 | u16 *reg_cache = codec->reg_cache; | ||
2088 | int ret, i; | 2082 | int ret, i; |
2089 | 2083 | ||
2090 | codec->cache_sync = 1; | ||
2091 | codec->control_data = wm8904->regmap; | 2084 | codec->control_data = wm8904->regmap; |
2092 | 2085 | ||
2093 | switch (wm8904->devtype) { | 2086 | switch (wm8904->devtype) { |
@@ -2150,6 +2143,7 @@ static int wm8904_probe(struct snd_soc_codec *codec) | |||
2150 | goto err_enable; | 2143 | goto err_enable; |
2151 | } | 2144 | } |
2152 | 2145 | ||
2146 | regcache_cache_only(wm8904->regmap, true); | ||
2153 | /* Change some default settings - latch VU and enable ZC */ | 2147 | /* Change some default settings - latch VU and enable ZC */ |
2154 | snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT, | 2148 | snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT, |
2155 | WM8904_ADC_VU, WM8904_ADC_VU); | 2149 | WM8904_ADC_VU, WM8904_ADC_VU); |
@@ -2180,14 +2174,18 @@ static int wm8904_probe(struct snd_soc_codec *codec) | |||
2180 | if (!pdata->gpio_cfg[i]) | 2174 | if (!pdata->gpio_cfg[i]) |
2181 | continue; | 2175 | continue; |
2182 | 2176 | ||
2183 | reg_cache[WM8904_GPIO_CONTROL_1 + i] | 2177 | regmap_update_bits(wm8904->regmap, |
2184 | = pdata->gpio_cfg[i] & 0xffff; | 2178 | WM8904_GPIO_CONTROL_1 + i, |
2179 | 0xffff, | ||
2180 | pdata->gpio_cfg[i]); | ||
2185 | } | 2181 | } |
2186 | 2182 | ||
2187 | /* Zero is the default value for these anyway */ | 2183 | /* Zero is the default value for these anyway */ |
2188 | for (i = 0; i < WM8904_MIC_REGS; i++) | 2184 | for (i = 0; i < WM8904_MIC_REGS; i++) |
2189 | reg_cache[WM8904_MIC_BIAS_CONTROL_0 + i] | 2185 | regmap_update_bits(wm8904->regmap, |
2190 | = pdata->mic_cfg[i]; | 2186 | WM8904_MIC_BIAS_CONTROL_0 + i, |
2187 | 0xffff, | ||
2188 | pdata->mic_cfg[i]); | ||
2191 | } | 2189 | } |
2192 | 2190 | ||
2193 | /* Set Class W by default - this will be managed by the Class | 2191 | /* Set Class W by default - this will be managed by the Class |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 993639d694ce..aa8c98b628da 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -46,6 +46,39 @@ | |||
46 | #define WM8994_NUM_DRC 3 | 46 | #define WM8994_NUM_DRC 3 |
47 | #define WM8994_NUM_EQ 3 | 47 | #define WM8994_NUM_EQ 3 |
48 | 48 | ||
49 | static struct { | ||
50 | unsigned int reg; | ||
51 | unsigned int mask; | ||
52 | } wm8994_vu_bits[] = { | ||
53 | { WM8994_LEFT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU }, | ||
54 | { WM8994_RIGHT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU }, | ||
55 | { WM8994_LEFT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU }, | ||
56 | { WM8994_RIGHT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU }, | ||
57 | { WM8994_SPEAKER_VOLUME_LEFT, WM8994_SPKOUT_VU }, | ||
58 | { WM8994_SPEAKER_VOLUME_RIGHT, WM8994_SPKOUT_VU }, | ||
59 | { WM8994_LEFT_OUTPUT_VOLUME, WM8994_HPOUT1_VU }, | ||
60 | { WM8994_RIGHT_OUTPUT_VOLUME, WM8994_HPOUT1_VU }, | ||
61 | { WM8994_LEFT_OPGA_VOLUME, WM8994_MIXOUT_VU }, | ||
62 | { WM8994_RIGHT_OPGA_VOLUME, WM8994_MIXOUT_VU }, | ||
63 | |||
64 | { WM8994_AIF1_DAC1_LEFT_VOLUME, WM8994_AIF1DAC1_VU }, | ||
65 | { WM8994_AIF1_DAC1_RIGHT_VOLUME, WM8994_AIF1DAC1_VU }, | ||
66 | { WM8994_AIF1_DAC2_LEFT_VOLUME, WM8994_AIF1DAC2_VU }, | ||
67 | { WM8994_AIF1_DAC2_RIGHT_VOLUME, WM8994_AIF1DAC2_VU }, | ||
68 | { WM8994_AIF2_DAC_LEFT_VOLUME, WM8994_AIF2DAC_VU }, | ||
69 | { WM8994_AIF2_DAC_RIGHT_VOLUME, WM8994_AIF2DAC_VU }, | ||
70 | { WM8994_AIF1_ADC1_LEFT_VOLUME, WM8994_AIF1ADC1_VU }, | ||
71 | { WM8994_AIF1_ADC1_RIGHT_VOLUME, WM8994_AIF1ADC1_VU }, | ||
72 | { WM8994_AIF1_ADC2_LEFT_VOLUME, WM8994_AIF1ADC2_VU }, | ||
73 | { WM8994_AIF1_ADC2_RIGHT_VOLUME, WM8994_AIF1ADC2_VU }, | ||
74 | { WM8994_AIF2_ADC_LEFT_VOLUME, WM8994_AIF2ADC_VU }, | ||
75 | { WM8994_AIF2_ADC_RIGHT_VOLUME, WM8994_AIF1ADC2_VU }, | ||
76 | { WM8994_DAC1_LEFT_VOLUME, WM8994_DAC1_VU }, | ||
77 | { WM8994_DAC1_RIGHT_VOLUME, WM8994_DAC1_VU }, | ||
78 | { WM8994_DAC2_LEFT_VOLUME, WM8994_DAC2_VU }, | ||
79 | { WM8994_DAC2_RIGHT_VOLUME, WM8994_DAC2_VU }, | ||
80 | }; | ||
81 | |||
49 | static int wm8994_drc_base[] = { | 82 | static int wm8994_drc_base[] = { |
50 | WM8994_AIF1_DRC1_1, | 83 | WM8994_AIF1_DRC1_1, |
51 | WM8994_AIF1_DRC2_1, | 84 | WM8994_AIF1_DRC2_1, |
@@ -989,6 +1022,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, | |||
989 | struct snd_soc_codec *codec = w->codec; | 1022 | struct snd_soc_codec *codec = w->codec; |
990 | struct wm8994 *control = codec->control_data; | 1023 | struct wm8994 *control = codec->control_data; |
991 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; | 1024 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; |
1025 | int i; | ||
992 | int dac; | 1026 | int dac; |
993 | int adc; | 1027 | int adc; |
994 | int val; | 1028 | int val; |
@@ -1047,6 +1081,13 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, | |||
1047 | WM8994_AIF1DAC2L_ENA); | 1081 | WM8994_AIF1DAC2L_ENA); |
1048 | break; | 1082 | break; |
1049 | 1083 | ||
1084 | case SND_SOC_DAPM_POST_PMU: | ||
1085 | for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) | ||
1086 | snd_soc_write(codec, wm8994_vu_bits[i].reg, | ||
1087 | snd_soc_read(codec, | ||
1088 | wm8994_vu_bits[i].reg)); | ||
1089 | break; | ||
1090 | |||
1050 | case SND_SOC_DAPM_PRE_PMD: | 1091 | case SND_SOC_DAPM_PRE_PMD: |
1051 | case SND_SOC_DAPM_POST_PMD: | 1092 | case SND_SOC_DAPM_POST_PMD: |
1052 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1093 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
@@ -1072,6 +1113,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, | |||
1072 | struct snd_kcontrol *kcontrol, int event) | 1113 | struct snd_kcontrol *kcontrol, int event) |
1073 | { | 1114 | { |
1074 | struct snd_soc_codec *codec = w->codec; | 1115 | struct snd_soc_codec *codec = w->codec; |
1116 | int i; | ||
1075 | int dac; | 1117 | int dac; |
1076 | int adc; | 1118 | int adc; |
1077 | int val; | 1119 | int val; |
@@ -1122,6 +1164,13 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, | |||
1122 | WM8994_AIF2DACR_ENA); | 1164 | WM8994_AIF2DACR_ENA); |
1123 | break; | 1165 | break; |
1124 | 1166 | ||
1167 | case SND_SOC_DAPM_POST_PMU: | ||
1168 | for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) | ||
1169 | snd_soc_write(codec, wm8994_vu_bits[i].reg, | ||
1170 | snd_soc_read(codec, | ||
1171 | wm8994_vu_bits[i].reg)); | ||
1172 | break; | ||
1173 | |||
1125 | case SND_SOC_DAPM_PRE_PMD: | 1174 | case SND_SOC_DAPM_PRE_PMD: |
1126 | case SND_SOC_DAPM_POST_PMD: | 1175 | case SND_SOC_DAPM_POST_PMD: |
1127 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1176 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
@@ -1190,17 +1239,19 @@ static int late_enable_ev(struct snd_soc_dapm_widget *w, | |||
1190 | switch (event) { | 1239 | switch (event) { |
1191 | case SND_SOC_DAPM_PRE_PMU: | 1240 | case SND_SOC_DAPM_PRE_PMU: |
1192 | if (wm8994->aif1clk_enable) { | 1241 | if (wm8994->aif1clk_enable) { |
1193 | aif1clk_ev(w, kcontrol, event); | 1242 | aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU); |
1194 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | 1243 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, |
1195 | WM8994_AIF1CLK_ENA_MASK, | 1244 | WM8994_AIF1CLK_ENA_MASK, |
1196 | WM8994_AIF1CLK_ENA); | 1245 | WM8994_AIF1CLK_ENA); |
1246 | aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU); | ||
1197 | wm8994->aif1clk_enable = 0; | 1247 | wm8994->aif1clk_enable = 0; |
1198 | } | 1248 | } |
1199 | if (wm8994->aif2clk_enable) { | 1249 | if (wm8994->aif2clk_enable) { |
1200 | aif2clk_ev(w, kcontrol, event); | 1250 | aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU); |
1201 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | 1251 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, |
1202 | WM8994_AIF2CLK_ENA_MASK, | 1252 | WM8994_AIF2CLK_ENA_MASK, |
1203 | WM8994_AIF2CLK_ENA); | 1253 | WM8994_AIF2CLK_ENA); |
1254 | aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU); | ||
1204 | wm8994->aif2clk_enable = 0; | 1255 | wm8994->aif2clk_enable = 0; |
1205 | } | 1256 | } |
1206 | break; | 1257 | break; |
@@ -1221,15 +1272,17 @@ static int late_disable_ev(struct snd_soc_dapm_widget *w, | |||
1221 | switch (event) { | 1272 | switch (event) { |
1222 | case SND_SOC_DAPM_POST_PMD: | 1273 | case SND_SOC_DAPM_POST_PMD: |
1223 | if (wm8994->aif1clk_disable) { | 1274 | if (wm8994->aif1clk_disable) { |
1275 | aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD); | ||
1224 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | 1276 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, |
1225 | WM8994_AIF1CLK_ENA_MASK, 0); | 1277 | WM8994_AIF1CLK_ENA_MASK, 0); |
1226 | aif1clk_ev(w, kcontrol, event); | 1278 | aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD); |
1227 | wm8994->aif1clk_disable = 0; | 1279 | wm8994->aif1clk_disable = 0; |
1228 | } | 1280 | } |
1229 | if (wm8994->aif2clk_disable) { | 1281 | if (wm8994->aif2clk_disable) { |
1282 | aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD); | ||
1230 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | 1283 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, |
1231 | WM8994_AIF2CLK_ENA_MASK, 0); | 1284 | WM8994_AIF2CLK_ENA_MASK, 0); |
1232 | aif2clk_ev(w, kcontrol, event); | 1285 | aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD); |
1233 | wm8994->aif2clk_disable = 0; | 1286 | wm8994->aif2clk_disable = 0; |
1234 | } | 1287 | } |
1235 | break; | 1288 | break; |
@@ -1527,9 +1580,11 @@ SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) | |||
1527 | 1580 | ||
1528 | static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { | 1581 | static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { |
1529 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev, | 1582 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev, |
1530 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), | 1583 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
1584 | SND_SOC_DAPM_PRE_PMD), | ||
1531 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev, | 1585 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev, |
1532 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), | 1586 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
1587 | SND_SOC_DAPM_PRE_PMD), | ||
1533 | SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0), | 1588 | SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0), |
1534 | SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0, | 1589 | SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0, |
1535 | left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)), | 1590 | left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)), |
@@ -3879,39 +3934,11 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3879 | 3934 | ||
3880 | pm_runtime_put(codec->dev); | 3935 | pm_runtime_put(codec->dev); |
3881 | 3936 | ||
3882 | /* Latch volume updates (right only; we always do left then right). */ | 3937 | /* Latch volume update bits */ |
3883 | snd_soc_update_bits(codec, WM8994_AIF1_DAC1_LEFT_VOLUME, | 3938 | for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) |
3884 | WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU); | 3939 | snd_soc_update_bits(codec, wm8994_vu_bits[i].reg, |
3885 | snd_soc_update_bits(codec, WM8994_AIF1_DAC1_RIGHT_VOLUME, | 3940 | wm8994_vu_bits[i].mask, |
3886 | WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU); | 3941 | wm8994_vu_bits[i].mask); |
3887 | snd_soc_update_bits(codec, WM8994_AIF1_DAC2_LEFT_VOLUME, | ||
3888 | WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU); | ||
3889 | snd_soc_update_bits(codec, WM8994_AIF1_DAC2_RIGHT_VOLUME, | ||
3890 | WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU); | ||
3891 | snd_soc_update_bits(codec, WM8994_AIF2_DAC_LEFT_VOLUME, | ||
3892 | WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU); | ||
3893 | snd_soc_update_bits(codec, WM8994_AIF2_DAC_RIGHT_VOLUME, | ||
3894 | WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU); | ||
3895 | snd_soc_update_bits(codec, WM8994_AIF1_ADC1_LEFT_VOLUME, | ||
3896 | WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU); | ||
3897 | snd_soc_update_bits(codec, WM8994_AIF1_ADC1_RIGHT_VOLUME, | ||
3898 | WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU); | ||
3899 | snd_soc_update_bits(codec, WM8994_AIF1_ADC2_LEFT_VOLUME, | ||
3900 | WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU); | ||
3901 | snd_soc_update_bits(codec, WM8994_AIF1_ADC2_RIGHT_VOLUME, | ||
3902 | WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU); | ||
3903 | snd_soc_update_bits(codec, WM8994_AIF2_ADC_LEFT_VOLUME, | ||
3904 | WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU); | ||
3905 | snd_soc_update_bits(codec, WM8994_AIF2_ADC_RIGHT_VOLUME, | ||
3906 | WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU); | ||
3907 | snd_soc_update_bits(codec, WM8994_DAC1_LEFT_VOLUME, | ||
3908 | WM8994_DAC1_VU, WM8994_DAC1_VU); | ||
3909 | snd_soc_update_bits(codec, WM8994_DAC1_RIGHT_VOLUME, | ||
3910 | WM8994_DAC1_VU, WM8994_DAC1_VU); | ||
3911 | snd_soc_update_bits(codec, WM8994_DAC2_LEFT_VOLUME, | ||
3912 | WM8994_DAC2_VU, WM8994_DAC2_VU); | ||
3913 | snd_soc_update_bits(codec, WM8994_DAC2_RIGHT_VOLUME, | ||
3914 | WM8994_DAC2_VU, WM8994_DAC2_VU); | ||
3915 | 3942 | ||
3916 | /* Set the low bit of the 3D stereo depth so TLV matches */ | 3943 | /* Set the low bit of the 3D stereo depth so TLV matches */ |
3917 | snd_soc_update_bits(codec, WM8994_AIF1_DAC1_FILTERS_2, | 3944 | snd_soc_update_bits(codec, WM8994_AIF1_DAC1_FILTERS_2, |
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 8af422e38fd0..dc9b42b7fc4d 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -2837,8 +2837,6 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2837 | } | 2837 | } |
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | regcache_cache_only(codec->control_data, true); | ||
2841 | |||
2842 | /* Apply platform data settings */ | 2840 | /* Apply platform data settings */ |
2843 | snd_soc_update_bits(codec, WM8996_LINE_INPUT_CONTROL, | 2841 | snd_soc_update_bits(codec, WM8996_LINE_INPUT_CONTROL, |
2844 | WM8996_INL_MODE_MASK | WM8996_INR_MODE_MASK, | 2842 | WM8996_INL_MODE_MASK | WM8996_INR_MODE_MASK, |
@@ -3051,7 +3049,6 @@ static int wm8996_remove(struct snd_soc_codec *codec) | |||
3051 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) | 3049 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) |
3052 | regulator_unregister_notifier(wm8996->supplies[i].consumer, | 3050 | regulator_unregister_notifier(wm8996->supplies[i].consumer, |
3053 | &wm8996->disable_nb[i]); | 3051 | &wm8996->disable_nb[i]); |
3054 | regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3055 | 3052 | ||
3056 | return 0; | 3053 | return 0; |
3057 | } | 3054 | } |
@@ -3206,14 +3203,15 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c, | |||
3206 | dev_info(&i2c->dev, "revision %c\n", | 3203 | dev_info(&i2c->dev, "revision %c\n", |
3207 | (reg & WM8996_CHIP_REV_MASK) + 'A'); | 3204 | (reg & WM8996_CHIP_REV_MASK) + 'A'); |
3208 | 3205 | ||
3209 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3210 | |||
3211 | ret = wm8996_reset(wm8996); | 3206 | ret = wm8996_reset(wm8996); |
3212 | if (ret < 0) { | 3207 | if (ret < 0) { |
3213 | dev_err(&i2c->dev, "Failed to issue reset\n"); | 3208 | dev_err(&i2c->dev, "Failed to issue reset\n"); |
3214 | goto err_regmap; | 3209 | goto err_regmap; |
3215 | } | 3210 | } |
3216 | 3211 | ||
3212 | regcache_cache_only(wm8996->regmap, true); | ||
3213 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3214 | |||
3217 | wm8996_init_gpio(wm8996); | 3215 | wm8996_init_gpio(wm8996); |
3218 | 3216 | ||
3219 | ret = snd_soc_register_codec(&i2c->dev, | 3217 | ret = snd_soc_register_codec(&i2c->dev, |
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index f23700359c67..080327414c6b 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/pinctrl/consumer.h> | ||
29 | 30 | ||
30 | #include "imx-audmux.h" | 31 | #include "imx-audmux.h" |
31 | 32 | ||
@@ -249,6 +250,7 @@ EXPORT_SYMBOL_GPL(imx_audmux_v2_configure_port); | |||
249 | static int __devinit imx_audmux_probe(struct platform_device *pdev) | 250 | static int __devinit imx_audmux_probe(struct platform_device *pdev) |
250 | { | 251 | { |
251 | struct resource *res; | 252 | struct resource *res; |
253 | struct pinctrl *pinctrl; | ||
252 | const struct of_device_id *of_id = | 254 | const struct of_device_id *of_id = |
253 | of_match_device(imx_audmux_dt_ids, &pdev->dev); | 255 | of_match_device(imx_audmux_dt_ids, &pdev->dev); |
254 | 256 | ||
@@ -257,6 +259,12 @@ static int __devinit imx_audmux_probe(struct platform_device *pdev) | |||
257 | if (!audmux_base) | 259 | if (!audmux_base) |
258 | return -EADDRNOTAVAIL; | 260 | return -EADDRNOTAVAIL; |
259 | 261 | ||
262 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
263 | if (IS_ERR(pinctrl)) { | ||
264 | dev_err(&pdev->dev, "setup pinctrl failed!"); | ||
265 | return PTR_ERR(pinctrl); | ||
266 | } | ||
267 | |||
260 | audmux_clk = clk_get(&pdev->dev, "audmux"); | 268 | audmux_clk = clk_get(&pdev->dev, "audmux"); |
261 | if (IS_ERR(audmux_clk)) { | 269 | if (IS_ERR(audmux_clk)) { |
262 | dev_dbg(&pdev->dev, "cannot get clock: %ld\n", | 270 | dev_dbg(&pdev->dev, "cannot get clock: %ld\n", |
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 1c2aa7fab3fd..4da5fc55c7ee 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | #include <mach/dma.h> | 35 | #include <mach/dma.h> |
36 | #include <mach/audio.h> | ||
37 | 36 | ||
38 | #include "../../arm/pxa2xx-pcm.h" | 37 | #include "../../arm/pxa2xx-pcm.h" |
39 | #include "pxa-ssp.h" | 38 | #include "pxa-ssp.h" |
@@ -194,7 +193,7 @@ static void pxa_ssp_set_scr(struct ssp_device *ssp, u32 div) | |||
194 | { | 193 | { |
195 | u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); | 194 | u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); |
196 | 195 | ||
197 | if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP) { | 196 | if (ssp->type == PXA25x_SSP) { |
198 | sscr0 &= ~0x0000ff00; | 197 | sscr0 &= ~0x0000ff00; |
199 | sscr0 |= ((div - 2)/2) << 8; /* 2..512 */ | 198 | sscr0 |= ((div - 2)/2) << 8; /* 2..512 */ |
200 | } else { | 199 | } else { |
@@ -212,7 +211,7 @@ static u32 pxa_ssp_get_scr(struct ssp_device *ssp) | |||
212 | u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); | 211 | u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); |
213 | u32 div; | 212 | u32 div; |
214 | 213 | ||
215 | if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP) | 214 | if (ssp->type == PXA25x_SSP) |
216 | div = ((sscr0 >> 8) & 0xff) * 2 + 2; | 215 | div = ((sscr0 >> 8) & 0xff) * 2 + 2; |
217 | else | 216 | else |
218 | div = ((sscr0 >> 8) & 0xfff) + 1; | 217 | div = ((sscr0 >> 8) & 0xfff) + 1; |
@@ -242,7 +241,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
242 | break; | 241 | break; |
243 | case PXA_SSP_CLK_PLL: | 242 | case PXA_SSP_CLK_PLL: |
244 | /* Internal PLL is fixed */ | 243 | /* Internal PLL is fixed */ |
245 | if (cpu_is_pxa25x()) | 244 | if (ssp->type == PXA25x_SSP) |
246 | priv->sysclk = 1843200; | 245 | priv->sysclk = 1843200; |
247 | else | 246 | else |
248 | priv->sysclk = 13000000; | 247 | priv->sysclk = 13000000; |
@@ -266,11 +265,11 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
266 | 265 | ||
267 | /* The SSP clock must be disabled when changing SSP clock mode | 266 | /* The SSP clock must be disabled when changing SSP clock mode |
268 | * on PXA2xx. On PXA3xx it must be enabled when doing so. */ | 267 | * on PXA2xx. On PXA3xx it must be enabled when doing so. */ |
269 | if (!cpu_is_pxa3xx()) | 268 | if (ssp->type != PXA3xx_SSP) |
270 | clk_disable(ssp->clk); | 269 | clk_disable(ssp->clk); |
271 | val = pxa_ssp_read_reg(ssp, SSCR0) | sscr0; | 270 | val = pxa_ssp_read_reg(ssp, SSCR0) | sscr0; |
272 | pxa_ssp_write_reg(ssp, SSCR0, val); | 271 | pxa_ssp_write_reg(ssp, SSCR0, val); |
273 | if (!cpu_is_pxa3xx()) | 272 | if (ssp->type != PXA3xx_SSP) |
274 | clk_enable(ssp->clk); | 273 | clk_enable(ssp->clk); |
275 | 274 | ||
276 | return 0; | 275 | return 0; |
@@ -294,24 +293,20 @@ static int pxa_ssp_set_dai_clkdiv(struct snd_soc_dai *cpu_dai, | |||
294 | case PXA_SSP_AUDIO_DIV_SCDB: | 293 | case PXA_SSP_AUDIO_DIV_SCDB: |
295 | val = pxa_ssp_read_reg(ssp, SSACD); | 294 | val = pxa_ssp_read_reg(ssp, SSACD); |
296 | val &= ~SSACD_SCDB; | 295 | val &= ~SSACD_SCDB; |
297 | #if defined(CONFIG_PXA3xx) | 296 | if (ssp->type == PXA3xx_SSP) |
298 | if (cpu_is_pxa3xx()) | ||
299 | val &= ~SSACD_SCDX8; | 297 | val &= ~SSACD_SCDX8; |
300 | #endif | ||
301 | switch (div) { | 298 | switch (div) { |
302 | case PXA_SSP_CLK_SCDB_1: | 299 | case PXA_SSP_CLK_SCDB_1: |
303 | val |= SSACD_SCDB; | 300 | val |= SSACD_SCDB; |
304 | break; | 301 | break; |
305 | case PXA_SSP_CLK_SCDB_4: | 302 | case PXA_SSP_CLK_SCDB_4: |
306 | break; | 303 | break; |
307 | #if defined(CONFIG_PXA3xx) | ||
308 | case PXA_SSP_CLK_SCDB_8: | 304 | case PXA_SSP_CLK_SCDB_8: |
309 | if (cpu_is_pxa3xx()) | 305 | if (ssp->type == PXA3xx_SSP) |
310 | val |= SSACD_SCDX8; | 306 | val |= SSACD_SCDX8; |
311 | else | 307 | else |
312 | return -EINVAL; | 308 | return -EINVAL; |
313 | break; | 309 | break; |
314 | #endif | ||
315 | default: | 310 | default: |
316 | return -EINVAL; | 311 | return -EINVAL; |
317 | } | 312 | } |
@@ -337,10 +332,8 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id, | |||
337 | struct ssp_device *ssp = priv->ssp; | 332 | struct ssp_device *ssp = priv->ssp; |
338 | u32 ssacd = pxa_ssp_read_reg(ssp, SSACD) & ~0x70; | 333 | u32 ssacd = pxa_ssp_read_reg(ssp, SSACD) & ~0x70; |
339 | 334 | ||
340 | #if defined(CONFIG_PXA3xx) | 335 | if (ssp->type == PXA3xx_SSP) |
341 | if (cpu_is_pxa3xx()) | ||
342 | pxa_ssp_write_reg(ssp, SSACDD, 0); | 336 | pxa_ssp_write_reg(ssp, SSACDD, 0); |
343 | #endif | ||
344 | 337 | ||
345 | switch (freq_out) { | 338 | switch (freq_out) { |
346 | case 5622000: | 339 | case 5622000: |
@@ -365,11 +358,10 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id, | |||
365 | break; | 358 | break; |
366 | 359 | ||
367 | default: | 360 | default: |
368 | #ifdef CONFIG_PXA3xx | ||
369 | /* PXA3xx has a clock ditherer which can be used to generate | 361 | /* PXA3xx has a clock ditherer which can be used to generate |
370 | * a wider range of frequencies - calculate a value for it. | 362 | * a wider range of frequencies - calculate a value for it. |
371 | */ | 363 | */ |
372 | if (cpu_is_pxa3xx()) { | 364 | if (ssp->type == PXA3xx_SSP) { |
373 | u32 val; | 365 | u32 val; |
374 | u64 tmp = 19968; | 366 | u64 tmp = 19968; |
375 | tmp *= 1000000; | 367 | tmp *= 1000000; |
@@ -386,7 +378,6 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id, | |||
386 | val, freq_out); | 378 | val, freq_out); |
387 | break; | 379 | break; |
388 | } | 380 | } |
389 | #endif | ||
390 | 381 | ||
391 | return -EINVAL; | 382 | return -EINVAL; |
392 | } | 383 | } |
@@ -590,10 +581,8 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, | |||
590 | /* bit size */ | 581 | /* bit size */ |
591 | switch (params_format(params)) { | 582 | switch (params_format(params)) { |
592 | case SNDRV_PCM_FORMAT_S16_LE: | 583 | case SNDRV_PCM_FORMAT_S16_LE: |
593 | #ifdef CONFIG_PXA3xx | 584 | if (ssp->type == PXA3xx_SSP) |
594 | if (cpu_is_pxa3xx()) | ||
595 | sscr0 |= SSCR0_FPCKE; | 585 | sscr0 |= SSCR0_FPCKE; |
596 | #endif | ||
597 | sscr0 |= SSCR0_DataSize(16); | 586 | sscr0 |= SSCR0_DataSize(16); |
598 | break; | 587 | break; |
599 | case SNDRV_PCM_FORMAT_S24_LE: | 588 | case SNDRV_PCM_FORMAT_S24_LE: |
@@ -618,9 +607,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, | |||
618 | * trying and failing a lot; some of the registers | 607 | * trying and failing a lot; some of the registers |
619 | * needed for that mode are only available on PXA3xx. | 608 | * needed for that mode are only available on PXA3xx. |
620 | */ | 609 | */ |
621 | 610 | if (ssp->type != PXA3xx_SSP) | |
622 | #ifdef CONFIG_PXA3xx | ||
623 | if (!cpu_is_pxa3xx()) | ||
624 | return -EINVAL; | 611 | return -EINVAL; |
625 | 612 | ||
626 | sspsp |= SSPSP_SFRMWDTH(width * 2); | 613 | sspsp |= SSPSP_SFRMWDTH(width * 2); |
@@ -628,9 +615,6 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, | |||
628 | sspsp |= SSPSP_EDMYSTOP(3); | 615 | sspsp |= SSPSP_EDMYSTOP(3); |
629 | sspsp |= SSPSP_DMYSTOP(3); | 616 | sspsp |= SSPSP_DMYSTOP(3); |
630 | sspsp |= SSPSP_DMYSTRT(1); | 617 | sspsp |= SSPSP_DMYSTRT(1); |
631 | #else | ||
632 | return -EINVAL; | ||
633 | #endif | ||
634 | } else { | 618 | } else { |
635 | /* The frame width is the width the LRCLK is | 619 | /* The frame width is the width the LRCLK is |
636 | * asserted for; the delay is expressed in | 620 | * asserted for; the delay is expressed in |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 90ee77d2409d..89eae93445cf 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -913,7 +913,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, | |||
913 | /* do we need to add this widget to the list ? */ | 913 | /* do we need to add this widget to the list ? */ |
914 | if (list) { | 914 | if (list) { |
915 | int err; | 915 | int err; |
916 | err = dapm_list_add_widget(list, path->sink); | 916 | err = dapm_list_add_widget(list, path->source); |
917 | if (err < 0) { | 917 | if (err < 0) { |
918 | dev_err(widget->dapm->dev, "could not add widget %s\n", | 918 | dev_err(widget->dapm->dev, "could not add widget %s\n", |
919 | widget->name); | 919 | widget->name); |
@@ -954,7 +954,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, | |||
954 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 954 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) |
955 | paths = is_connected_output_ep(dai->playback_widget, list); | 955 | paths = is_connected_output_ep(dai->playback_widget, list); |
956 | else | 956 | else |
957 | paths = is_connected_input_ep(dai->playback_widget, list); | 957 | paths = is_connected_input_ep(dai->capture_widget, list); |
958 | 958 | ||
959 | trace_snd_soc_dapm_connected(paths, stream); | 959 | trace_snd_soc_dapm_connected(paths, stream); |
960 | dapm_clear_walk(&card->dapm); | 960 | dapm_clear_walk(&card->dapm); |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index bedd1717a373..48fd15b312c1 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -794,6 +794,9 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, | |||
794 | for (i = 0; i < card->num_links; i++) { | 794 | for (i = 0; i < card->num_links; i++) { |
795 | be = &card->rtd[i]; | 795 | be = &card->rtd[i]; |
796 | 796 | ||
797 | if (!be->dai_link->no_pcm) | ||
798 | continue; | ||
799 | |||
797 | if (be->cpu_dai->playback_widget == widget || | 800 | if (be->cpu_dai->playback_widget == widget || |
798 | be->codec_dai->playback_widget == widget) | 801 | be->codec_dai->playback_widget == widget) |
799 | return be; | 802 | return be; |
@@ -803,6 +806,9 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, | |||
803 | for (i = 0; i < card->num_links; i++) { | 806 | for (i = 0; i < card->num_links; i++) { |
804 | be = &card->rtd[i]; | 807 | be = &card->rtd[i]; |
805 | 808 | ||
809 | if (!be->dai_link->no_pcm) | ||
810 | continue; | ||
811 | |||
806 | if (be->cpu_dai->capture_widget == widget || | 812 | if (be->cpu_dai->capture_widget == widget || |
807 | be->codec_dai->capture_widget == widget) | 813 | be->codec_dai->capture_widget == widget) |
808 | return be; | 814 | return be; |
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index 57cd419f743e..f43edb364a18 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c | |||
@@ -629,3 +629,4 @@ MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); | |||
629 | MODULE_DESCRIPTION("Tegra30 AHUB driver"); | 629 | MODULE_DESCRIPTION("Tegra30 AHUB driver"); |
630 | MODULE_LICENSE("GPL v2"); | 630 | MODULE_LICENSE("GPL v2"); |
631 | MODULE_ALIAS("platform:" DRV_NAME); | 631 | MODULE_ALIAS("platform:" DRV_NAME); |
632 | MODULE_DEVICE_TABLE(of, tegra30_ahub_of_match); | ||
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 0b0df49d9d33..3b6da91188a9 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c | |||
@@ -346,6 +346,17 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) | |||
346 | return 0; | 346 | return 0; |
347 | } | 347 | } |
348 | 348 | ||
349 | static int tegra_wm8903_remove(struct snd_soc_card *card) | ||
350 | { | ||
351 | struct snd_soc_pcm_runtime *rtd = &(card->rtd[0]); | ||
352 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
353 | struct snd_soc_codec *codec = codec_dai->codec; | ||
354 | |||
355 | wm8903_mic_detect(codec, NULL, 0, 0); | ||
356 | |||
357 | return 0; | ||
358 | } | ||
359 | |||
349 | static struct snd_soc_dai_link tegra_wm8903_dai = { | 360 | static struct snd_soc_dai_link tegra_wm8903_dai = { |
350 | .name = "WM8903", | 361 | .name = "WM8903", |
351 | .stream_name = "WM8903 PCM", | 362 | .stream_name = "WM8903 PCM", |
@@ -363,6 +374,8 @@ static struct snd_soc_card snd_soc_tegra_wm8903 = { | |||
363 | .dai_link = &tegra_wm8903_dai, | 374 | .dai_link = &tegra_wm8903_dai, |
364 | .num_links = 1, | 375 | .num_links = 1, |
365 | 376 | ||
377 | .remove = tegra_wm8903_remove, | ||
378 | |||
366 | .controls = tegra_wm8903_controls, | 379 | .controls = tegra_wm8903_controls, |
367 | .num_controls = ARRAY_SIZE(tegra_wm8903_controls), | 380 | .num_controls = ARRAY_SIZE(tegra_wm8903_controls), |
368 | .dapm_widgets = tegra_wm8903_dapm_widgets, | 381 | .dapm_widgets = tegra_wm8903_dapm_widgets, |
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index 6f9715ab32fe..56ad923bf6b5 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c | |||
@@ -209,7 +209,7 @@ static int usb6fire_fw_ezusb_upload( | |||
209 | int ret; | 209 | int ret; |
210 | u8 data; | 210 | u8 data; |
211 | struct usb_device *device = interface_to_usbdev(intf); | 211 | struct usb_device *device = interface_to_usbdev(intf); |
212 | const struct firmware *fw = 0; | 212 | const struct firmware *fw = NULL; |
213 | struct ihex_record *rec = kmalloc(sizeof(struct ihex_record), | 213 | struct ihex_record *rec = kmalloc(sizeof(struct ihex_record), |
214 | GFP_KERNEL); | 214 | GFP_KERNEL); |
215 | 215 | ||
diff --git a/sound/usb/card.h b/sound/usb/card.h index 0d37238b8457..2b9fffff23b6 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h | |||
@@ -119,6 +119,7 @@ struct snd_usb_substream { | |||
119 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ | 119 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ |
120 | 120 | ||
121 | /* data and sync endpoints for this stream */ | 121 | /* data and sync endpoints for this stream */ |
122 | unsigned int ep_num; /* the endpoint number */ | ||
122 | struct snd_usb_endpoint *data_endpoint; | 123 | struct snd_usb_endpoint *data_endpoint; |
123 | struct snd_usb_endpoint *sync_endpoint; | 124 | struct snd_usb_endpoint *sync_endpoint; |
124 | unsigned long flags; | 125 | unsigned long flags; |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index cdf8b7601973..54607f8c4f66 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -354,17 +354,21 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
354 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 354 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && |
355 | get_endpoint(alts, 1)->bSynchAddress != 0 && | 355 | get_endpoint(alts, 1)->bSynchAddress != 0 && |
356 | !implicit_fb)) { | 356 | !implicit_fb)) { |
357 | snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", | 357 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n", |
358 | dev->devnum, fmt->iface, fmt->altsetting); | 358 | dev->devnum, fmt->iface, fmt->altsetting, |
359 | get_endpoint(alts, 1)->bmAttributes, | ||
360 | get_endpoint(alts, 1)->bLength, | ||
361 | get_endpoint(alts, 1)->bSynchAddress); | ||
359 | return -EINVAL; | 362 | return -EINVAL; |
360 | } | 363 | } |
361 | ep = get_endpoint(alts, 1)->bEndpointAddress; | 364 | ep = get_endpoint(alts, 1)->bEndpointAddress; |
362 | if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 365 | if (!implicit_fb && |
366 | get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | ||
363 | (( is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || | 367 | (( is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || |
364 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)) || | 368 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { |
365 | ( is_playback && !implicit_fb))) { | 369 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n", |
366 | snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", | 370 | dev->devnum, fmt->iface, fmt->altsetting, |
367 | dev->devnum, fmt->iface, fmt->altsetting); | 371 | is_playback, ep, get_endpoint(alts, 0)->bSynchAddress); |
368 | return -EINVAL; | 372 | return -EINVAL; |
369 | } | 373 | } |
370 | 374 | ||
@@ -1147,7 +1151,8 @@ static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substrea | |||
1147 | return -EINVAL; | 1151 | return -EINVAL; |
1148 | } | 1152 | } |
1149 | 1153 | ||
1150 | int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, int cmd) | 1154 | static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, |
1155 | int cmd) | ||
1151 | { | 1156 | { |
1152 | int err; | 1157 | int err; |
1153 | struct snd_usb_substream *subs = substream->runtime->private_data; | 1158 | struct snd_usb_substream *subs = substream->runtime->private_data; |
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 6b7d7a2b7baa..083ed81160e5 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c | |||
@@ -97,6 +97,7 @@ static void snd_usb_init_substream(struct snd_usb_stream *as, | |||
97 | subs->formats |= fp->formats; | 97 | subs->formats |= fp->formats; |
98 | subs->num_formats++; | 98 | subs->num_formats++; |
99 | subs->fmt_type = fp->fmt_type; | 99 | subs->fmt_type = fp->fmt_type; |
100 | subs->ep_num = fp->endpoint; | ||
100 | } | 101 | } |
101 | 102 | ||
102 | /* | 103 | /* |
@@ -119,9 +120,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, | |||
119 | if (as->fmt_type != fp->fmt_type) | 120 | if (as->fmt_type != fp->fmt_type) |
120 | continue; | 121 | continue; |
121 | subs = &as->substream[stream]; | 122 | subs = &as->substream[stream]; |
122 | if (!subs->data_endpoint) | 123 | if (subs->ep_num == fp->endpoint) { |
123 | continue; | ||
124 | if (subs->data_endpoint->ep_num == fp->endpoint) { | ||
125 | list_add_tail(&fp->list, &subs->fmt_list); | 124 | list_add_tail(&fp->list, &subs->fmt_list); |
126 | subs->num_formats++; | 125 | subs->num_formats++; |
127 | subs->formats |= fp->formats; | 126 | subs->formats |= fp->formats; |
@@ -134,7 +133,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, | |||
134 | if (as->fmt_type != fp->fmt_type) | 133 | if (as->fmt_type != fp->fmt_type) |
135 | continue; | 134 | continue; |
136 | subs = &as->substream[stream]; | 135 | subs = &as->substream[stream]; |
137 | if (subs->data_endpoint) | 136 | if (subs->ep_num) |
138 | continue; | 137 | continue; |
139 | err = snd_pcm_new_stream(as->pcm, stream, 1); | 138 | err = snd_pcm_new_stream(as->pcm, stream, 1); |
140 | if (err < 0) | 139 | if (err < 0) |