Kuninori Morimoto | 41a686e | 2010-08-31 14:46:53 +0900 | [diff] [blame] | 1 | /* |
| 2 | * FSI - HDMI sound support |
| 3 | * |
| 4 | * Copyright (C) 2010 Renesas Solutions Corp. |
| 5 | * Kuninori Morimoto <kuninori.morimoto.gx@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 | |
| 12 | #include <linux/platform_device.h> |
| 13 | #include <sound/sh_fsi.h> |
Kuninori Morimoto | 41a686e | 2010-08-31 14:46:53 +0900 | [diff] [blame] | 14 | |
| 15 | static struct snd_soc_dai_link fsi_dai_link = { |
| 16 | .name = "HDMI", |
| 17 | .stream_name = "HDMI", |
| 18 | .cpu_dai_name = "fsib-dai", /* fsi B */ |
| 19 | .codec_dai_name = "sh_mobile_hdmi-hifi", |
| 20 | .platform_name = "sh_fsi2", |
| 21 | .codec_name = "sh-mobile-hdmi", |
| 22 | }; |
| 23 | |
| 24 | static struct snd_soc_card fsi_soc_card = { |
Kuninori Morimoto | 1c7fc7e | 2010-09-13 19:40:13 +0900 | [diff] [blame] | 25 | .name = "FSI (SH MOBILE HDMI)", |
Kuninori Morimoto | 41a686e | 2010-08-31 14:46:53 +0900 | [diff] [blame] | 26 | .dai_link = &fsi_dai_link, |
| 27 | .num_links = 1, |
| 28 | }; |
| 29 | |
| 30 | static struct platform_device *fsi_snd_device; |
| 31 | |
| 32 | static int __init fsi_hdmi_init(void) |
| 33 | { |
| 34 | int ret = -ENOMEM; |
| 35 | |
| 36 | fsi_snd_device = platform_device_alloc("soc-audio", FSI_PORT_B); |
| 37 | if (!fsi_snd_device) |
| 38 | goto out; |
| 39 | |
| 40 | platform_set_drvdata(fsi_snd_device, &fsi_soc_card); |
| 41 | ret = platform_device_add(fsi_snd_device); |
| 42 | |
| 43 | if (ret) |
| 44 | platform_device_put(fsi_snd_device); |
| 45 | |
| 46 | out: |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 50 | static void __exit fsi_hdmi_exit(void) |
| 51 | { |
| 52 | platform_device_unregister(fsi_snd_device); |
| 53 | } |
| 54 | |
| 55 | module_init(fsi_hdmi_init); |
| 56 | module_exit(fsi_hdmi_exit); |
| 57 | |
| 58 | MODULE_LICENSE("GPL"); |
| 59 | MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card"); |
| 60 | MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"); |