From afc09fb442dfa7227726bfbed2c439ae85e0e6ac Mon Sep 17 00:00:00 2001 From: Takayoshi Koizumi Date: Wed, 27 Apr 2022 21:56:39 +0900 Subject: [PATCH] drivers/audio/cxd56: Workaround for HW issue of CXD56 Because of HW issue, Audio output volume is limited until -30db as maximum. This commit fix it. And fix the bug of voulme control. --- drivers/audio/cxd56.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c index 6ecbdbb0f1..1aaf6a1ec9 100644 --- a/drivers/audio/cxd56.c +++ b/drivers/audio/cxd56.c @@ -62,8 +62,8 @@ #define CXD56_IRQ1_BIT_MIC (1 << 6) /* AU0 */ #define CXD56_IRQ1_BIT_I2S1 (1 << 7) /* AU1 */ -#define CXD56_VOL_MIN -1020 -#define CXD56_VOL_MAX 120 +#define CXD56_VOL_MIN (-1020) +#define CXD56_VOL_MAX (-30) #define CXD56_VOL_MUTE (CXD56_VOL_MIN - 1) #define CXD56_VOL_RANGE ((CXD56_VOL_MAX - CXD56_VOL_MIN) / 2) #define CXD56_VOL_NX_TO_CXD56(v) ((int)((float)((v) / 1000.0) * CXD56_VOL_RANGE) \ @@ -2733,8 +2733,8 @@ static int cxd56_configure(FAR struct audio_lowerhalf_s *lower, priv->volume = CXD56_VOL_NX_TO_CXD56(volume); cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_OUT, priv->volume); - cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN1, priv->volume); - cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN2, priv->volume); + cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN1, 0); + cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN2, 0); } else { @@ -2762,8 +2762,8 @@ static int cxd56_configure(FAR struct audio_lowerhalf_s *lower, else { cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_OUT, priv->volume); - cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN1, priv->volume); - cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN2, priv->volume); + cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN1, 0); + cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN2, 0); } if (CXD56_AUDIO_ECODE_OK != ret)