ASoC: es7202: provide configuration for i2c_bus_num/mic_max_channels

Configuration is flexible than hard code, and minimal changes.

Change-Id: I15835fcbf198252410feb3feb6080ca047388ce1
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Ziyuan Xu
2021-09-26 10:48:01 +08:00
committed by Tao Huang
parent 1ac27c2f80
commit f86904e7fe
2 changed files with 17 additions and 2 deletions

View File

@@ -607,6 +607,21 @@ config SND_SOC_ES7134
config SND_SOC_ES7202
tristate "Everest Semi ES7202 PDM 2CH ADC"
config SND_SOC_ES7202_MIC_MAX_CHANNELS
int "the maximum channels of es7202's microphone"
depends on SND_SOC_ES7202
default 4
range 2 16
help
Should be one of MIC_CHN_* of sound/soc/codecs/es7202.h.
config SND_SOC_ES7202_I2C_BUS
int "i2c bus number"
depends on SND_SOC_ES7202
default 1
help
Used to hard code an i2c bus number.
config SND_SOC_ES7210
tristate "Everest Semi ES7210 CODEC"
depends on I2C

View File

@@ -56,7 +56,7 @@
#define MIC_CHN_4 4
#define MIC_CHN_2 2
#define ES7202_CHANNELS_MAX MIC_CHN_4
#define ES7202_CHANNELS_MAX CONFIG_SND_SOC_ES7202_MIC_MAX_CHANNELS
#if ES7202_CHANNELS_MAX == MIC_CHN_2
#define ADC_DEV_MAXNUM 1
@@ -84,7 +84,7 @@
#endif
/* select I2C bus number for es7202 */
#define ES7202_I2C_BUS_NUM 1
#define ES7202_I2C_BUS_NUM CONFIG_SND_SOC_ES7202_I2C_BUS
/*
* select DTS or I2C Detect method for es7202