aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-19 15:25:27 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-19 15:25:27 -0500
commit87af0b80c933f05a4c7dd8c5edebe10365e76220 (patch)
tree6c33ab1a47b5f1ef196e8847586fb81b17152a0e /sound/pci
parent08a978db518dfceb37998bc74a7fed03540cfd08 (diff)
parent2ea3c6a2c779e5a6487d2b436770232162dfbbe3 (diff)
Merge branch 'for-linus' into for-next
Merge the recent HD-audio codec change for fixing recursive suspend calls. Conflicts: sound/pci/hda/hda_codec.c
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/es1968.c11
-rw-r--r--sound/pci/fm801.c11
-rw-r--r--sound/pci/hda/hda_codec.c11
-rw-r--r--sound/pci/hda/hda_codec.h1
-rw-r--r--sound/pci/hda/hda_intel.c39
-rw-r--r--sound/pci/hda/patch_realtek.c1
6 files changed, 47 insertions, 27 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 50169bcfd903..7266020c16cb 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2581,9 +2581,14 @@ static u8 snd_es1968_tea575x_get_pins(struct snd_tea575x *tea)
2581 struct es1968 *chip = tea->private_data; 2581 struct es1968 *chip = tea->private_data;
2582 unsigned long io = chip->io_port + GPIO_DATA; 2582 unsigned long io = chip->io_port + GPIO_DATA;
2583 u16 val = inw(io); 2583 u16 val = inw(io);
2584 2584 u8 ret;
2585 return (val & STR_DATA) ? TEA575X_DATA : 0 | 2585
2586 (val & STR_MOST) ? TEA575X_MOST : 0; 2586 ret = 0;
2587 if (val & STR_DATA)
2588 ret |= TEA575X_DATA;
2589 if (val & STR_MOST)
2590 ret |= TEA575X_MOST;
2591 return ret;
2587} 2592}
2588 2593
2589static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool output) 2594static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool output)
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index cc2e91d15538..c5806f89be1e 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -767,9 +767,14 @@ static u8 snd_fm801_tea575x_get_pins(struct snd_tea575x *tea)
767 struct fm801 *chip = tea->private_data; 767 struct fm801 *chip = tea->private_data;
768 unsigned short reg = inw(FM801_REG(chip, GPIO_CTRL)); 768 unsigned short reg = inw(FM801_REG(chip, GPIO_CTRL));
769 struct snd_fm801_tea575x_gpio gpio = *get_tea575x_gpio(chip); 769 struct snd_fm801_tea575x_gpio gpio = *get_tea575x_gpio(chip);
770 770 u8 ret;
771 return (reg & FM801_GPIO_GP(gpio.data)) ? TEA575X_DATA : 0 | 771
772 (reg & FM801_GPIO_GP(gpio.most)) ? TEA575X_MOST : 0; 772 ret = 0;
773 if (reg & FM801_GPIO_GP(gpio.data))
774 ret |= TEA575X_DATA;
775 if (reg & FM801_GPIO_GP(gpio.most))
776 ret |= TEA575X_MOST;
777 return ret;
773} 778}
774 779
775static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output) 780static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index a8e7b00fe90d..d9fd439209df 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -228,7 +228,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
228 } 228 }
229 mutex_unlock(&bus->cmd_mutex); 229 mutex_unlock(&bus->cmd_mutex);
230 snd_hda_power_down(codec); 230 snd_hda_power_down(codec);
231 if (res && *res == -1 && bus->rirb_error) { 231 if (!codec->in_pm && res && *res == -1 && bus->rirb_error) {
232 if (bus->response_reset) { 232 if (bus->response_reset) {
233 snd_printd("hda_codec: resetting BUS due to " 233 snd_printd("hda_codec: resetting BUS due to "
234 "fatal communication error\n"); 234 "fatal communication error\n");
@@ -238,7 +238,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
238 goto again; 238 goto again;
239 } 239 }
240 /* clear reset-flag when the communication gets recovered */ 240 /* clear reset-flag when the communication gets recovered */
241 if (!err) 241 if (!err || codec->in_pm)
242 bus->response_reset = 0; 242 bus->response_reset = 0;
243 return err; 243 return err;
244} 244}
@@ -3655,6 +3655,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
3655{ 3655{
3656 unsigned int state; 3656 unsigned int state;
3657 3657
3658 codec->in_pm = 1;
3659
3658 if (codec->patch_ops.suspend) 3660 if (codec->patch_ops.suspend)
3659 codec->patch_ops.suspend(codec); 3661 codec->patch_ops.suspend(codec);
3660 hda_cleanup_all_streams(codec); 3662 hda_cleanup_all_streams(codec);
@@ -3669,6 +3671,7 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
3669 codec->power_transition = 0; 3671 codec->power_transition = 0;
3670 codec->power_jiffies = jiffies; 3672 codec->power_jiffies = jiffies;
3671 spin_unlock(&codec->power_lock); 3673 spin_unlock(&codec->power_lock);
3674 codec->in_pm = 0;
3672 return state; 3675 return state;
3673} 3676}
3674 3677
@@ -3677,6 +3680,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
3677 */ 3680 */
3678static void hda_call_codec_resume(struct hda_codec *codec) 3681static void hda_call_codec_resume(struct hda_codec *codec)
3679{ 3682{
3683 codec->in_pm = 1;
3684
3680 /* set as if powered on for avoiding re-entering the resume 3685 /* set as if powered on for avoiding re-entering the resume
3681 * in the resume / power-save sequence 3686 * in the resume / power-save sequence
3682 */ 3687 */
@@ -3700,6 +3705,8 @@ static void hda_call_codec_resume(struct hda_codec *codec)
3700 snd_hda_jack_set_dirty_all(codec); 3705 snd_hda_jack_set_dirty_all(codec);
3701 snd_hda_jack_report_sync(codec); 3706 snd_hda_jack_report_sync(codec);
3702 } 3707 }
3708
3709 codec->in_pm = 0;
3703 snd_hda_power_down(codec); /* flag down before returning */ 3710 snd_hda_power_down(codec); /* flag down before returning */
3704} 3711}
3705#endif /* CONFIG_PM */ 3712#endif /* CONFIG_PM */
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index baad7bf6133b..8665540e55aa 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -871,6 +871,7 @@ struct hda_codec {
871 unsigned int power_on :1; /* current (global) power-state */ 871 unsigned int power_on :1; /* current (global) power-state */
872 unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */ 872 unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */
873 unsigned int pm_down_notified:1; /* PM notified to controller */ 873 unsigned int pm_down_notified:1; /* PM notified to controller */
874 unsigned int in_pm:1; /* suspend/resume being performed */
874 int power_transition; /* power-state in transition */ 875 int power_transition; /* power-state in transition */
875 int power_count; /* current (global) power refcount */ 876 int power_count; /* current (global) power refcount */
876 struct delayed_work power_work; /* delayed task for powerdown */ 877 struct delayed_work power_work; /* delayed task for powerdown */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 2cc07c184d31..83be8550707a 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -568,6 +568,12 @@ enum {
568#define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */ 568#define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */
569#define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */ 569#define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */
570#define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */ 570#define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */
571#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */
572
573/* quirks for Intel PCH */
574#define AZX_DCAPS_INTEL_PCH \
575 (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \
576 AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_PM_RUNTIME)
571 577
572/* quirks for ATI SB / AMD Hudson */ 578/* quirks for ATI SB / AMD Hudson */
573#define AZX_DCAPS_PRESET_ATI_SB \ 579#define AZX_DCAPS_PRESET_ATI_SB \
@@ -2553,6 +2559,9 @@ static void azx_power_notify(struct hda_bus *bus, bool power_up)
2553{ 2559{
2554 struct azx *chip = bus->private_data; 2560 struct azx *chip = bus->private_data;
2555 2561
2562 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
2563 return;
2564
2556 if (power_up) 2565 if (power_up)
2557 pm_runtime_get_sync(&chip->pci->dev); 2566 pm_runtime_get_sync(&chip->pci->dev);
2558 else 2567 else
@@ -2668,7 +2677,8 @@ static int azx_runtime_suspend(struct device *dev)
2668 struct snd_card *card = dev_get_drvdata(dev); 2677 struct snd_card *card = dev_get_drvdata(dev);
2669 struct azx *chip = card->private_data; 2678 struct azx *chip = card->private_data;
2670 2679
2671 if (!power_save_controller) 2680 if (!power_save_controller ||
2681 !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
2672 return -EAGAIN; 2682 return -EAGAIN;
2673 2683
2674 azx_stop_chip(chip); 2684 azx_stop_chip(chip);
@@ -3549,39 +3559,30 @@ static void __devexit azx_remove(struct pci_dev *pci)
3549static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { 3559static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
3550 /* CPT */ 3560 /* CPT */
3551 { PCI_DEVICE(0x8086, 0x1c20), 3561 { PCI_DEVICE(0x8086, 0x1c20),
3552 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3562 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3553 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3554 /* PBG */ 3563 /* PBG */
3555 { PCI_DEVICE(0x8086, 0x1d20), 3564 { PCI_DEVICE(0x8086, 0x1d20),
3556 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3565 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3557 AZX_DCAPS_BUFSIZE},
3558 /* Panther Point */ 3566 /* Panther Point */
3559 { PCI_DEVICE(0x8086, 0x1e20), 3567 { PCI_DEVICE(0x8086, 0x1e20),
3560 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3568 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3561 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3562 /* Lynx Point */ 3569 /* Lynx Point */
3563 { PCI_DEVICE(0x8086, 0x8c20), 3570 { PCI_DEVICE(0x8086, 0x8c20),
3564 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3571 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3565 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3566 /* Lynx Point-LP */ 3572 /* Lynx Point-LP */
3567 { PCI_DEVICE(0x8086, 0x9c20), 3573 { PCI_DEVICE(0x8086, 0x9c20),
3568 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3574 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3569 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3570 /* Lynx Point-LP */ 3575 /* Lynx Point-LP */
3571 { PCI_DEVICE(0x8086, 0x9c21), 3576 { PCI_DEVICE(0x8086, 0x9c21),
3572 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3577 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
3573 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3574 /* Haswell */ 3578 /* Haswell */
3575 { PCI_DEVICE(0x8086, 0x0c0c), 3579 { PCI_DEVICE(0x8086, 0x0c0c),
3576 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3580 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
3577 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3578 { PCI_DEVICE(0x8086, 0x0d0c), 3581 { PCI_DEVICE(0x8086, 0x0d0c),
3579 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3582 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
3580 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3581 /* 5 Series/3400 */ 3583 /* 5 Series/3400 */
3582 { PCI_DEVICE(0x8086, 0x3b56), 3584 { PCI_DEVICE(0x8086, 0x3b56),
3583 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3585 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
3584 AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3585 /* SCH */ 3586 /* SCH */
3586 { PCI_DEVICE(0x8086, 0x811b), 3587 { PCI_DEVICE(0x8086, 0x811b),
3587 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3588 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index fe99176a35f1..4d2685269946 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5412,6 +5412,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
5412 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), 5412 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
5413 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), 5413 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
5414 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), 5414 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO),
5415 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
5415 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 5416 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
5416 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 5417 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
5417 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), 5418 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF),