diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:19:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:19:44 -0400 |
commit | e7990d45bb88c2f0565b5ee4c32eefe81653faff (patch) | |
tree | 852ab6988b7226083fefa0e0e851dbff0e7ec7f2 /sound/pci | |
parent | 190a3998be3ede25d6145e187d6d321f504d28fb (diff) | |
parent | a5065eb6da55b226661456e6a7435f605df98111 (diff) |
Merge tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here is a bunch of small fixes that have been collected since the
previous pull request. In addition to various misc fixes, the
following are included:
- HD-audio quirks for Dell, HP, Chromebook, and ALC28x codecs
- HD-audio AMD HDMI regression fix
- Continued PM support/fixes for ice1712 driver
- Multiplatform fixes for ASoC samsung drivers
- Addition of device id tables to a few ASoC drivers
- Bit clock polarity config and error flag fixes in ASoC fsl_sai"
* tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()
ALSA: hda - Make full_reset boolean
ALSA: hda - add headset mic detect quirk for a Dell laptop
sound: dmasound: use module_platform_driver_probe()
ALSA: au1x00: use module_platform_driver()
ALSA: hda - Use runtime helper to check active state.
ALSA: ice1712: Fix boundary checks in PCM pointer ops
ASoC: davinci-mcasp: Fix bit clock polarity settings
ASoC: samsung: Fix build on multiplatform
ASoC: fsl_sai: Fix Bit Clock Polarity configurations
ALSA: hda - Do not assign streams in reverse order
ALSA: hda/realtek - Add eapd shutup to ALC283
ALSA: hda/realtek - Change model name alias for ChromeOS
ASoC: da732x: Print correct major id
ALSA: hda/realtek - Improve HP depop when system change power state on Chromebook
ASoC: cs42l52: Fix mask for REVID
sound/oss: Remove uncompilable DBG macro use
ALSA: ice1712: Save/restore routing and rate registers
ALSA: ice1712: restore AK4xxx volumes on resume
ASoC: alc56(23|32): fix undefined return value of probing code
...
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_controller.c | 19 | ||||
-rw-r--r-- | sound/pci/hda/hda_controller.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 23 | ||||
-rw-r--r-- | sound/pci/ice1712/delta.c | 31 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 47 |
6 files changed, 103 insertions, 23 deletions
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 97993e17f46a..248b90abb882 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c | |||
@@ -187,13 +187,14 @@ azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream) | |||
187 | struct azx_dev *azx_dev = &chip->azx_dev[dev]; | 187 | struct azx_dev *azx_dev = &chip->azx_dev[dev]; |
188 | dsp_lock(azx_dev); | 188 | dsp_lock(azx_dev); |
189 | if (!azx_dev->opened && !dsp_is_locked(azx_dev)) { | 189 | if (!azx_dev->opened && !dsp_is_locked(azx_dev)) { |
190 | res = azx_dev; | 190 | if (azx_dev->assigned_key == key) { |
191 | if (res->assigned_key == key) { | 191 | azx_dev->opened = 1; |
192 | res->opened = 1; | 192 | azx_dev->assigned_key = key; |
193 | res->assigned_key = key; | ||
194 | dsp_unlock(azx_dev); | 193 | dsp_unlock(azx_dev); |
195 | return azx_dev; | 194 | return azx_dev; |
196 | } | 195 | } |
196 | if (!res) | ||
197 | res = azx_dev; | ||
197 | } | 198 | } |
198 | dsp_unlock(azx_dev); | 199 | dsp_unlock(azx_dev); |
199 | } | 200 | } |
@@ -1604,7 +1605,7 @@ static void azx_exit_link_reset(struct azx *chip) | |||
1604 | } | 1605 | } |
1605 | 1606 | ||
1606 | /* reset codec link */ | 1607 | /* reset codec link */ |
1607 | static int azx_reset(struct azx *chip, int full_reset) | 1608 | static int azx_reset(struct azx *chip, bool full_reset) |
1608 | { | 1609 | { |
1609 | if (!full_reset) | 1610 | if (!full_reset) |
1610 | goto __skip; | 1611 | goto __skip; |
@@ -1701,7 +1702,7 @@ static void azx_int_clear(struct azx *chip) | |||
1701 | /* | 1702 | /* |
1702 | * reset and start the controller registers | 1703 | * reset and start the controller registers |
1703 | */ | 1704 | */ |
1704 | void azx_init_chip(struct azx *chip, int full_reset) | 1705 | void azx_init_chip(struct azx *chip, bool full_reset) |
1705 | { | 1706 | { |
1706 | if (chip->initialized) | 1707 | if (chip->initialized) |
1707 | return; | 1708 | return; |
@@ -1758,7 +1759,7 @@ irqreturn_t azx_interrupt(int irq, void *dev_id) | |||
1758 | 1759 | ||
1759 | #ifdef CONFIG_PM_RUNTIME | 1760 | #ifdef CONFIG_PM_RUNTIME |
1760 | if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) | 1761 | if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) |
1761 | if (chip->card->dev->power.runtime_status != RPM_ACTIVE) | 1762 | if (!pm_runtime_active(chip->card->dev)) |
1762 | return IRQ_NONE; | 1763 | return IRQ_NONE; |
1763 | #endif | 1764 | #endif |
1764 | 1765 | ||
@@ -1841,7 +1842,7 @@ static void azx_bus_reset(struct hda_bus *bus) | |||
1841 | 1842 | ||
1842 | bus->in_reset = 1; | 1843 | bus->in_reset = 1; |
1843 | azx_stop_chip(chip); | 1844 | azx_stop_chip(chip); |
1844 | azx_init_chip(chip, 1); | 1845 | azx_init_chip(chip, true); |
1845 | #ifdef CONFIG_PM | 1846 | #ifdef CONFIG_PM |
1846 | if (chip->initialized) { | 1847 | if (chip->initialized) { |
1847 | struct azx_pcm *p; | 1848 | struct azx_pcm *p; |
@@ -1948,7 +1949,7 @@ int azx_codec_create(struct azx *chip, const char *model, | |||
1948 | * get back to the sanity state. | 1949 | * get back to the sanity state. |
1949 | */ | 1950 | */ |
1950 | azx_stop_chip(chip); | 1951 | azx_stop_chip(chip); |
1951 | azx_init_chip(chip, 1); | 1952 | azx_init_chip(chip, true); |
1952 | } | 1953 | } |
1953 | } | 1954 | } |
1954 | } | 1955 | } |
diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index 1d2e3be2bae6..baf0e77330af 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h | |||
@@ -37,7 +37,7 @@ int azx_alloc_stream_pages(struct azx *chip); | |||
37 | void azx_free_stream_pages(struct azx *chip); | 37 | void azx_free_stream_pages(struct azx *chip); |
38 | 38 | ||
39 | /* Low level azx interface */ | 39 | /* Low level azx interface */ |
40 | void azx_init_chip(struct azx *chip, int full_reset); | 40 | void azx_init_chip(struct azx *chip, bool full_reset); |
41 | void azx_stop_chip(struct azx *chip); | 41 | void azx_stop_chip(struct azx *chip); |
42 | void azx_enter_link_reset(struct azx *chip); | 42 | void azx_enter_link_reset(struct azx *chip); |
43 | irqreturn_t azx_interrupt(int irq, void *dev_id); | 43 | irqreturn_t azx_interrupt(int irq, void *dev_id); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 77ca894f8284..d6bca62ef387 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -636,7 +636,7 @@ static int azx_resume(struct device *dev) | |||
636 | return -EIO; | 636 | return -EIO; |
637 | azx_init_pci(chip); | 637 | azx_init_pci(chip); |
638 | 638 | ||
639 | azx_init_chip(chip, 1); | 639 | azx_init_chip(chip, true); |
640 | 640 | ||
641 | snd_hda_resume(chip->bus); | 641 | snd_hda_resume(chip->bus); |
642 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 642 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
@@ -689,7 +689,7 @@ static int azx_runtime_resume(struct device *dev) | |||
689 | status = azx_readw(chip, STATESTS); | 689 | status = azx_readw(chip, STATESTS); |
690 | 690 | ||
691 | azx_init_pci(chip); | 691 | azx_init_pci(chip); |
692 | azx_init_chip(chip, 1); | 692 | azx_init_chip(chip, true); |
693 | 693 | ||
694 | bus = chip->bus; | 694 | bus = chip->bus; |
695 | if (status && bus) { | 695 | if (status && bus) { |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ea2351d119f0..14ae979a92ea 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3026,6 +3026,11 @@ static void alc283_init(struct hda_codec *codec) | |||
3026 | bool hp_pin_sense; | 3026 | bool hp_pin_sense; |
3027 | int val; | 3027 | int val; |
3028 | 3028 | ||
3029 | if (!spec->gen.autocfg.hp_outs) { | ||
3030 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | ||
3031 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | ||
3032 | } | ||
3033 | |||
3029 | alc283_restore_default_value(codec); | 3034 | alc283_restore_default_value(codec); |
3030 | 3035 | ||
3031 | if (!hp_pin) | 3036 | if (!hp_pin) |
@@ -3062,6 +3067,11 @@ static void alc283_shutup(struct hda_codec *codec) | |||
3062 | bool hp_pin_sense; | 3067 | bool hp_pin_sense; |
3063 | int val; | 3068 | int val; |
3064 | 3069 | ||
3070 | if (!spec->gen.autocfg.hp_outs) { | ||
3071 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | ||
3072 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | ||
3073 | } | ||
3074 | |||
3065 | if (!hp_pin) { | 3075 | if (!hp_pin) { |
3066 | alc269_shutup(codec); | 3076 | alc269_shutup(codec); |
3067 | return; | 3077 | return; |
@@ -3085,6 +3095,7 @@ static void alc283_shutup(struct hda_codec *codec) | |||
3085 | 3095 | ||
3086 | if (hp_pin_sense) | 3096 | if (hp_pin_sense) |
3087 | msleep(100); | 3097 | msleep(100); |
3098 | alc_auto_setup_eapd(codec, false); | ||
3088 | snd_hda_shutup_pins(codec); | 3099 | snd_hda_shutup_pins(codec); |
3089 | alc_write_coef_idx(codec, 0x43, 0x9614); | 3100 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3090 | } | 3101 | } |
@@ -3361,8 +3372,9 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) | |||
3361 | 3372 | ||
3362 | if (spec->mute_led_polarity) | 3373 | if (spec->mute_led_polarity) |
3363 | enabled = !enabled; | 3374 | enabled = !enabled; |
3364 | pinval = AC_PINCTL_IN_EN | | 3375 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
3365 | (enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80); | 3376 | pinval &= ~AC_PINCTL_VREFEN; |
3377 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; | ||
3366 | if (spec->mute_led_nid) | 3378 | if (spec->mute_led_nid) |
3367 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); | 3379 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
3368 | } | 3380 | } |
@@ -3994,6 +4006,10 @@ static void alc283_fixup_chromebook(struct hda_codec *codec, | |||
3994 | spec->gen.mixer_nid = 0; | 4006 | spec->gen.mixer_nid = 0; |
3995 | break; | 4007 | break; |
3996 | case HDA_FIXUP_ACT_INIT: | 4008 | case HDA_FIXUP_ACT_INIT: |
4009 | /* MIC2-VREF control */ | ||
4010 | /* Set to manual mode */ | ||
4011 | val = alc_read_coef_idx(codec, 0x06); | ||
4012 | alc_write_coef_idx(codec, 0x06, val & ~0x000c); | ||
3997 | /* Enable Line1 input control by verb */ | 4013 | /* Enable Line1 input control by verb */ |
3998 | val = alc_read_coef_idx(codec, 0x1a); | 4014 | val = alc_read_coef_idx(codec, 0x1a); |
3999 | alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); | 4015 | alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); |
@@ -4602,6 +4618,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4602 | SND_PCI_QUIRK(0x1028, 0x0658, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | 4618 | SND_PCI_QUIRK(0x1028, 0x0658, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
4603 | SND_PCI_QUIRK(0x1028, 0x065f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | 4619 | SND_PCI_QUIRK(0x1028, 0x065f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
4604 | SND_PCI_QUIRK(0x1028, 0x0662, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | 4620 | SND_PCI_QUIRK(0x1028, 0x0662, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
4621 | SND_PCI_QUIRK(0x1028, 0x0667, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | ||
4605 | SND_PCI_QUIRK(0x1028, 0x0668, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), | 4622 | SND_PCI_QUIRK(0x1028, 0x0668, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), |
4606 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), | 4623 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), |
4607 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), | 4624 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), |
@@ -4768,7 +4785,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
4768 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | 4785 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
4769 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, | 4786 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
4770 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | 4787 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
4771 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-chrome"}, | 4788 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
4772 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, | 4789 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
4773 | {} | 4790 | {} |
4774 | }; | 4791 | }; |
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index ed2144eee38a..496dbd0ad5db 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c | |||
@@ -579,12 +579,37 @@ static struct snd_ak4xxx_private akm_vx442_priv = { | |||
579 | #ifdef CONFIG_PM_SLEEP | 579 | #ifdef CONFIG_PM_SLEEP |
580 | static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) | 580 | static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) |
581 | { | 581 | { |
582 | unsigned char akm_backup[AK4XXX_IMAGE_SIZE]; | 582 | unsigned char akm_img_bak[AK4XXX_IMAGE_SIZE]; |
583 | unsigned char akm_vol_bak[AK4XXX_IMAGE_SIZE]; | ||
584 | |||
585 | /* init spdif */ | ||
586 | switch (ice->eeprom.subvendor) { | ||
587 | case ICE1712_SUBDEVICE_AUDIOPHILE: | ||
588 | case ICE1712_SUBDEVICE_DELTA410: | ||
589 | case ICE1712_SUBDEVICE_DELTA1010E: | ||
590 | case ICE1712_SUBDEVICE_DELTA1010LT: | ||
591 | case ICE1712_SUBDEVICE_VX442: | ||
592 | case ICE1712_SUBDEVICE_DELTA66E: | ||
593 | snd_cs8427_init(ice->i2c, ice->cs8427); | ||
594 | break; | ||
595 | case ICE1712_SUBDEVICE_DELTA1010: | ||
596 | case ICE1712_SUBDEVICE_MEDIASTATION: | ||
597 | /* nothing */ | ||
598 | break; | ||
599 | case ICE1712_SUBDEVICE_DELTADIO2496: | ||
600 | case ICE1712_SUBDEVICE_DELTA66: | ||
601 | /* Set spdif defaults */ | ||
602 | snd_ice1712_delta_cs8403_spdif_write(ice, ice->spdif.cs8403_bits); | ||
603 | break; | ||
604 | } | ||
605 | |||
583 | /* init codec and restore registers */ | 606 | /* init codec and restore registers */ |
584 | if (ice->akm_codecs) { | 607 | if (ice->akm_codecs) { |
585 | memcpy(akm_backup, ice->akm->images, sizeof(akm_backup)); | 608 | memcpy(akm_img_bak, ice->akm->images, sizeof(akm_img_bak)); |
609 | memcpy(akm_vol_bak, ice->akm->volumes, sizeof(akm_vol_bak)); | ||
586 | snd_akm4xxx_init(ice->akm); | 610 | snd_akm4xxx_init(ice->akm); |
587 | memcpy(ice->akm->images, akm_backup, sizeof(akm_backup)); | 611 | memcpy(ice->akm->images, akm_img_bak, sizeof(akm_img_bak)); |
612 | memcpy(ice->akm->volumes, akm_vol_bak, sizeof(akm_vol_bak)); | ||
588 | snd_akm4xxx_reset(ice->akm, 0); | 613 | snd_akm4xxx_reset(ice->akm, 0); |
589 | } | 614 | } |
590 | 615 | ||
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 291672fc4a99..d9b9e4595f17 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -685,9 +685,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream * | |||
685 | if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1)) | 685 | if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1)) |
686 | return 0; | 686 | return 0; |
687 | ptr = runtime->buffer_size - inw(ice->ddma_port + 4); | 687 | ptr = runtime->buffer_size - inw(ice->ddma_port + 4); |
688 | ptr = bytes_to_frames(substream->runtime, ptr); | ||
688 | if (ptr == runtime->buffer_size) | 689 | if (ptr == runtime->buffer_size) |
689 | ptr = 0; | 690 | ptr = 0; |
690 | return bytes_to_frames(substream->runtime, ptr); | 691 | return ptr; |
691 | } | 692 | } |
692 | 693 | ||
693 | static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream) | 694 | static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream) |
@@ -704,9 +705,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substrea | |||
704 | addr = ICE1712_DSC_ADDR0; | 705 | addr = ICE1712_DSC_ADDR0; |
705 | ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) - | 706 | ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) - |
706 | ice->playback_con_virt_addr[substream->number]; | 707 | ice->playback_con_virt_addr[substream->number]; |
708 | ptr = bytes_to_frames(substream->runtime, ptr); | ||
707 | if (ptr == substream->runtime->buffer_size) | 709 | if (ptr == substream->runtime->buffer_size) |
708 | ptr = 0; | 710 | ptr = 0; |
709 | return bytes_to_frames(substream->runtime, ptr); | 711 | return ptr; |
710 | } | 712 | } |
711 | 713 | ||
712 | static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream) | 714 | static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream) |
@@ -717,9 +719,10 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *s | |||
717 | if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1)) | 719 | if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1)) |
718 | return 0; | 720 | return 0; |
719 | ptr = inl(ICEREG(ice, CONCAP_ADDR)) - ice->capture_con_virt_addr; | 721 | ptr = inl(ICEREG(ice, CONCAP_ADDR)) - ice->capture_con_virt_addr; |
722 | ptr = bytes_to_frames(substream->runtime, ptr); | ||
720 | if (ptr == substream->runtime->buffer_size) | 723 | if (ptr == substream->runtime->buffer_size) |
721 | ptr = 0; | 724 | ptr = 0; |
722 | return bytes_to_frames(substream->runtime, ptr); | 725 | return ptr; |
723 | } | 726 | } |
724 | 727 | ||
725 | static const struct snd_pcm_hardware snd_ice1712_playback = { | 728 | static const struct snd_pcm_hardware snd_ice1712_playback = { |
@@ -1048,6 +1051,8 @@ __out: | |||
1048 | old = inb(ICEMT(ice, RATE)); | 1051 | old = inb(ICEMT(ice, RATE)); |
1049 | if (!force && old == val) | 1052 | if (!force && old == val) |
1050 | goto __out; | 1053 | goto __out; |
1054 | |||
1055 | ice->cur_rate = rate; | ||
1051 | outb(val, ICEMT(ice, RATE)); | 1056 | outb(val, ICEMT(ice, RATE)); |
1052 | spin_unlock_irqrestore(&ice->reg_lock, flags); | 1057 | spin_unlock_irqrestore(&ice->reg_lock, flags); |
1053 | 1058 | ||
@@ -1114,9 +1119,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substre | |||
1114 | if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START)) | 1119 | if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START)) |
1115 | return 0; | 1120 | return 0; |
1116 | ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2); | 1121 | ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2); |
1122 | ptr = bytes_to_frames(substream->runtime, ptr); | ||
1117 | if (ptr == substream->runtime->buffer_size) | 1123 | if (ptr == substream->runtime->buffer_size) |
1118 | ptr = 0; | 1124 | ptr = 0; |
1119 | return bytes_to_frames(substream->runtime, ptr); | 1125 | return ptr; |
1120 | } | 1126 | } |
1121 | 1127 | ||
1122 | static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream) | 1128 | static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream) |
@@ -1127,9 +1133,10 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substrea | |||
1127 | if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW)) | 1133 | if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW)) |
1128 | return 0; | 1134 | return 0; |
1129 | ptr = ice->capture_pro_size - (inw(ICEMT(ice, CAPTURE_SIZE)) << 2); | 1135 | ptr = ice->capture_pro_size - (inw(ICEMT(ice, CAPTURE_SIZE)) << 2); |
1136 | ptr = bytes_to_frames(substream->runtime, ptr); | ||
1130 | if (ptr == substream->runtime->buffer_size) | 1137 | if (ptr == substream->runtime->buffer_size) |
1131 | ptr = 0; | 1138 | ptr = 0; |
1132 | return bytes_to_frames(substream->runtime, ptr); | 1139 | return ptr; |
1133 | } | 1140 | } |
1134 | 1141 | ||
1135 | static const struct snd_pcm_hardware snd_ice1712_playback_pro = { | 1142 | static const struct snd_pcm_hardware snd_ice1712_playback_pro = { |
@@ -2832,6 +2839,12 @@ static int snd_ice1712_suspend(struct device *dev) | |||
2832 | snd_pcm_suspend_all(ice->pcm_ds); | 2839 | snd_pcm_suspend_all(ice->pcm_ds); |
2833 | snd_ac97_suspend(ice->ac97); | 2840 | snd_ac97_suspend(ice->ac97); |
2834 | 2841 | ||
2842 | spin_lock_irq(&ice->reg_lock); | ||
2843 | ice->pm_saved_is_spdif_master = is_spdif_master(ice); | ||
2844 | ice->pm_saved_spdif_ctrl = inw(ICEMT(ice, ROUTE_SPDOUT)); | ||
2845 | ice->pm_saved_route = inw(ICEMT(ice, ROUTE_PSDOUT03)); | ||
2846 | spin_unlock_irq(&ice->reg_lock); | ||
2847 | |||
2835 | if (ice->pm_suspend) | 2848 | if (ice->pm_suspend) |
2836 | ice->pm_suspend(ice); | 2849 | ice->pm_suspend(ice); |
2837 | 2850 | ||
@@ -2846,6 +2859,7 @@ static int snd_ice1712_resume(struct device *dev) | |||
2846 | struct pci_dev *pci = to_pci_dev(dev); | 2859 | struct pci_dev *pci = to_pci_dev(dev); |
2847 | struct snd_card *card = dev_get_drvdata(dev); | 2860 | struct snd_card *card = dev_get_drvdata(dev); |
2848 | struct snd_ice1712 *ice = card->private_data; | 2861 | struct snd_ice1712 *ice = card->private_data; |
2862 | int rate; | ||
2849 | 2863 | ||
2850 | if (!ice->pm_suspend_enabled) | 2864 | if (!ice->pm_suspend_enabled) |
2851 | return 0; | 2865 | return 0; |
@@ -2860,14 +2874,37 @@ static int snd_ice1712_resume(struct device *dev) | |||
2860 | 2874 | ||
2861 | pci_set_master(pci); | 2875 | pci_set_master(pci); |
2862 | 2876 | ||
2877 | if (ice->cur_rate) | ||
2878 | rate = ice->cur_rate; | ||
2879 | else | ||
2880 | rate = PRO_RATE_DEFAULT; | ||
2881 | |||
2863 | if (snd_ice1712_chip_init(ice) < 0) { | 2882 | if (snd_ice1712_chip_init(ice) < 0) { |
2864 | snd_card_disconnect(card); | 2883 | snd_card_disconnect(card); |
2865 | return -EIO; | 2884 | return -EIO; |
2866 | } | 2885 | } |
2867 | 2886 | ||
2887 | ice->cur_rate = rate; | ||
2888 | |||
2868 | if (ice->pm_resume) | 2889 | if (ice->pm_resume) |
2869 | ice->pm_resume(ice); | 2890 | ice->pm_resume(ice); |
2870 | 2891 | ||
2892 | if (ice->pm_saved_is_spdif_master) { | ||
2893 | /* switching to external clock via SPDIF */ | ||
2894 | spin_lock_irq(&ice->reg_lock); | ||
2895 | outb(inb(ICEMT(ice, RATE)) | ICE1712_SPDIF_MASTER, | ||
2896 | ICEMT(ice, RATE)); | ||
2897 | spin_unlock_irq(&ice->reg_lock); | ||
2898 | snd_ice1712_set_input_clock_source(ice, 1); | ||
2899 | } else { | ||
2900 | /* internal on-card clock */ | ||
2901 | snd_ice1712_set_pro_rate(ice, rate, 1); | ||
2902 | snd_ice1712_set_input_clock_source(ice, 0); | ||
2903 | } | ||
2904 | |||
2905 | outw(ice->pm_saved_spdif_ctrl, ICEMT(ice, ROUTE_SPDOUT)); | ||
2906 | outw(ice->pm_saved_route, ICEMT(ice, ROUTE_PSDOUT03)); | ||
2907 | |||
2871 | if (ice->ac97) | 2908 | if (ice->ac97) |
2872 | snd_ac97_resume(ice->ac97); | 2909 | snd_ac97_resume(ice->ac97); |
2873 | 2910 | ||