mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
drivers: audio: dmic: Add support for nRF PDM peripherals
Add a shim that allows using the nrfx PDM driver via the Zephyr API. Add also missing devicetree nodes representing the PDM peripherals in the nRF52 Series SoCs. Extend the "nordic,nrf-pdm" binding with a new property that allows specifying the clock source to be used by the PDM peripheral (so that it is possible to use HFXO for better accuracy of the peripheral clock or, in the nRF53 Series SoCs, to use the dedicated audio oscillator). Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
committed by
Anas Nashif
parent
25f5601563
commit
1bf7c391b8
@@ -190,6 +190,7 @@
|
||||
/drivers/*/*andes* @cwshu @Teng-Shih-Wei
|
||||
/drivers/adc/ @anangl
|
||||
/drivers/adc/adc_stm32.c @cybertale
|
||||
/drivers/audio/*nrfx* @anangl
|
||||
/drivers/bbram/* @yperess @sjg20 @jackrosenthal
|
||||
/drivers/bluetooth/ @joerchan @jhedberg @Vudentz
|
||||
/drivers/cache/ @carlocaione
|
||||
|
||||
@@ -15,3 +15,4 @@ zephyr_library_sources_ifdef(CONFIG_AUDIO_INTEL_DMIC decimation/pdm_decim_int32_
|
||||
zephyr_library_sources_ifdef(CONFIG_AUDIO_INTEL_DMIC decimation/pdm_decim_table.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_AUDIO_MPXXDTYY mpxxdtyy.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_AUDIO_MPXXDTYY mpxxdtyy-i2s.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_AUDIO_DMIC_NRFX_PDM dmic_nrfx_pdm.c)
|
||||
|
||||
@@ -52,6 +52,7 @@ source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
source "drivers/audio/Kconfig.intel_dmic"
|
||||
source "drivers/audio/Kconfig.mpxxdtyy"
|
||||
source "drivers/audio/Kconfig.dmic_pdm_nrfx"
|
||||
|
||||
endif # AUDIO_DMIC
|
||||
|
||||
|
||||
13
drivers/audio/Kconfig.dmic_pdm_nrfx
Normal file
13
drivers/audio/Kconfig.dmic_pdm_nrfx
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Workaround for not being able to have commas in macro arguments
|
||||
DT_COMPAT_NORDIC_NRF_PDM := nordic,nrf-pdm
|
||||
|
||||
config AUDIO_DMIC_NRFX_PDM
|
||||
bool "nRF PDM nrfx driver"
|
||||
depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_PDM))
|
||||
default y
|
||||
select NRFX_PDM
|
||||
help
|
||||
Enable support for nrfx PDM driver for nRF MCU series.
|
||||
575
drivers/audio/dmic_nrfx_pdm.c
Normal file
575
drivers/audio/dmic_nrfx_pdm.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -226,6 +226,14 @@
|
||||
#pwm-cells = <1>;
|
||||
};
|
||||
|
||||
pdm0: pdm@4001d000 {
|
||||
compatible = "nordic,nrf-pdm";
|
||||
reg = <0x4001d000 0x1000>;
|
||||
interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
|
||||
status = "disabled";
|
||||
label = "PDM_0";
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@4001e000 {
|
||||
compatible = "nordic,nrf52-flash-controller";
|
||||
reg = <0x4001e000 0x1000>;
|
||||
|
||||
@@ -249,6 +249,14 @@
|
||||
#pwm-cells = <1>;
|
||||
};
|
||||
|
||||
pdm0: pdm@4001d000 {
|
||||
compatible = "nordic,nrf-pdm";
|
||||
reg = <0x4001d000 0x1000>;
|
||||
interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
|
||||
status = "disabled";
|
||||
label = "PDM_0";
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@4001e000 {
|
||||
compatible = "nordic,nrf52-flash-controller";
|
||||
reg = <0x4001e000 0x1000>;
|
||||
|
||||
@@ -308,6 +308,14 @@
|
||||
#pwm-cells = <1>;
|
||||
};
|
||||
|
||||
pdm0: pdm@4001d000 {
|
||||
compatible = "nordic,nrf-pdm";
|
||||
reg = <0x4001d000 0x1000>;
|
||||
interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
|
||||
status = "disabled";
|
||||
label = "PDM_0";
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@4001e000 {
|
||||
compatible = "nordic,nrf52-flash-controller";
|
||||
reg = <0x4001e000 0x1000>;
|
||||
|
||||
@@ -313,6 +313,14 @@
|
||||
#pwm-cells = <1>;
|
||||
};
|
||||
|
||||
pdm0: pdm@4001d000 {
|
||||
compatible = "nordic,nrf-pdm";
|
||||
reg = <0x4001d000 0x1000>;
|
||||
interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
|
||||
status = "disabled";
|
||||
label = "PDM_0";
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@4001e000 {
|
||||
compatible = "nordic,nrf52-flash-controller";
|
||||
reg = <0x4001e000 0x1000>;
|
||||
|
||||
@@ -308,6 +308,14 @@
|
||||
#pwm-cells = <1>;
|
||||
};
|
||||
|
||||
pdm0: pdm@4001d000 {
|
||||
compatible = "nordic,nrf-pdm";
|
||||
reg = <0x4001d000 0x1000>;
|
||||
interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
|
||||
status = "disabled";
|
||||
label = "PDM_0";
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@4001e000 {
|
||||
compatible = "nordic,nrf52-flash-controller";
|
||||
reg = <0x4001e000 0x1000>;
|
||||
|
||||
@@ -23,3 +23,30 @@ properties:
|
||||
type: int
|
||||
required: true
|
||||
description: DIN pin
|
||||
|
||||
clock-source:
|
||||
type: string
|
||||
required: false
|
||||
default: "PCLK32M_HFXO"
|
||||
description: |
|
||||
Clock source to be used by the PDM peripheral. The following options
|
||||
are available:
|
||||
- "PCLK32M": 32 MHz peripheral clock, synchronous to HFCLK
|
||||
- "PCLK32M_HFXO": PCLK32M running off the 32 MHz crystal oscillator
|
||||
(HFXO) for better clock accuracy and jitter performance
|
||||
- "ACLK": Audio PLL clock with configurable frequency (frequency for
|
||||
this clock must be set via the "hfclkaudio-frequency" property
|
||||
in the "nordic,nrf-clock" node); this clock source is only available
|
||||
in the nRF53 Series SoCs and it requires the use of HFXO
|
||||
enum:
|
||||
- "PCLK32M"
|
||||
- "PCLK32M_HFXO"
|
||||
- "ACLK"
|
||||
|
||||
queue-size:
|
||||
type: int
|
||||
required: false
|
||||
default: 4
|
||||
description: |
|
||||
Size of the queue of received audio data blocks to be used
|
||||
by the driver.
|
||||
|
||||
Reference in New Issue
Block a user