2 * Generic AC97 sound support for SH7760
4 * (c) 2007 Manuel Lauss
6 * Licensed under the GPLv2.
9 #include <linux/module.h>
10 #include <linux/moduleparam.h>
11 #include <linux/platform_device.h>
12 #include <sound/core.h>
13 #include <sound/pcm.h>
14 #include <sound/soc.h>
17 #define IPSEL 0xFE400034
19 static struct snd_soc_dai_link sh7760_ac97_dai
= {
21 .stream_name
= "AC97 HiFi",
22 .cpu_dai_name
= "hac-dai.0", /* HAC0 */
23 .codec_dai_name
= "ac97-hifi",
24 .platform_name
= "sh7760-pcm-audio",
25 .codec_name
= "ac97-codec",
29 static struct snd_soc_card sh7760_ac97_soc_machine
= {
30 .name
= "SH7760 AC97",
32 .dai_link
= &sh7760_ac97_dai
,
36 static struct platform_device
*sh7760_ac97_snd_device
;
38 static int __init
sh7760_ac97_init(void)
43 /* enable both AC97 controllers in pinmux reg */
44 ipsel
= __raw_readw(IPSEL
);
45 __raw_writew(ipsel
| (3 << 10), IPSEL
);
48 sh7760_ac97_snd_device
= platform_device_alloc("soc-audio", -1);
49 if (!sh7760_ac97_snd_device
)
52 platform_set_drvdata(sh7760_ac97_snd_device
,
53 &sh7760_ac97_soc_machine
);
54 ret
= platform_device_add(sh7760_ac97_snd_device
);
57 platform_device_put(sh7760_ac97_snd_device
);
63 static void __exit
sh7760_ac97_exit(void)
65 platform_device_unregister(sh7760_ac97_snd_device
);
68 module_init(sh7760_ac97_init
);
69 module_exit(sh7760_ac97_exit
);
71 MODULE_LICENSE("GPL");
72 MODULE_DESCRIPTION("Generic SH7760 AC97 sound machine");
73 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");