/* Stops audio Codec playing. It powers down the codec.  */
uint32_t wm8994_Stop(uint16_t DeviceAddr, uint32_t CodecPdwnMode)
/* Stops audio Codec playing. It powers down the codec.  */
uint32_t wm8994_Stop(uint16_t DeviceAddr, uint32_t CodecPdwnMode)
{
  uint32_t counter = 0;
  if (outputEnabled != 0)
  {
    counter += wm8994_SetMute(DeviceAddr, AUDIO_MUTE_ON);
    if (CodecPdwnMode == CODEC_PDWN_SW)
    {
    }
    else
    {
      counter += CODEC_IO_Write(DeviceAddr, 0x420, 0x0200);
      counter += CODEC_IO_Write(DeviceAddr, 0x422, 0x0200);
      counter += CODEC_IO_Write(DeviceAddr, 0x2D, 0x0000);
      counter += CODEC_IO_Write(DeviceAddr, 0x2E, 0x0000);
      counter += CODEC_IO_Write(DeviceAddr, 0x05, 0x0000);
      counter += CODEC_IO_Write(DeviceAddr, 0x0000, 0x0000);
      outputEnabled = 0;
    }
  }
  return counter;
}