Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec...
[deliverable/linux.git] / sound / soc / sh / fsi-ak4642.c
CommitLineData
b8e583f6
KM
1/*
2 * FSI-AK464x sound support for ms7724se
3 *
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
b8e583f6 12#include <linux/platform_device.h>
b8e583f6 13#include <sound/sh_fsi.h>
b8e583f6 14
f0fba2ad 15static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd)
4b6316b4 16{
f0fba2ad 17 struct snd_soc_dai *dai = rtd->codec_dai;
4b6316b4
KM
18 int ret;
19
f0fba2ad 20 ret = snd_soc_dai_set_fmt(dai, SND_SOC_DAIFMT_CBM_CFM);
0643ce8f
KM
21 if (ret < 0)
22 return ret;
23
f0fba2ad 24 ret = snd_soc_dai_set_sysclk(dai, 0, 11289600, 0);
4b6316b4
KM
25
26 return ret;
27}
28
b8e583f6
KM
29static struct snd_soc_dai_link fsi_dai_link = {
30 .name = "AK4642",
31 .stream_name = "AK4642",
f0fba2ad
LG
32 .cpu_dai_name = "fsia-dai", /* fsi A */
33 .codec_dai_name = "ak4642-hifi",
2c280320 34#ifdef CONFIG_MACH_AP4EVB
c570d529 35 .platform_name = "sh_fsi2",
2c280320
KM
36 .codec_name = "ak4642-codec.0-0013",
37#else
38 .platform_name = "sh_fsi.0",
f0fba2ad 39 .codec_name = "ak4642-codec.0-0012",
2c280320 40#endif
4b6316b4 41 .init = fsi_ak4642_dai_init,
b8e583f6
KM
42 .ops = NULL,
43};
44
45static struct snd_soc_card fsi_soc_card = {
1c7fc7e5 46 .name = "FSI (AK4642)",
b8e583f6
KM
47 .dai_link = &fsi_dai_link,
48 .num_links = 1,
49};
50
b8e583f6
KM
51static struct platform_device *fsi_snd_device;
52
53static int __init fsi_ak4642_init(void)
54{
55 int ret = -ENOMEM;
56
3c2ef841 57 fsi_snd_device = platform_device_alloc("soc-audio", FSI_PORT_A);
b8e583f6
KM
58 if (!fsi_snd_device)
59 goto out;
60
f0fba2ad 61 platform_set_drvdata(fsi_snd_device, &fsi_soc_card);
b8e583f6
KM
62 ret = platform_device_add(fsi_snd_device);
63
64 if (ret)
65 platform_device_put(fsi_snd_device);
66
67out:
68 return ret;
69}
70
71static void __exit fsi_ak4642_exit(void)
72{
73 platform_device_unregister(fsi_snd_device);
74}
75
76module_init(fsi_ak4642_init);
77module_exit(fsi_ak4642_exit);
78
79MODULE_LICENSE("GPL");
80MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
81MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
This page took 0.0823390000000001 seconds and 5 git commands to generate.