Fix audio route constraints

The audio route of I2S and Dumper are not independent.
The combination RX_I2S -> I2S and CODEC -> DUMPER is invalid because the
codec only accept one clock for input and output.

Refactor AudioRouteController and add a AudioRouteManager class to handle this
logic. Now AudioRouteController only provides basic route setter/getter
to access lower level registers.
AudioRouteManager is responsible for routing and serve CodecFlow and
InputFlow. AudioRouteManager raises exception when an invalid route is
requested.

Change the routing calls in InputFlow and CodecFlow to make sure route is
valid before audio action starts. Resets the route when the audio
action is stopped. Resets the route when chameleond resets.

BUG=chromium:437678
TEST=Change audio route by ./fpga asrc <aout|adump> <rx|rec|gen|str> command.
  run audio_AudioBasic* test.

Change-Id: I2015e1f980032562d3483c45db9bda35c8be70aa
Reviewed-on: https://chromium-review.googlesource.com/241909
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
6 files changed