Skip to content

Commit 4e0a453

Browse files
audio: add ES7210 4-ch ADC codec driver
Add ES7210 audio ADC driver for NuttX implementing the audio lower-half interface. Supports 4-channel recording via I2S with configurable sample rate, bit depth, and mic gain. - drivers/audio/es7210.c: Codec driver using LPWORK for async buffer management, I2C register access, and NuttX audio buffer management - drivers/audio/es7210.h: Internal register definitions and macros - include/nuttx/audio/es7210.h: Public header with platform config structure and es7210_initialize() API - drivers/audio/Kconfig, Make.defs, CMakeLists.txt: Build system integration for CONFIG_AUDIO_ES7210 Key implementation details: - ES7210_SDP_NORMAL (normal I2S) instead of TDM, matching NuttX I2S standard Philips mode - ES7210_ADC_PGA_POWER_ON bit in gain registers REG43-46, required for analog front-end amplifier power-on - 50ms startup delay in es7210_start for codec clock stabilization - I2S_IOCTL(AUDIOIOC_STOP) in es7210_stop to notify I2S layer, preventing DMA from running without buffers after stop Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
1 parent acb65c9 commit 4e0a453

6 files changed

Lines changed: 1333 additions & 0 deletions

File tree

drivers/audio/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ if(CONFIG_DRIVERS_AUDIO)
4343
list(APPEND SRCS cs4344.c)
4444
endif()
4545

46+
if(CONFIG_AUDIO_ES7210)
47+
list(APPEND SRCS es7210.c)
48+
endif()
49+
4650
if(CONFIG_AUDIO_ES8311)
4751
list(APPEND SRCS es8311.c)
4852
if(CONFIG_ES8311_REGDUMP)

drivers/audio/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,33 @@ config CS4344_WORKER_STACKSIZE
169169

170170
endif # AUDIO_CS4344
171171

172+
config AUDIO_ES7210
173+
bool "ES7210 ADC codec chip"
174+
default n
175+
depends on AUDIO
176+
---help---
177+
Select to enable support for the ES7210 4-channel ADC codec by
178+
Everest Semiconductor.
179+
180+
NOTE: This driver also depends on both I2C and I2S support although
181+
that dependency is not explicit here.
182+
183+
if AUDIO_ES7210
184+
185+
config ES7210_INFLIGHT
186+
int "ES7210 maximum in-flight audio buffers"
187+
default 2
188+
189+
config ES7210_BUFFER_SIZE
190+
int "ES7210 preferred buffer size"
191+
default 8192
192+
193+
config ES7210_NUM_BUFFERS
194+
int "ES7210 preferred number of buffers"
195+
default 4
196+
197+
endif # AUDIO_ES7210
198+
172199
config AUDIO_ES8311
173200
bool "ES8311 codec chip"
174201
default n

drivers/audio/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ ifeq ($(CONFIG_AUDIO_CS4344),y)
4343
CSRCS += cs4344.c
4444
endif
4545

46+
ifeq ($(CONFIG_AUDIO_ES7210),y)
47+
CSRCS += es7210.c
48+
endif
49+
4650
ifeq ($(CONFIG_AUDIO_ES8311),y)
4751
CSRCS += es8311.c
4852
ifeq ($(CONFIG_ES8311_REGDUMP),y)

0 commit comments

Comments
 (0)