blob: f0986b9f193977befa154fb9dc4e4ea0269c3b9a [file] [log] [blame]
Ricardo Neri54520302012-05-18 01:42:33 -05001/*
Barry Songbf7c6e62013-05-16 14:08:07 +08002 * ALSA SoC codec driver for HDMI audio codecs.
Ricardo Neri54520302012-05-18 01:42:33 -05003 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
4 * Author: Ricardo Neri <ricardo.neri@ti.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21#include <linux/module.h>
22#include <sound/soc.h>
23
24#define DRV_NAME "hdmi-audio-codec"
25
Barry Songbf7c6e62013-05-16 14:08:07 +080026static struct snd_soc_codec_driver hdmi_codec;
Ricardo Neri54520302012-05-18 01:42:33 -050027
Barry Songbf7c6e62013-05-16 14:08:07 +080028static struct snd_soc_dai_driver hdmi_codec_dai = {
29 .name = "hdmi-hifi",
Ricardo Neri54520302012-05-18 01:42:33 -050030 .playback = {
31 .channels_min = 2,
32 .channels_max = 8,
33 .rates = SNDRV_PCM_RATE_32000 |
34 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
35 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
36 SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
37 .formats = SNDRV_PCM_FMTBIT_S16_LE |
38 SNDRV_PCM_FMTBIT_S24_LE,
39 },
Rongjun Yingc6c09252013-07-17 14:12:16 +080040 .capture = {
41 .channels_min = 2,
42 .channels_max = 2,
43 .rates = SNDRV_PCM_RATE_32000 |
44 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
45 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
46 SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
47 .formats = SNDRV_PCM_FMTBIT_S16_LE |
48 SNDRV_PCM_FMTBIT_S24_LE,
49 },
50
Ricardo Neri54520302012-05-18 01:42:33 -050051};
52
Barry Songbf7c6e62013-05-16 14:08:07 +080053static int hdmi_codec_probe(struct platform_device *pdev)
Ricardo Neri54520302012-05-18 01:42:33 -050054{
Barry Songbf7c6e62013-05-16 14:08:07 +080055 return snd_soc_register_codec(&pdev->dev, &hdmi_codec,
56 &hdmi_codec_dai, 1);
Ricardo Neri54520302012-05-18 01:42:33 -050057}
58
Barry Songbf7c6e62013-05-16 14:08:07 +080059static int hdmi_codec_remove(struct platform_device *pdev)
Ricardo Neri54520302012-05-18 01:42:33 -050060{
61 snd_soc_unregister_codec(&pdev->dev);
62 return 0;
63}
64
Barry Songbf7c6e62013-05-16 14:08:07 +080065static struct platform_driver hdmi_codec_driver = {
Ricardo Neri54520302012-05-18 01:42:33 -050066 .driver = {
67 .name = DRV_NAME,
68 .owner = THIS_MODULE,
69 },
70
Barry Songbf7c6e62013-05-16 14:08:07 +080071 .probe = hdmi_codec_probe,
72 .remove = hdmi_codec_remove,
Ricardo Neri54520302012-05-18 01:42:33 -050073};
74
Barry Songbf7c6e62013-05-16 14:08:07 +080075module_platform_driver(hdmi_codec_driver);
Ricardo Neri54520302012-05-18 01:42:33 -050076
77MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
Barry Songbf7c6e62013-05-16 14:08:07 +080078MODULE_DESCRIPTION("ASoC generic HDMI codec driver");
Ricardo Neri54520302012-05-18 01:42:33 -050079MODULE_LICENSE("GPL");
80MODULE_ALIAS("platform:" DRV_NAME);