asoc: codec: spdif: Remove Compiler Warning
[linux-2.6.git] / sound / soc / codecs / spdif_transciever.c
1 /*
2  * ALSA SoC SPDIF DIT driver
3  *
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.
7  *
8  * Author:      Steve Chen,  <schen@mvista.com>
9  * Copyright:   (C) 2009 MontaVista Software, Inc., <source@mvista.com>
10  * Copyright:   (C) 2009  Texas Instruments, India
11  * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License version 2 as
15  * published by the Free Software Foundation.
16  */
17
18
19 #include <asm/mach-types.h>
20 #include <linux/module.h>
21 #include <linux/moduleparam.h>
22 #include <linux/slab.h>
23 #include <sound/soc.h>
24 #include <sound/pcm.h>
25 #include <sound/initval.h>
26
27 #define DRV_NAME "spdif-dit"
28
29 #define STUB_RATES      SNDRV_PCM_RATE_8000_96000
30 #define STUB_FORMATS    SNDRV_PCM_FMTBIT_S16_LE
31
32 static int spdif_probe(struct snd_soc_codec *codec) {
33         codec->dapm.idle_bias_off = 1;
34         return 0;
35 }
36
37 static const struct snd_soc_dapm_widget spdif_dapm_widgets[] = {
38         SND_SOC_DAPM_VMID("spdif dummy Vmid"),
39 };
40
41 static int spdif_write(struct snd_soc_codec *codec, unsigned int reg,
42                                                         unsigned int val){
43         return 0;
44 }
45
46 static unsigned int spdif_read(struct snd_soc_codec *codec, unsigned int reg)
47 {
48         return 0;
49 }
50
51 static struct snd_soc_codec_driver soc_codec_spdif_dit = {
52         .probe = spdif_probe,
53         .dapm_widgets = spdif_dapm_widgets,
54         .num_dapm_widgets = ARRAY_SIZE(spdif_dapm_widgets),
55         .read = spdif_read,
56         .write = spdif_write,
57 };
58
59 static struct snd_soc_dai_driver dit_stub_dai = {
60         .name           = "dit-hifi",
61         .playback       = {
62                 .stream_name    = "Playback",
63                 .channels_min   = 1,
64                 .channels_max   = 384,
65                 .rates          = STUB_RATES,
66                 .formats        = STUB_FORMATS,
67         },
68         .capture        = {
69                 .stream_name    = "Capture",
70                 .channels_min   = 1,
71                 .channels_max   = 384,
72                 .rates          = STUB_RATES,
73                 .formats        = STUB_FORMATS,
74         },
75 };
76
77 static int spdif_dit_probe(struct platform_device *pdev)
78 {
79         return snd_soc_register_codec(&pdev->dev,
80                 &soc_codec_spdif_dit, &dit_stub_dai, 1);
81
82 }
83
84 static int spdif_dit_remove(struct platform_device *pdev)
85 {
86         snd_soc_unregister_codec(&pdev->dev);
87         return 0;
88 }
89
90 static struct platform_driver spdif_dit_driver = {
91         .probe          = spdif_dit_probe,
92         .remove         = spdif_dit_remove,
93         .driver         = {
94                 .name   = DRV_NAME,
95                 .owner  = THIS_MODULE,
96         },
97 };
98
99 module_platform_driver(spdif_dit_driver);
100
101 MODULE_AUTHOR("Steve Chen <schen@mvista.com>");
102 MODULE_DESCRIPTION("SPDIF dummy codec driver");
103 MODULE_LICENSE("GPL");
104 MODULE_ALIAS("platform:" DRV_NAME);