aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-11-10 10:02:29 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-10 10:02:29 -0500
commitfb8d1a344dbe963f16249d07eee8415e93f9f3c2 (patch)
tree710c945e207bbb3aa2998a4ce861dd302cb7d080
parent167eae5a17b3cd44a324dbb972c338e489413f54 (diff)
ALSA: hda - Add reboot notifier to each codec
Add reboot notifier to each codec so that it can do some workarounds needed for reboot. So far, patch_sigmatel.c calls its shutup routine for avoiding noises at reboot on some HP machines. References: Novell bnc#544779 http://bugzilla.novell.com/show_bug.cgi?id=544779 Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_codec.c17
-rw-r--r--sound/pci/hda/hda_codec.h2
-rw-r--r--sound/pci/hda/hda_intel.c1
-rw-r--r--sound/pci/hda/patch_sigmatel.c1
4 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 2c1366343335..146f95be8737 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3404,6 +3404,23 @@ static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid)
3404 } 3404 }
3405} 3405}
3406 3406
3407/* call each reboot notifier */
3408void snd_hda_bus_reboot_notify(struct hda_bus *bus)
3409{
3410 struct hda_codec *codec;
3411
3412 if (!bus)
3413 return;
3414 list_for_each_entry(codec, &bus->codec_list, list) {
3415#ifdef CONFIG_SND_HDA_POWER_SAVE
3416 if (!codec->power_on)
3417 continue;
3418#endif
3419 if (codec->patch_ops.reboot_notify)
3420 codec->patch_ops.reboot_notify(codec);
3421 }
3422}
3423
3407/* 3424/*
3408 * open the digital out in the exclusive mode 3425 * open the digital out in the exclusive mode
3409 */ 3426 */
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 99552fb5f756..624060837653 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -674,6 +674,7 @@ struct hda_codec_ops {
674#ifdef CONFIG_SND_HDA_POWER_SAVE 674#ifdef CONFIG_SND_HDA_POWER_SAVE
675 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); 675 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid);
676#endif 676#endif
677 void (*reboot_notify)(struct hda_codec *codec);
677}; 678};
678 679
679/* record for amp information cache */ 680/* record for amp information cache */
@@ -910,6 +911,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
910 * Misc 911 * Misc
911 */ 912 */
912void snd_hda_get_codec_name(struct hda_codec *codec, char *name, int namelen); 913void snd_hda_get_codec_name(struct hda_codec *codec, char *name, int namelen);
914void snd_hda_bus_reboot_notify(struct hda_bus *bus);
913 915
914/* 916/*
915 * power management 917 * power management
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 55c7da30bb61..0d3e0c9ea812 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2150,6 +2150,7 @@ static int azx_resume(struct pci_dev *pci)
2150static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf) 2150static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
2151{ 2151{
2152 struct azx *chip = container_of(nb, struct azx, reboot_notifier); 2152 struct azx *chip = container_of(nb, struct azx, reboot_notifier);
2153 snd_hda_bus_reboot_notify(chip->bus);
2153 azx_stop_chip(chip); 2154 azx_stop_chip(chip);
2154 return NOTIFY_OK; 2155 return NOTIFY_OK;
2155} 2156}
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 3087705a8e51..9c33700b21a8 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4831,6 +4831,7 @@ static struct hda_codec_ops stac92xx_patch_ops = {
4831 .suspend = stac92xx_suspend, 4831 .suspend = stac92xx_suspend,
4832 .resume = stac92xx_resume, 4832 .resume = stac92xx_resume,
4833#endif 4833#endif
4834 .reboot_notify = stac92xx_shutup,
4834}; 4835};
4835 4836
4836static int patch_stac9200(struct hda_codec *codec) 4837static int patch_stac9200(struct hda_codec *codec)