Files
nuttx/drivers/audio/Make.defs
T
wangjianyu3 5ba0d062b1 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>
2026-04-03 13:34:36 +08:00

116 lines
2.4 KiB
Plaintext

############################################################################
# drivers/audio/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
# Include Audio drivers
ifeq ($(CONFIG_DRIVERS_AUDIO),y)
ifeq ($(CONFIG_AUDIO_VS1053),y)
CSRCS += vs1053.c
endif
ifeq ($(CONFIG_AUDIO_CS43L22),y)
CSRCS += cs43l22.c
ifeq ($(CONFIG_CS43L22_REGDUMP),y)
CSRCS += cs43l22_debug.c
else
ifeq ($(CONFIG_CS43L22_CLKDEBUG),y)
CSRCS += cs43l22_debug.c
endif
endif
endif
ifeq ($(CONFIG_AUDIO_CS4344),y)
CSRCS += cs4344.c
endif
ifeq ($(CONFIG_AUDIO_ES7210),y)
CSRCS += es7210.c
endif
ifeq ($(CONFIG_AUDIO_ES8311),y)
CSRCS += es8311.c
ifeq ($(CONFIG_ES8311_REGDUMP),y)
CSRCS += es8311_debug.c
endif
endif
ifeq ($(CONFIG_AUDIO_ES8388),y)
CSRCS += es8388.c
ifeq ($(CONFIG_ES8388_REGDUMP),y)
CSRCS += es8388_debug.c
endif
endif
ifeq ($(CONFIG_AUDIO_WM8994),y)
CSRCS += wm8994.c
ifeq ($(CONFIG_WM8994_REGDUMP),y)
CSRCS += wm8994_debug.c
else
ifeq ($(CONFIG_WM8994_CLKDEBUG),y)
CSRCS += wm8994_debug.c
endif
endif
endif
ifeq ($(CONFIG_AUDIO_WM8904),y)
CSRCS += wm8904.c
ifeq ($(CONFIG_WM8904_REGDUMP),y)
CSRCS += wm8904_debug.c
else
ifeq ($(CONFIG_WM8904_CLKDEBUG),y)
CSRCS += wm8904_debug.c
endif
endif
endif
ifeq ($(CONFIG_AUDIO_WM8776),y)
CSRCS += wm8776.c
endif
ifeq ($(CONFIG_AUDIO_NULL),y)
CSRCS += audio_null.c
endif
ifeq ($(CONFIG_AUDIO_FAKE),y)
CSRCS += audio_fake.c
endif
ifeq ($(CONFIG_AUDIO_TONE),y)
CSRCS += tone.c
endif
ifeq ($(CONFIG_AUDIO_I2S),y)
CSRCS += audio_i2s.c
endif
ifeq ($(CONFIG_AUDIO_DMA),y)
CSRCS += audio_dma.c
endif
# Include Audio driver support
DEPPATH += --dep-path audio
VPATH += :audio
endif