1 From: Takashi Iwai <tiwai@suse.de>
2 Subject: ALSA: hda - Add reboot notifier to each codec
6 Add reboot notifier to each codec so that it can do some workarounds
8 So far, patch_sigmatel.c calls its shutup routine for avoiding noises
9 at reboot on some HP machines.
11 Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 sound/pci/hda/hda_codec.c | 17 +++++++++++++++++
15 sound/pci/hda/hda_codec.h | 2 ++
16 sound/pci/hda/hda_intel.c | 1 +
17 sound/pci/hda/patch_sigmatel.c | 1 +
18 4 files changed, 21 insertions(+)
20 --- a/sound/pci/hda/hda_codec.c
21 +++ b/sound/pci/hda/hda_codec.c
22 @@ -3402,6 +3402,23 @@
26 +/* call each reboot notifier */
27 +void snd_hda_bus_reboot_notify(struct hda_bus *bus)
29 + struct hda_codec *codec;
33 + list_for_each_entry(codec, &bus->codec_list, list) {
34 +#ifdef CONFIG_SND_HDA_POWER_SAVE
35 + if (!codec->power_on)
38 + if (codec->patch_ops.reboot_notify)
39 + codec->patch_ops.reboot_notify(codec);
44 * used by hda_proc.c and hda_eld.c
46 --- a/sound/pci/hda/hda_codec.h
47 +++ b/sound/pci/hda/hda_codec.h
49 #ifdef CONFIG_SND_HDA_POWER_SAVE
50 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid);
52 + void (*reboot_notify)(struct hda_codec *codec);
55 /* record for amp information cache */
59 void snd_hda_get_codec_name(struct hda_codec *codec, char *name, int namelen);
60 +void snd_hda_bus_reboot_notify(struct hda_bus *bus);
64 --- a/sound/pci/hda/hda_intel.c
65 +++ b/sound/pci/hda/hda_intel.c
67 static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
69 struct azx *chip = container_of(nb, struct azx, reboot_notifier);
70 + snd_hda_bus_reboot_notify(chip->bus);
74 --- a/sound/pci/hda/patch_sigmatel.c
75 +++ b/sound/pci/hda/patch_sigmatel.c
77 .suspend = stac92xx_suspend,
78 .resume = stac92xx_resume,
80 + .reboot_notify = stac92xx_shutup,
83 static int patch_stac9200(struct hda_codec *codec)