]>
Commit | Line | Data |
---|---|---|
82094b55 AF |
1 | From: Takashi Iwai <tiwai@suse.de> |
2 | Subject: ALSA: hda - Add reboot notifier to each codec | |
3 | Patch-mainline: | |
4 | References: bnc#544779 | |
5 | ||
6 | Add reboot notifier to each codec so that it can do some workarounds | |
7 | needed for reboot. | |
8 | So far, patch_sigmatel.c calls its shutup routine for avoiding noises | |
9 | at reboot on some HP machines. | |
10 | ||
11 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
12 | ||
13 | --- | |
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(+) | |
19 | ||
20 | --- a/sound/pci/hda/hda_codec.c | |
21 | +++ b/sound/pci/hda/hda_codec.c | |
22 | @@ -3402,6 +3402,23 @@ | |
23 | array->list = NULL; | |
24 | } | |
25 | ||
26 | +/* call each reboot notifier */ | |
27 | +void snd_hda_bus_reboot_notify(struct hda_bus *bus) | |
28 | +{ | |
29 | + struct hda_codec *codec; | |
30 | + | |
31 | + if (!bus) | |
32 | + return; | |
33 | + list_for_each_entry(codec, &bus->codec_list, list) { | |
34 | +#ifdef CONFIG_SND_HDA_POWER_SAVE | |
35 | + if (!codec->power_on) | |
36 | + continue; | |
37 | +#endif | |
38 | + if (codec->patch_ops.reboot_notify) | |
39 | + codec->patch_ops.reboot_notify(codec); | |
40 | + } | |
41 | +} | |
42 | + | |
43 | /* | |
44 | * used by hda_proc.c and hda_eld.c | |
45 | */ | |
46 | --- a/sound/pci/hda/hda_codec.h | |
47 | +++ b/sound/pci/hda/hda_codec.h | |
48 | @@ -724,6 +724,7 @@ | |
49 | #ifdef CONFIG_SND_HDA_POWER_SAVE | |
50 | int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); | |
51 | #endif | |
52 | + void (*reboot_notify)(struct hda_codec *codec); | |
53 | }; | |
54 | ||
55 | /* record for amp information cache */ | |
56 | @@ -927,6 +928,7 @@ | |
57 | * Misc | |
58 | */ | |
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); | |
61 | ||
62 | /* | |
63 | * power management | |
64 | --- a/sound/pci/hda/hda_intel.c | |
65 | +++ b/sound/pci/hda/hda_intel.c | |
66 | @@ -2107,6 +2107,7 @@ | |
67 | static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf) | |
68 | { | |
69 | struct azx *chip = container_of(nb, struct azx, reboot_notifier); | |
70 | + snd_hda_bus_reboot_notify(chip->bus); | |
71 | azx_stop_chip(chip); | |
72 | return NOTIFY_OK; | |
73 | } | |
74 | --- a/sound/pci/hda/patch_sigmatel.c | |
75 | +++ b/sound/pci/hda/patch_sigmatel.c | |
76 | @@ -4517,6 +4517,7 @@ | |
77 | .suspend = stac92xx_suspend, | |
78 | .resume = stac92xx_resume, | |
79 | #endif | |
80 | + .reboot_notify = stac92xx_shutup, | |
81 | }; | |
82 | ||
83 | static int patch_stac9200(struct hda_codec *codec) |