blob: 529d06444c546711c1fcbabffbf75c660486ce1b [file] [log] [blame]
Ricardo Neri54520302012-05-18 01:42:33 -05001/*
2 * ALSA SoC codec driver for HDMI audio on OMAP processors.
3 * 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
26static struct snd_soc_codec_driver omap_hdmi_codec;
27
28static struct snd_soc_dai_driver omap_hdmi_codec_dai = {
29 .name = "omap-hdmi-hifi",
30 .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 },
40};
41
Bill Pemberton7a79e942012-12-07 09:26:37 -050042static int omap_hdmi_codec_probe(struct platform_device *pdev)
Ricardo Neri54520302012-05-18 01:42:33 -050043{
44 return snd_soc_register_codec(&pdev->dev, &omap_hdmi_codec,
45 &omap_hdmi_codec_dai, 1);
46}
47
Bill Pemberton7a79e942012-12-07 09:26:37 -050048static int omap_hdmi_codec_remove(struct platform_device *pdev)
Ricardo Neri54520302012-05-18 01:42:33 -050049{
50 snd_soc_unregister_codec(&pdev->dev);
51 return 0;
52}
53
54static struct platform_driver omap_hdmi_codec_driver = {
55 .driver = {
56 .name = DRV_NAME,
57 .owner = THIS_MODULE,
58 },
59
60 .probe = omap_hdmi_codec_probe,
Bill Pemberton7a79e942012-12-07 09:26:37 -050061 .remove = omap_hdmi_codec_remove,
Ricardo Neri54520302012-05-18 01:42:33 -050062};
63
64module_platform_driver(omap_hdmi_codec_driver);
65
66MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
67MODULE_DESCRIPTION("ASoC OMAP HDMI codec driver");
68MODULE_LICENSE("GPL");
69MODULE_ALIAS("platform:" DRV_NAME);