ADAU7118
ADAU7118 8 Channel, PDM to I2S or TDM Conversion IC Linux Driver.
Supported Devices
Evaluation Boards
Description
The ADAU7118 converts four stereo pulse density modulation (PDM) bitstreams into one pulse code modulation (PCM) output stream. The source for the PDM data can be eight microphones or other PDM sources. The PCM audio data is output on a serial audio interface port in either inter-IC serial (I2S) or time domain multiplexed (TDM) format. The ADAU7118 has an I2C interface which can be used to fully configure the device. It can set the device to operate either in stereo or TDM mode, disable/enable inputs, etc… Furthermore, the device can also operate in HW only mode where the I2C interface is disabled. In this mode, only TDM mode is supported.
Source Code
Status
Files
Function |
File |
|
|---|---|---|
core driver |
||
core include |
||
driver |
||
driver |
||
devicetree |
Adding Linux driver support
Kernel configuration
Device Drivers --->
<*> Sound card support --->
<*> Advanced Linux Sound Architecture --->
<*> ALSA for SoC audio support --->
<*> CODEC drivers --->
<*> Analog Devices ADAU7118 8 Channel PDM-to-I2S/TDM Converter - HW Mode
<*> Analog Devices ADAU7118 8 Channel PDM-to-I2S/TDM Converter - I2C
Devicetree configuration
The ADAU7118 driver is fully devicetree compatible.
Required properties:
compatible: Must be
adi,adau7118#sound-dai-cells: Must be 0
iovdd-supply: Regulator phandle for the digital I/O supply.
dvdd-supply: Regulator phandle for the internal core digital supply.
Optional properties:
reg: I2C address when the device is used with I2C support.
adi,decimation-ratio: Set’s the decimation ratio of PDM to PCM audio data.
adi,pdm-clk-map: The ADAU7118 has two PDM clocks for the four Inputs. Each input must be assigned to one of these two clocks. This property set’s the mapping between the clocks and the inputs.
Example device initialization
The ADAU7118 supports I2C control and standalone hardware mode. Both examples
require lowercase iovdd-supply and dvdd-supply properties and
#sound-dai-cells = <0>. The board must define the actual supply and
supply2 regulators; these labels do not imply fixed voltages.
I2C mode
The board must define i2c0. Match the address and interface configuration
to the connected device.
&i2c0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
adau7118_codec: audio-codec@14 {
compatible = "adi,adau7118";
reg = <0x14>;
#sound-dai-cells = <0>;
iovdd-supply = <&supply>;
dvdd-supply = <&supply2>;
adi,pdm-clk-map = <1 1 0 0>;
adi,decimation-ratio = <16>;
};
};
HW mode
Standalone hardware mode uses an unaddressed platform node, not an I2C
address or a reg property. Configure the device’s hardware straps for the
actual board interface.
/ {
adau7118_codec_hw: adau7118-codec-hw {
compatible = "adi,adau7118";
#sound-dai-cells = <0>;
iovdd-supply = <&supply>;
dvdd-supply = <&supply2>;
};
};
Driver testing
Routing and DAPM
ASoC DAPM widgets (HW Mode)
Name |
Description |
|---|---|
PDM_DAT0 |
PDM0 signal input |
PDM_DAT1 |
PDM1 signal input |
PDM_DAT2 |
PDM2 signal input |
PDM_DAT3 |
PDM3 signal input |
AIF1TX |
Audio Interface Output |
ASoC DAPM widgets (I2C)
Name |
Description |
|---|---|
PDM_DAT0 |
PDM0 signal input |
PDM_DAT1 |
PDM1 signal input |
PDM_DAT2 |
PDM2 signal input |
PDM_DAT3 |
PDM3 signal input |
PDM0 |
PDM0 switch control |
PDM1 |
PDM1 switch control |
PDM2 |
PDM2 switch control |
PDM3 |
PDM3 switch control |
PDM_CLK0 |
Clock0 supply widget |
PDM_CLK1 |
Clock1 supply widget |
AIF1TX1 |
Audio Interface Output - Channel 1 |
AIF1TX2 |
Audio Interface Output - Channel 2 |
AIF1TX3 |
Audio Interface Output - Channel 3 |
AIF1TX4 |
Audio Interface Output - Channel 4 |
AIF1TX5 |
Audio Interface Output - Channel 5 |
AIF1TX6 |
Audio Interface Output - Channel 6 |
AIF1TX7 |
Audio Interface Output - Channel 7 |
AIF1TX8 |
Audio Interface Output - Channel 8 |
ALSA controls
Name |
Description |
|---|---|
Capture Switch |
PDM0 input enable |
Capture Switch |
PDM1 input enable |
Capture Switch |
PDM2 input enable |
Capture Switch |
PDM3 input enable |
DAI formats and clocks
DAI Configuration
The driver registers one DAI called ``adau7118-hifi-capture``.
Supported DAI formats
Name |
Supported by driver |
Description |
|---|---|---|
SND_SOC_DAIFMT_I2S |
yes* |
I2S mode |
SND_SOC_DAIFMT_RIGHT_J |
yes* |
Right Justified mode |
SND_SOC_DAIFMT_LEFT_J |
yes* |
Left Justified mode |
SND_SOC_DAIFMT_DSP_A |
no |
data MSB after FRM LRC |
SND_SOC_DAIFMT_DSP_B |
no |
data MSB during FRM LRC |
SND_SOC_DAIFMT_AC97 |
no |
AC97 mode |
SND_SOC_DAIFMT_PDM |
no |
Pulse density modulation |
SND_SOC_DAIFMT_NB_NF |
yes* |
Normal bit- and frameclock |
SND_SOC_DAIFMT_NB_IF |
yes* |
Normal bitclock, inverted frameclock |
SND_SOC_DAIFMT_IB_NF |
yes* |
Inverted frameclock, normal bitclock |
SND_SOC_DAIFMT_IB_IF |
yes* |
Inverted bit- and frameclock |
SND_SOC_DAIFMT_CBM_CFM |
no |
Codec bit- and frameclock master |
SND_SOC_DAIFMT_CBS_CFM |
no |
Codec bitclock slave, frameclock master |
SND_SOC_DAIFMT_CBM_CFS |
no |
Codec bitclock master, frameclock slave |
SND_SOC_DAIFMT_CBS_CFS |
yes |
Codec bit- and frameclock slave |
* The supported DAI format are limited for HW only mode (only I2S and Normal bit- and frameclock is supported). In this mode, the I2C SCL and SDA pins are used to select different functionality. Check table 11 of the datasheet for more details.
More Information
Need Help?