audio: Enhance ALSA for USB Dock Audio support

Needed for http://review.cyanogenmod.org/#/c/30481/

Change-Id: I5558f84ea4a158338bad128090f4cf49a6a079d1
alsa_sound: Add support for Audience A2220

Change-Id: Iec6d384feef11fb23b1cbacc686d065085bd8a11
alsa_sound: Fix separated audio input support

 * Fix declarations for QCOM's refactoring.
 * Allow enablement via board flags.

Change-Id: I162d6f1d9a955df2dd9f4e47fb04b081664fcaf4
audio: Dynamic library loading, compilation fixes.

Squashed commit of the following:

  commit 45b2a0b5e2344ead1413d627875bf10f79e15163
  Author: Steve Kondik <shade@chemlab.org>
  Date:   Sun Dec 23 04:50:52 2012 -0800

      audio: Dynamic library loading, compilation fixes.

      Change-Id: I04d5e7b96611572a7758c610ebdf0fd00e8346aa

  commit 2c78505b30f2362295e4a995039abf2c650f0d7f
  Author: Mike Kasick <mike@kasick.org>
  Date:   Tue Jan 8 10:31:51 2013 -0500

      alsa_sound: Add missing assignment of acdb_handle, fixes in-call volume

      Assigns AudioHardwareALSA::mUcMgr->acdb_handle to mAcdbHandle, which is
      missing in the port of dynamic library loading from the AOSP/mako HAL
      (I04d5e7b96611572a7758c610ebdf0fd00e8346aa).

      Restores acdb_send_voice_cal and acdb_send_audio_cal calls, which among
      other things, are required for in-call volume adjustment to function.

Change-Id: I5b991a0be410af5eaff133625b63504545d7aa86
alsa: fix platform detection for m7 devices

Change-Id: I4e6a884f5905d53acd85cf4a8386f8374e99266e
alsa_sound: Allow SPEAKER_DUAL_MIC_* UCMs with USES_FLUENCE_INCALL

Enables SND_USE_CASE_DEV_SPEAKER_DUAL_MIC_* UCMs when using speakerphone
with USES_FLUENCE_INCALL defined.  This allows devices to use different
DMIC settings for earpiece and speakerphone modes.

Devices that wish to retain the old behavior should clone the DUAL_MIC_*
UCMs for SPEAKER_DUAL_MIC_*.
alsa_sound: Add option to use seperated speakerphone device

 * Enable use of this with BOARD_USEDS_SEPERATED_VOICE_SPEAKER

Change-Id: I3fb8f8c97c4116ce9717165878d63483e2facb06
alsa_sound: Disable verbose logging

 * Kill the logspam.

Change-Id: I121cddb04c613e03a95b751b7c2fc86a46b89bd4
alsa_sound: fix debug message derp

Change-Id: Id64e7c8fa04cafa57f422558c5aa84a21127b88f
alsa_sound: Support ES325 2Mic and Samsung CSD client

 * The dual mic feature on the Audience ES325 needs to be enabled via
   csd-client on the Galaxy S4. Add support for this.
 * Samsung is using a non-standard name for the functions in csd-client.
   Add support for this.

Change-Id: I764ead9ea17729055da701a423edec97d96b8319
alsa_sound: add HTC CSD CLIENT board flag for special cases (BT)

New HTC phones like m7 have special settings for BTSco CSD device
ids. Adding board flag BOARD_HAVE_HTC_CSDCLIENT to handle
these special cases related to HTC's csd client.

Change-Id: Iae3cb4568c0d1d6b5d75cef7a836d78ab3fa9522
alsa_sound: modify the SPEAKER_RX_ACDB to support both MONO and STEREO speaker

Change-Id: Iea7d8d5cdb7b04b347be84343f5bd44caeb51609
alsa_sound: Add support for seperated VOIP devices

 * Similar to the VOC devices tuned for voice calls, some new devices
   are using VOIP devices tuned for SIP and Hangouts.
 * Enable with BOARD_USES_SEPERATED_VOIP

Change-Id: I3a49be26ca2ad3e1aafb8b0960935ac8c735fe51
alsa_sound: Add support for seperated headset mic devices

 * Some recent devices such as the Galaxy S4 use dedicated 3-pole
 * headset mic devices while in-call.
 * This also supports the seperated VOIP headset mic device.
 * Only engage the ES325 dualmic for speaker/earpiece usecases.

Change-Id: I1c0b01a9df70fbb7364ba69004aa7828e3f1f01c
alsa_sound: Add support for VR-on-wired-headset device

Change-Id: Ib206649194794f46480b7f87eaeb9e3fdb0df1b1
audio: provide a hook for audio amplifier implementations

Example: http://review.cyanogenmod.org/#/c/38221

Change-Id: Ib236598a5888b2af19bcfb81e285f644a0e84c0d
alsa_sound: Trigger immediate doRouting() on setMode() change to normal

On call hangup, this normally happens as consequence of
a setParameter call shortly after the change of mode.
However, if a stream write occurs between the mode change
and setParameter, AudioStreamOutALSA::write calls route()
which then laters causes doRouting() not to deroute voice
properly.

By triggering an immediate doRouting() on a setMode change
to normal, we remove this window of opportunity for voice
derouting to fail.

Resolves calls with mute audio on jf.  This could
theoretically show up on other platforms if the
timing conditions are right.

Change-Id: I90e98596dcb42a0b4b164fc27790c39349ea777c
alsa_sound: Untangle VOIP/voice speaker handling

Change-Id: Ieedac3af120a08f567a6575fdb06e6e22946307d
alsa_sound: Allow dual-mic device to be used for VOIP calls

Change-Id: I7a4a79a1c48bd082be8d5163fa8978bca4421390
alsa_sound: Improve USB device detection

 * Samsung's proprietary dock was hijacking the routing when a USB audio
   device such as a DAC was connected in host mode.
 * Instead of blindly shoving stuff down a route that doesn't work for
   the dock case, check the switch in sysfs for the proprietary dock
   first.
 * Remove the DOCK_USBAUDIO define entirely and just wrap it up with
   everything else that SAMSUNG_AUDIO includes.

Change-Id: Id9ea2641b67c68a8b38d24aae88b186ee6e991f0