2 * hdmi_i2s.c -- HDMI i2s audio for rockchip
4 * Copyright (C) 2015 Fuzhou Rockchip Electronics Co., Ltd
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
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 struct snd_soc_dai_driver hdmi_i2s_dai = {
27 .name = "rk-hdmi-i2s-hifi",
29 .stream_name = "HiFi Playback",
32 .rates = (SNDRV_PCM_RATE_32000 |
33 SNDRV_PCM_RATE_44100 |
34 SNDRV_PCM_RATE_48000 |
35 SNDRV_PCM_RATE_96000 |
36 SNDRV_PCM_RATE_192000),
37 .formats = (SNDRV_PCM_FMTBIT_S16_LE |
38 SNDRV_PCM_FMTBIT_S20_3LE |
39 SNDRV_PCM_FMTBIT_S24_LE),
43 static struct snd_soc_codec_driver soc_codec_dev_hdmi_i2s;
45 static int rockchip_hdmi_i2s_audio_probe(struct platform_device *pdev)
49 ret = snd_soc_register_codec(&pdev->dev,
50 &soc_codec_dev_hdmi_i2s,
54 dev_err(&pdev->dev, "register card failed: %d\n", ret);
59 static int rockchip_hdmi_i2s_audio_remove(struct platform_device *pdev)
61 snd_soc_unregister_codec(&pdev->dev);
67 static const struct of_device_id rockchip_hdmi_i2s_of_match[] = {
68 { .compatible = "hdmi-i2s", },
71 MODULE_DEVICE_TABLE(of, rockchip_hdmi_i2s_of_match);
72 #endif /* CONFIG_OF */
74 static struct platform_driver rockchip_hdmi_i2s_audio_driver = {
77 .of_match_table = of_match_ptr(rockchip_hdmi_i2s_of_match),
79 .probe = rockchip_hdmi_i2s_audio_probe,
80 .remove = rockchip_hdmi_i2s_audio_remove,
83 module_platform_driver(rockchip_hdmi_i2s_audio_driver);
85 MODULE_DESCRIPTION("Rockchip HDMI I2S Dummy Driver");
86 MODULE_LICENSE("GPL");
87 MODULE_ALIAS("platform:hdmi-i2s");