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/module.h>
13 #include <linux/moduleparam.h>
14 #include <linux/platform_device.h>
15 #include <linux/i2c.h>
17 #include <sound/core.h>
18 #include <sound/pcm.h>
19 #include <sound/soc.h>
20 #include <sound/soc-dapm.h>
22 #include <sound/sh_fsi.h>
23 #include <../sound/soc/codecs/ak4642.h>
25 static struct snd_soc_dai_link fsi_dai_link
= {
27 .stream_name
= "AK4642",
28 .cpu_dai
= &fsi_soc_dai
[0], /* fsi */
29 .codec_dai
= &ak4642_dai
,
33 static struct snd_soc_card fsi_soc_card
= {
35 .platform
= &fsi_soc_platform
,
36 .dai_link
= &fsi_dai_link
,
40 static struct snd_soc_device fsi_snd_devdata
= {
41 .card
= &fsi_soc_card
,
42 .codec_dev
= &soc_codec_dev_ak4642
,
46 #define AK4642_ADR 0x12
47 static int ak4642_add_i2c_device(void)
49 struct i2c_board_info info
;
50 struct i2c_adapter
*adapter
;
51 struct i2c_client
*client
;
53 memset(&info
, 0, sizeof(struct i2c_board_info
));
54 info
.addr
= AK4642_ADR
;
55 strlcpy(info
.type
, "ak4642", I2C_NAME_SIZE
);
57 adapter
= i2c_get_adapter(AK4642_BUS
);
59 printk(KERN_DEBUG
"can't get i2c adapter\n");
63 client
= i2c_new_device(adapter
, &info
);
64 i2c_put_adapter(adapter
);
66 printk(KERN_DEBUG
"can't add i2c device\n");
73 static struct platform_device
*fsi_snd_device
;
75 static int __init
fsi_ak4642_init(void)
79 ak4642_add_i2c_device();
81 fsi_snd_device
= platform_device_alloc("soc-audio", -1);
85 platform_set_drvdata(fsi_snd_device
,
87 fsi_snd_devdata
.dev
= &fsi_snd_device
->dev
;
88 ret
= platform_device_add(fsi_snd_device
);
91 platform_device_put(fsi_snd_device
);
97 static void __exit
fsi_ak4642_exit(void)
99 platform_device_unregister(fsi_snd_device
);
102 module_init(fsi_ak4642_init
);
103 module_exit(fsi_ak4642_exit
);
105 MODULE_LICENSE("GPL");
106 MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
107 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");