* simple-audio-card with omap4-dmic
@ 2015-06-03 15:37 Jack Mitchell
2015-06-03 16:39 ` Jack Mitchell
0 siblings, 1 reply; 2+ messages in thread
From: Jack Mitchell @ 2015-06-03 15:37 UTC (permalink / raw)
To: alsa-devel
I'm currently working with a PandaBoard clone (OMAP44xx) which doesn't
have the usual twl6040 codec, however I would like to attach a digital
microphone directly into the OMAP.
I have added the following to my device tree:
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "dmic-card";
simple-audio-card,format = "pdm";
status = "okay";
simple-audio-card,dai-link@0 {
cpu {
sound-dai = <&dmic>;
};
codec {
sound-dai = <&dmic_codec>;
};
};
};
dmic_codec: dmic_codec {
#sound-dai-cells = <0>;
compatible = "linux,dmic-codec";
};
and created a small patch to allow the generic dmic-hifi codec to be
instantiated from device tree.
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
index fde5325..67b9198 100644
--- a/sound/soc/codecs/dmic.c
+++ b/sound/soc/codecs/dmic.c
@@ -69,11 +69,18 @@ static int dmic_dev_remove(struct platform_device *pdev)
return 0;
}
-MODULE_ALIAS("platform:dmic-codec");
+#ifdef CONFIG_OF
+static const struct of_device_id dmic_dt_ids[] = {
+ { .compatible = "linux,dmic-codec", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, dmic_dt_ids);
+#endif
static struct platform_driver dmic_driver = {
.driver = {
.name = "dmic-codec",
+ .of_match_table = of_match_ptr(dmic_dt_ids),
},
.probe = dmic_dev_probe,
.remove = dmic_dev_remove,
@@ -81,6 +88,7 @@ static struct platform_driver dmic_driver = {
module_platform_driver(dmic_driver);
+MODULE_ALIAS("platform:dmic-codec");
MODULE_DESCRIPTION("Generic DMIC driver");
MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
MODULE_LICENSE("GPL");
However, no soundcards get loaded, and I don't get error or warnings in
dmesg, so I'm at a bit of a loss at where I'm going wrong. Can anybody
see any glaring mistakes? I know the driver is definitely getting loaded
as I have seen errors relating to me not specifying the sound-dai-cells
from the simple-audio-card driver.
Any ideas would be greatly recieved!
Cheers,
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: simple-audio-card with omap4-dmic
2015-06-03 15:37 simple-audio-card with omap4-dmic Jack Mitchell
@ 2015-06-03 16:39 ` Jack Mitchell
0 siblings, 0 replies; 2+ messages in thread
From: Jack Mitchell @ 2015-06-03 16:39 UTC (permalink / raw)
To: alsa-devel
On 03/06/15 16:37, Jack Mitchell wrote:
> I'm currently working with a PandaBoard clone (OMAP44xx) which doesn't
> have the usual twl6040 codec, however I would like to attach a digital
> microphone directly into the OMAP.
>
> I have added the following to my device tree:
>
> sound {
> compatible = "simple-audio-card";
> simple-audio-card,name = "dmic-card";
>
> simple-audio-card,format = "pdm";
>
> status = "okay";
>
> simple-audio-card,dai-link@0 {
> cpu {
> sound-dai = <&dmic>;
> };
>
> codec {
> sound-dai = <&dmic_codec>;
> };
> };
> };
>
> dmic_codec: dmic_codec {
> #sound-dai-cells = <0>;
> compatible = "linux,dmic-codec";
> };
>
> and created a small patch to allow the generic dmic-hifi codec to be
> instantiated from device tree.
>
> diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
> index fde5325..67b9198 100644
> --- a/sound/soc/codecs/dmic.c
> +++ b/sound/soc/codecs/dmic.c
> @@ -69,11 +69,18 @@ static int dmic_dev_remove(struct platform_device
> *pdev)
> return 0;
> }
>
> -MODULE_ALIAS("platform:dmic-codec");
> +#ifdef CONFIG_OF
> +static const struct of_device_id dmic_dt_ids[] = {
> + { .compatible = "linux,dmic-codec", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, dmic_dt_ids);
> +#endif
>
> static struct platform_driver dmic_driver = {
> .driver = {
> .name = "dmic-codec",
> + .of_match_table = of_match_ptr(dmic_dt_ids),
> },
> .probe = dmic_dev_probe,
> .remove = dmic_dev_remove,
> @@ -81,6 +88,7 @@ static struct platform_driver dmic_driver = {
>
> module_platform_driver(dmic_driver);
>
> +MODULE_ALIAS("platform:dmic-codec");
> MODULE_DESCRIPTION("Generic DMIC driver");
> MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
> MODULE_LICENSE("GPL");
>
> However, no soundcards get loaded, and I don't get error or warnings
> in dmesg, so I'm at a bit of a loss at where I'm going wrong. Can
> anybody see any glaring mistakes? I know the driver is definitely
> getting loaded as I have seen errors relating to me not specifying the
> sound-dai-cells from the simple-audio-card driver.
>
> Any ideas would be greatly recieved!
>
> Cheers,
>
>
Ok, playing with this a bit more and I find if I manually modprobe
snd-soc-dmic then it fires into life. There are other problems with
capturing but I'll fight those myself for a bit first.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-03 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03 15:37 simple-audio-card with omap4-dmic Jack Mitchell
2015-06-03 16:39 ` Jack Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox