/* Enables or disables the mute feature on the audio codec.  */
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd)
/* Enables or disables the mute feature on the audio codec.  */
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd)
{
  int32_t ret;
  uint8_t tmp;
  ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
  if (Cmd == CS42L51_MUTE_ON)
  {
    tmp |= 0x03U;
  }
  else
  {
    tmp &= 0xFCU;
  }
  ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
  if (ret != CS42L51_OK)
  {
    ret = CS42L51_ERROR;
  }
  return ret;
}