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

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.

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

Change-Id: I2015e1f980032562d3483c45db9bda35c8be70aa
Reviewed-by: Cheng-Yi Chiang <>
Commit-Queue: Cheng-Yi Chiang <>
Tested-by: Cheng-Yi Chiang <>
6 files changed