ALSA: hda - Clean up async codec PM using standard async infrastructure

This simplifies lots of codes indeed.

Tested-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - skip depop delay before D3 for Haswell and Valleyview2 display codec

This patch skips the default depop delay before D3 for Haswell (10 ms) and
Valleyview2 (100 ms) display codec, to reduce codec suspend time.

The analog part of display audio is implemented in the external display. Some
displays have weak pop noise while others not when suspending, no matter there
is the default delay or not.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Allow capture-only configuration

We have blindly assumed that all valid configurations should have
either analog or digital playback, but there can be capture-only
configurations.  The parser shouldn't escape in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Add missing initialization of aamix paths

The loopback mixing paths aren't initialized correctly at init
callback.  Mostly this is harmless as codecs usually set the mute
state as default, but we still should make sure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Ignore small negative LPIB delay correction

Sometimes the hardware reports LPIB being advanced than POSBUF.
When this happens, the driver adjusts to a positive value by adding
the buffer size.  Then the driver detects it as an error (greater than
the period size), and stops the LPIB delay account from this point
on.

When I took a close look at these conditions, the values shown are all
very small numbers, and it'd be better to just ignore these values
instead of discontinuing the LPIB delay correction.

In this patch, the driver checks a negative delay value and ignores if
it's a significantly small error.  Currently the threshold is set to
64 frames, but could be smaller.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Enable stereo mix as default for AD and VIA codecs

AD and VIA codecs had stereo mixer input enabled as default before
moving to the generic parser, and people think the lack of such a
regression.  In this patch, the stereo mixer input is added back to
the input selection if no auto-mic is available, and if it's not
disabled explicitly via hint.  This should satisfy most of demands,
i.e. stereo mix on desktop machines like what it worked before, and it
still keeps the new auto-mic feature on laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Split verb definitions into sound/hda_verbs.h

Since there are more HD-audio compatible codecs, move the definitions
of HD-audio verbs into common header location, include/sound, so that
it can be included cleanly from other drivers than HD-audio driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>