Enable I2S output on 40-pin header
- Use snd-soc-dummy codec and simple-card to get I2S output from SAI1
onto the 40-pin header.
Change-Id: Id85bc34097fe90e8a73fd389e7bbf34f09401b97
diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts b/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts
index e67ac41..904d053 100644
--- a/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts
@@ -53,6 +53,26 @@
status = "okay";
};
+ dummy_dai: dummy-dai {
+ compatible = "linux,snd-soc-dummy";
+ #sound-dai-cells = <0>;
+ status = "okay";
+ };
+
+ sound-header {
+ compatible = "simple-audio-card";
+ status = "okay";
+ simple-audio-card,name = "40-pin Header";
+ simple-audio-card,format = "i2s";
+ simple-audio-card,cpu {
+ sound-dai = <&sai1>;
+ };
+ simple-audio-card,codec {
+ #sound-dai-cells = <0>;
+ sound-dai = <&dummy_dai>;
+ };
+ };
+
busfreq {
status = "disabled";
};
@@ -223,10 +243,19 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
status = "okay";
+ #sound-dai-cells = <0>;
+ assigned-clocks =
+ <&clk IMX8MQ_CLK_SAI1>;
+ assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
+ assigned-clock-rates = <45158400>;
+
+ clocks = <&clk IMX8MQ_CLK_SAI1_IPG>, <&clk IMX8MQ_CLK_DUMMY>,
+ <&clk IMX8MQ_CLK_SAI1_ROOT>, <&clk IMX8MQ_CLK_DUMMY>,
+ <&clk IMX8MQ_CLK_DUMMY>, <&clk IMX8MQ_AUDIO_PLL1_OUT>,
+ <&clk IMX8MQ_AUDIO_PLL2_OUT>;
+ clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
};
- // <&clk IMX8MQ_CLK_SAI2_DIV>;
- // assigned-clock-rates = <0>, <24576000>;
&sai2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index e30aacb..1a889ac 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/export.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -359,9 +360,16 @@ static int snd_soc_dummy_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id soc_dummy_ids[] = {
+ { .compatible = "linux,snd-soc-dummy", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, soc_dummy_ids);
+
static struct platform_driver soc_dummy_driver = {
.driver = {
.name = "snd-soc-dummy",
+ .of_match_table = of_match_ptr(soc_dummy_ids),
},
.probe = snd_soc_dummy_probe,
.remove = snd_soc_dummy_remove,