ALSA: hda/cirrus - Fix the digital beep registration

The argument passed to snd_hda_attach_beep_device() is a widget NID
while spec->beep_amp holds the composed value for amp controls.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus' into for-next

Back-merged for refactoring beep stuff.
ALSA: hda - Move beep attach/detach calls in hda_generic.c

Instead of calling snd_hda_attach_beep_device() and
snd_hda_detach_beep_device() in each codec driver, move them to the
generic parser.  The codec driver just needs to set spec->beep_nid for
activating the digital beep.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix power-saving during playing beep sound

While playing the digital beep tone, the codec shouldn't be turned
off.  This patch adds proper snd_hda_power_up()/down() calls at each
time when the beep is played or off.

Also, this fixes automatically an unnecessary codec power-up at
detaching the beep device when the beep isn't being played.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Make the resume of digital beep setup proper

The verb to set up the digital beep via AC_VERB_SET_DIGI_CONVERT_2
should be executed at resume as well.  Use the cached write for it
being performed automatically at resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-next'