i9300: audio: fix battery drain after phone call

Change-Id: I12b038aeb3065eec335966674be14957170eb213
i9300: audio: hal update

fix issue where audio would stop working in or after call.

Change-Id: I1ad44e2621a30a01f1ebc63bd87eefdb695ff33c
i9300: audio: update hal

Brings the audio in line with i9305, n7100, n7105

Fixes various issues.
Only bug left now is audio stutter in real racing 3
which is probably due to the lovely hwcomposer.

Change-Id: I67b0df685e4175b248d2f75608c47cb2bfe85527
Merge "i9300: audio: hal update" into cm-11.0
Merge "i9300: audio: update hal" into cm-11.0
WIP: Just trying to get rid of routes with literals

... by using xml file instead.

Things changed:
- select_devices() is no more used. select_input_device() and select_output_device() now contain the relevant parts of select_devices() code.
- tiny_hw.xml file structure has been changed to add <route> element and attribute "mode" for <device> element.
- set_route_by_mode() added, in order to activate/deactivate routes when entering/leaving IN_CALL
- keep track of old input/output devices (i.e. last used), needed to deactivate old device mode
- added function tinymix_list_controls() copied from external/tinyalsa/tinymix.c and adapted for our needs
- added function control_state_clone() to clone the status of all controls
- added function control_state_apply() to apply a previously cloned status. For now, status after boot (adev_open()) is applied when leaving IN_CALL in order to find battery drain after call.
  So now, if there is battery drain, then the culprit should be the RIL.
- added lot of logcat debugging info. TODO - remove it or make it depend on a #define
- TODO: when done with XML handling of static routes, check TTY.
- Just as documentation, a good candidate for battery drain after call is out_set_parameters(), the part when select_output_device() is called. Somehow AUDIO_PARAMETER_STREAM_ROUTING
  points to AUDIO_DEVICE_OUT_EARPIECE, and setting this route, will leave control "RCV Switch" on, which can cause battery drain.
- Send SOUND_CLOCK_STOP to RIL when leaving IN_CALL