2 * FSI - HDMI sound support
4 * Copyright (C) 2010 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@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 <sound/sh_fsi.h>
15 struct fsi_hdmi_data
{
21 static int fsi_hdmi_dai_init(struct snd_soc_pcm_runtime
*rtd
)
23 struct snd_soc_dai
*cpu
= rtd
->cpu_dai
;
26 ret
= snd_soc_dai_set_fmt(cpu
, SND_SOC_DAIFMT_CBM_CFM
);
31 static struct snd_soc_dai_link fsi_dai_link
= {
33 .stream_name
= "HDMI",
34 .codec_dai_name
= "sh_mobile_hdmi-hifi",
35 .platform_name
= "sh_fsi2",
36 .codec_name
= "sh-mobile-hdmi",
37 .init
= fsi_hdmi_dai_init
,
40 static struct snd_soc_card fsi_soc_card
= {
41 .dai_link
= &fsi_dai_link
,
45 static struct platform_device
*fsi_snd_device
;
47 static int fsi_hdmi_probe(struct platform_device
*pdev
)
50 const struct platform_device_id
*id_entry
;
51 struct fsi_hdmi_data
*pdata
;
53 id_entry
= pdev
->id_entry
;
55 dev_err(&pdev
->dev
, "unknown fsi hdmi\n");
59 pdata
= (struct fsi_hdmi_data
*)id_entry
->driver_data
;
61 fsi_snd_device
= platform_device_alloc("soc-audio", pdata
->id
);
65 fsi_dai_link
.cpu_dai_name
= pdata
->cpu_dai
;
66 fsi_soc_card
.name
= pdata
->card
;
68 platform_set_drvdata(fsi_snd_device
, &fsi_soc_card
);
69 ret
= platform_device_add(fsi_snd_device
);
72 platform_device_put(fsi_snd_device
);
78 static int fsi_hdmi_remove(struct platform_device
*pdev
)
80 platform_device_unregister(fsi_snd_device
);
84 static struct fsi_hdmi_data fsi2_a_hdmi
= {
85 .cpu_dai
= "fsia-dai",
90 static struct fsi_hdmi_data fsi2_b_hdmi
= {
91 .cpu_dai
= "fsib-dai",
96 static struct platform_device_id fsi_id_table
[] = {
98 { "sh_fsi2_a_hdmi", (kernel_ulong_t
)&fsi2_a_hdmi
},
99 { "sh_fsi2_b_hdmi", (kernel_ulong_t
)&fsi2_b_hdmi
},
103 static struct platform_driver fsi_hdmi
= {
105 .name
= "fsi-hdmi-audio",
107 .probe
= fsi_hdmi_probe
,
108 .remove
= fsi_hdmi_remove
,
109 .id_table
= fsi_id_table
,
112 static int __init
fsi_hdmi_init(void)
114 return platform_driver_register(&fsi_hdmi
);
117 static void __exit
fsi_hdmi_exit(void)
119 platform_driver_unregister(&fsi_hdmi
);
122 module_init(fsi_hdmi_init
);
123 module_exit(fsi_hdmi_exit
);
125 MODULE_LICENSE("GPL");
126 MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card");
127 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");