From 41c82efcb9db4819d061eafc7767b64faa961c9f Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 20 Apr 2021 11:48:56 +0800 Subject: [PATCH] i2s: fix driver uninstall issue --- components/driver/i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/driver/i2s.c b/components/driver/i2s.c index 01d05f499e..be1ea0efaa 100644 --- a/components/driver/i2s.c +++ b/components/driver/i2s.c @@ -821,7 +821,6 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co #if SOC_I2S_SUPPORT_PDM I2S_CHECK(!((i2s_config->mode & I2S_MODE_PDM) && (i2s_num != I2S_NUM_0)), "I2S DAC PDM only support on I2S0", ESP_ERR_INVALID_ARG); #endif - periph_module_enable(i2s_periph_signal[i2s_num].module); if(i2s_config->mode & I2S_MODE_ADC_BUILT_IN) { //in ADC built-in mode, we need to call i2s_set_adc_mode to @@ -977,6 +976,8 @@ esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num) } if(p_i2s_obj[i2s_num]->use_apll) { + // switch back to PLL clock source + i2s_hal_set_clock_sel(&(p_i2s_obj[i2s_num]->hal), I2S_CLK_D2CLK); rtc_clk_apll_enable(0, 0, 0, 0, 0); } #ifdef CONFIG_PM_ENABLE