28
29
#include <mach/hardware.h>
29
30
#include "ep93xx-pcm.h"
31
#define edb93xx_has_audio() (machine_is_edb9301() || \
32
machine_is_edb9302() || \
33
machine_is_edb9302a() || \
34
machine_is_edb9307a() || \
35
machine_is_edb9315a())
37
32
static int edb93xx_hw_params(struct snd_pcm_substream *substream,
38
33
struct snd_pcm_hw_params *params)
97
static struct platform_device *edb93xx_snd_device;
99
static int __init edb93xx_init(void)
92
static int __devinit edb93xx_probe(struct platform_device *pdev)
94
struct snd_soc_card *card = &snd_soc_edb93xx;
103
if (!edb93xx_has_audio())
106
97
ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
107
98
EP93XX_SYSCON_I2SCLKDIV_ORIDE |
108
99
EP93XX_SYSCON_I2SCLKDIV_SPOL);
112
edb93xx_snd_device = platform_device_alloc("soc-audio", -1);
113
if (!edb93xx_snd_device) {
103
card->dev = &pdev->dev;
105
ret = snd_soc_register_card(card);
107
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
109
ep93xx_i2s_release();
118
platform_set_drvdata(edb93xx_snd_device, &snd_soc_edb93xx);
119
ret = platform_device_add(edb93xx_snd_device);
115
static int __devexit edb93xx_remove(struct platform_device *pdev)
117
struct snd_soc_card *card = platform_get_drvdata(pdev);
119
snd_soc_unregister_card(card);
120
ep93xx_i2s_release();
126
platform_device_put(edb93xx_snd_device);
128
ep93xx_i2s_release();
125
static struct platform_driver edb93xx_driver = {
127
.name = "edb93xx-audio",
128
.owner = THIS_MODULE,
130
.probe = edb93xx_probe,
131
.remove = __devexit_p(edb93xx_remove),
134
static int __init edb93xx_init(void)
136
return platform_driver_register(&edb93xx_driver);
131
138
module_init(edb93xx_init);
133
140
static void __exit edb93xx_exit(void)
135
platform_device_unregister(edb93xx_snd_device);
136
ep93xx_i2s_release();
142
platform_driver_unregister(&edb93xx_driver);
138
144
module_exit(edb93xx_exit);
140
146
MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
141
147
MODULE_DESCRIPTION("ALSA SoC EDB93xx");
142
148
MODULE_LICENSE("GPL");
149
MODULE_ALIAS("platform:edb93xx-audio");