2 * FSI-AK464x sound support for ms7724se
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
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
12 #include <linux/platform_device.h>
13 #include <linux/module.h>
14 #include <sound/sh_fsi.h>
16 struct fsi_ak4642_data
{
25 static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime
*rtd
)
27 struct snd_soc_dai
*codec
= rtd
->codec_dai
;
28 struct snd_soc_dai
*cpu
= rtd
->cpu_dai
;
31 ret
= snd_soc_dai_set_fmt(codec
, SND_SOC_DAIFMT_LEFT_J
|
32 SND_SOC_DAIFMT_CBM_CFM
);
36 ret
= snd_soc_dai_set_sysclk(codec
, 0, 11289600, 0);
40 ret
= snd_soc_dai_set_fmt(cpu
, SND_SOC_DAIFMT_LEFT_J
|
41 SND_SOC_DAIFMT_CBS_CFS
);
46 static struct snd_soc_dai_link fsi_dai_link
= {
47 .codec_dai_name
= "ak4642-hifi",
48 .init
= fsi_ak4642_dai_init
,
51 static struct snd_soc_card fsi_soc_card
= {
53 .dai_link
= &fsi_dai_link
,
57 static struct platform_device
*fsi_snd_device
;
59 static int fsi_ak4642_probe(struct platform_device
*pdev
)
62 struct fsi_ak4642_info
*pinfo
= pdev
->dev
.platform_data
;
65 dev_err(&pdev
->dev
, "no info for fsi ak4642\n");
69 fsi_snd_device
= platform_device_alloc("soc-audio", pinfo
->id
);
73 fsi_dai_link
.name
= pinfo
->name
;
74 fsi_dai_link
.stream_name
= pinfo
->name
;
75 fsi_dai_link
.cpu_dai_name
= pinfo
->cpu_dai
;
76 fsi_dai_link
.platform_name
= pinfo
->platform
;
77 fsi_dai_link
.codec_name
= pinfo
->codec
;
78 fsi_soc_card
.name
= pinfo
->card
;
80 platform_set_drvdata(fsi_snd_device
, &fsi_soc_card
);
81 ret
= platform_device_add(fsi_snd_device
);
84 platform_device_put(fsi_snd_device
);
90 static int fsi_ak4642_remove(struct platform_device
*pdev
)
92 platform_device_unregister(fsi_snd_device
);
96 static struct platform_driver fsi_ak4642
= {
98 .name
= "fsi-ak4642-audio",
100 .probe
= fsi_ak4642_probe
,
101 .remove
= fsi_ak4642_remove
,
104 module_platform_driver(fsi_ak4642
);
106 MODULE_LICENSE("GPL");
107 MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
108 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");