I would like to interface a ADAU7002 PDM-to-I2S conversions IC to the Apalis iMX6. My initial thought was that this would be possible using the digital audio interface via AUD5 on the X5 connector of the Apalis Evaluation Board if I removed the associated jumpers on X6 to access MXM3_200, MXM3_202, and MXM3_204.
I modified the kernel config to include the ADAU7002 driver:
diff .config .config.new
3197c3197
< # CONFIG_SND_SOC_ADAU7002 is not set
---
> CONFIG_SND_SOC_ADAU7002=y
And I made the following device tree modifications.
diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
index cfaaa571c158..2400355e1f9d 100644
--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -206,6 +206,17 @@
mux-ext-port = <4>;
};
+ sound_adau7002: sound-adau7002 {
+ compatible = "adi,adau7002";
+ model = "imx6q-apalis-adau7002";
+ cpu-dai = <&ssi2>;
+ audio-codec = <&adau7002>;
+ audio-routing =
+ "PDM_DAT", "Digital Mics";
+ mux-int-port = <2>;
+ mux-ext-port = <5>;
+ };
+
sound_hdmi: sound-hdmi {
compatible = "fsl,imx6q-audio-hdmi",
"fsl,imx-audio-hdmi";
@@ -439,6 +450,12 @@
VDDD-supply =<®_1p8v>;
};
+ adau7002: pdm-to-i2s {
+ compatible = "adi,adau7002";
+ // Commenting this out indicates supply pin is hardwired always on.
+ //IOVDD-supply = <®_3p3v>;
+ };
+
/* STMPE811 touch screen controller */
stmpe811@41 {
compatible = "st,stmpe811";
@@ -665,6 +682,10 @@
status = "okay";
};
+&ssi2 {
+ status = "okay";
+};
+
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1_dte &pinctrl_uart1_ctrl>;
@@ -813,6 +834,11 @@
MX6QDL_PAD_DISP0_DAT23__AUD4_RXD PAD_CTRL_HYS_PD
/* SGTL5000 sys_mclk */
MX6QDL_PAD_GPIO_5__CCM_CLKO1 PAD_CTRL_HYS_PD
+
+ /* AUD5 for ADAU7002. */
+ MX6QDL_PAD_DISP0_DAT19__AUD5_RXD PAD_CTRL_HYS_PD
+ MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS PAD_CTRL_HYS_PD
+ MX6QDL_PAD_DISP0_DAT16__AUD5_TXC PAD_CTRL_HYS_PD
>;
};
With these changes, I see the following error in the boot console output:
i2c i2c-2: of_i2c: invalid reg on /soc/aips-bus@02100000/i2c@021a4000/pdm-to-i2s
i2c i2c-2: Failed to create I2C device for /soc/aips-bus@02100000/i2c@021a4000/pdm-to-i2s
However, I didn’t think that an I2C device needed to be associated with the adau7002. Here is the device tree doc for that driver from the kernel:
cat Documentation/devicetree/bindings/sound/adi,adau7002.txt
Analog Devices ADAU7002 Stereo PDM-to-I2S/TDM Converter
Required properties:
- compatible: Must be "adi,adau7002"
Optional properties:
- IOVDD-supply: Phandle and specifier for the power supply providing the IOVDD
supply as covered in Documentation/devicetree/bindings/regulator/regulator.txt
If this property is not present it is assumed that the supply pin is
hardwired to always on.
Example:
adau7002: pdm-to-i2s {
compatible = "adi,adau7002";
IOVDD-supply = <&supply>;
};
Do you know why I am getting this I2C error?
Is my approach correct (and possible) with the Apalis iMX6?
Thanks.