cxd56: disable unused audio effects

Disables audio effects that are not currently in use.
Also fixes some minor indentation issues.
This commit is contained in:
Tobias Johansson 2020-04-17 15:42:31 +02:00 committed by patacongo
parent d9d720b296
commit 7a83177419
1 changed files with 37 additions and 35 deletions

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* drivers/audio/cxd56.h * drivers/audio/cxd56.c
* *
* Copyright 2019 Sony Semiconductor Solutions Corporation * Copyright 2019 Sony Semiconductor Solutions Corporation
* *
@ -1321,8 +1321,27 @@ static uint32_t cxd56_power_on(FAR struct cxd56_dev_s *dev)
write_reg(REG_I2S_ENSEL, (dev->samplerate > 48000) ? 1 : 0); write_reg(REG_I2S_ENSEL, (dev->samplerate > 48000) ? 1 : 0);
/* TODO: alc, cstereo, dnc, deq, vol & datapath (reset mic */ /* Disable DEQ */
write_reg(REG_AC_DEQ_EN, 0);
/* Disable DNC. */
write_reg(REG_AC_DNC1_MUTE, 1);
write_reg(REG_AC_DNC2_MUTE, 1);
write_reg(REG_AC_DNC1_START, 0);
write_reg(REG_AC_DNC2_START, 0);
/* Disable ALC/SPC */
write_reg(REG_AC_ALC_EN, 0);
write_reg(REG_AC_SPC_EN, 0);
/* Disable Clear Stereo */
write_reg(REG_AC_CS_SIGN, 0);
write_reg(REG_AC_CS_VOL, 0x00);
/* Attach interrupts */
cxd56_attach_irq(true); cxd56_attach_irq(true);
cxd56_enable_irq(true); cxd56_enable_irq(true);
} }
@ -1337,25 +1356,10 @@ static uint32_t cxd56_power_off(FAR struct cxd56_dev_s *dev)
{ {
audinfo("cxd56_power_off\n"); audinfo("cxd56_power_off\n");
/* Codec block. */
/* Disable AHBMASTER. */ /* Disable AHBMASTER. */
write_reg(REG_AC_MCK_AMBMSTR_EN, 0); write_reg(REG_AC_MCK_AMBMSTR_EN, 0);
/* Disable CODEC. */
write_reg(REG_AC_ALC_EN, 0);
write_reg(REG_AC_SPC_EN, 0);
write_reg(REG_AC_DEQ_EN, 0);
/* Disable DNC. */
write_reg(REG_AC_DNC1_MUTE, 1);
write_reg(REG_AC_DNC2_MUTE, 1);
write_reg(REG_AC_DNC1_START, 0);
write_reg(REG_AC_DNC2_START, 0);
/* Disable SRC. */ /* Disable SRC. */
write_reg(REG_AC_SDIN1_EN, 0); write_reg(REG_AC_SDIN1_EN, 0);
@ -1387,8 +1391,6 @@ static uint32_t cxd56_power_off(FAR struct cxd56_dev_s *dev)
write_reg(REG_AC_PDN_DNC2, 1); write_reg(REG_AC_PDN_DNC2, 1);
write_reg(REG_AC_PDN_ANC, 1); write_reg(REG_AC_PDN_ANC, 1);
/* Analog block. */
/* Disable audio clock */ /* Disable audio clock */
cxd56_audio_clock_disable(); cxd56_audio_clock_disable();