/* Get higher or lower the codec volume level.  */
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume)
/* Get higher or lower the codec volume level.  */
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume)
{
  int32_t ret;
  uint8_t tmp;
  if (InputOutput != VOLUME_OUTPUT)
  {
    ret = CS42L51_ERROR;
  }
  else
  {
    ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &tmp, 1);
    *Volume = VOLUME_INVERT(tmp);
  }
  return ret;
}