At Fri, 5 Apr 2013 16:58:54 +0000, Lin, Mengdong wrote:
-----Original Message----- From: Takashi Iwai [mailto:tiwai@suse.de] Sent: Tuesday, April 02, 2013 5:53 PM To: Lin, Mengdong Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH] ALSA: hda - delay resume haswell hdmi codec in system resume
At Tue, 26 Mar 2013 07:02:54 +0000, Lin, Mengdong wrote:
Is it okay to add a new parameter to snd_hda_resume(), to indicate whether
codec resume should be delayed or not?
Is because snd_hda_resume() is only only called by azx_resume() but also
called by azx_bus_reset().
The latter can be called on a fatal verb execution failure and codec resume
delay is not suitable for this case.
Well, I prefer creating a new function (e.g. snd_hda_bus_reset()) called from azx_bus_reset().
Takashi
Hi Takashi,
Do you mean that in azx_bus_reset(), we can merge the snd_hda_suspend() and snd_hda_resume() to a new function like snd_hda_bus_reset()?
Yes. Calling snd_hda_suspend() following snd_hda_resume() immediately is just an ad hoc way of reset. It should have been a dedicated reset function from the beginning.
Takashi
snd_hda_suspend() and snd_hda_resume() look symmetrical here and so I don't want to destroy the symmetry.
static void azx_bus_reset(struct hda_bus *bus) { ... #ifdef CONFIG_PM if (chip->initialized) { struct azx_pcm *p; list_for_each_entry(p, &chip->pcm_list, list) snd_pcm_suspend_all(p->pcm); snd_hda_suspend(chip->bus); snd_hda_resume(chip->bus); } #endif bus->in_reset = 0; }
Thanks Mengdong