1/* 2 * fsi-da7210.c 3 * 4 * Copyright (C) 2009 Renesas Solutions Corp. 5 * Kuninori Morimoto <morimoto.kuninori@renesas.com> 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the 9 * Free Software Foundation; either version 2 of the License, or (at your 10 * option) any later version. 11 */ 12 13#include <linux/platform_device.h> 14#include <sound/sh_fsi.h> 15#include "../codecs/da7210.h" 16 17static int fsi_da7210_init(struct snd_soc_codec *codec) 18{ 19 return snd_soc_dai_set_fmt(&da7210_dai, 20 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 21 SND_SOC_DAIFMT_CBM_CFM); 22} 23 24static struct snd_soc_dai_link fsi_da7210_dai = { 25 .name = "DA7210", 26 .stream_name = "DA7210", 27 .cpu_dai = &fsi_soc_dai[FSI_PORT_B], 28 .codec_dai = &da7210_dai, 29 .init = fsi_da7210_init, 30}; 31 32static struct snd_soc_card fsi_soc_card = { 33 .name = "FSI", 34 .platform = &fsi_soc_platform, 35 .dai_link = &fsi_da7210_dai, 36 .num_links = 1, 37}; 38 39static struct snd_soc_device fsi_da7210_snd_devdata = { 40 .card = &fsi_soc_card, 41 .codec_dev = &soc_codec_dev_da7210, 42}; 43 44static struct platform_device *fsi_da7210_snd_device; 45 46static int __init fsi_da7210_sound_init(void) 47{ 48 int ret; 49 50 fsi_da7210_snd_device = platform_device_alloc("soc-audio", FSI_PORT_B); 51 if (!fsi_da7210_snd_device) 52 return -ENOMEM; 53 54 platform_set_drvdata(fsi_da7210_snd_device, &fsi_da7210_snd_devdata); 55 fsi_da7210_snd_devdata.dev = &fsi_da7210_snd_device->dev; 56 ret = platform_device_add(fsi_da7210_snd_device); 57 if (ret) 58 platform_device_put(fsi_da7210_snd_device); 59 60 return ret; 61} 62 63static void __exit fsi_da7210_sound_exit(void) 64{ 65 platform_device_unregister(fsi_da7210_snd_device); 66} 67 68module_init(fsi_da7210_sound_init); 69module_exit(fsi_da7210_sound_exit); 70 71/* Module information */ 72MODULE_DESCRIPTION("ALSA SoC FSI DA2710"); 73MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>"); 74MODULE_LICENSE("GPL"); 75