From 3828dd2b1190b2a2d60bf9071915160c7e4c2648 Mon Sep 17 00:00:00 2001 From: Tobias Johansson Date: Wed, 17 Nov 2021 13:38:28 +0100 Subject: [PATCH] drivers: audio: Only start amp for HS in cxd56 Only enable the amplifier during playback to avoid clicks. Signed-off-by: Tobias Johansson --- drivers/audio/cxd56.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c index 753ff3cfef..7cb9bb3fa1 100644 --- a/drivers/audio/cxd56.c +++ b/drivers/audio/cxd56.c @@ -3267,11 +3267,14 @@ static int cxd56_start_dma(FAR struct cxd56_dev_s *dev) if (dev->state != CXD56_DEV_STATE_STARTED) { - /* Turn on amplifier */ + if (dev->dma_handle == CXD56_AUDIO_DMA_I2S0_DOWN) + { + /* Turn on amplifier */ - spin_unlock_irqrestore(&dev->lock, flags); - board_external_amp_mute_control(false); - flags = spin_lock_irqsave(&dev->lock); + spin_unlock_irqrestore(&dev->lock, flags); + board_external_amp_mute_control(false); + flags = spin_lock_irqsave(&dev->lock); + } /* Mask interrupts */