2 * ALSA SoC SPDIF DIT driver
4 * This driver is used by controllers which can operate in DIT (SPDI/F) where
5 * no codec is needed. This file provides stub codec that can be used
6 * in these configurations. TI DaVinci Audio controller uses this driver.
8 * Author: Steve Chen, <schen@mvista.com>
9 * Copyright: (C) 2009 MontaVista Software, Inc., <source@mvista.com>
10 * Copyright: (C) 2009 Texas Instruments, India
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
17 #include <linux/module.h>
18 #include <linux/moduleparam.h>
19 #include <linux/slab.h>
21 #include <linux/of_gpio.h>
22 #include <sound/soc.h>
23 #include <sound/pcm.h>
24 #include <sound/initval.h>
26 #define DRV_NAME "spdif-dit"
28 #define STUB_RATES SNDRV_PCM_RATE_8000_192000
29 #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
32 static struct snd_soc_codec_driver soc_codec_spdif_dit;
34 static struct snd_soc_dai_driver dit_stub_dai = {
35 .name = "rk-hdmi-spdif-hifi",
37 .stream_name = "Playback",
41 .formats = STUB_FORMATS,
45 static int hdmi_spdif_audio_probe(struct platform_device *pdev)
49 ret = snd_soc_register_codec(&pdev->dev, &soc_codec_spdif_dit,
53 dev_err(&pdev->dev, "%s register failed: %d\n",
59 static int hdmi_spdif_audio_remove(struct platform_device *pdev)
61 snd_soc_unregister_codec(&pdev->dev);
67 static const struct of_device_id hdmi_spdif_of_match[] = {
68 { .compatible = "hdmi-spdif", },
71 MODULE_DEVICE_TABLE(of, hdmi_spdif_of_match);
72 #endif /* CONFIG_OF */
74 static struct platform_driver hdmi_spdif_audio_driver = {
77 .of_match_table = of_match_ptr(hdmi_spdif_of_match),
79 .probe = hdmi_spdif_audio_probe,
80 .remove = hdmi_spdif_audio_remove,
83 module_platform_driver(hdmi_spdif_audio_driver);
85 MODULE_AUTHOR("Steve Chen <schen@mvista.com>");
86 MODULE_DESCRIPTION("SPDIF dummy codec driver");
87 MODULE_LICENSE("GPL");
88 MODULE_ALIAS("platform:" DRV_NAME);