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 <linux/module.h>
14 #include <sound/sh_fsi.h>
16 struct fsi_hdmi_data
{
22 static int fsi_hdmi_dai_init(struct snd_soc_pcm_runtime
*rtd
)
24 struct snd_soc_dai
*cpu
= rtd
->cpu_dai
;
27 ret
= snd_soc_dai_set_fmt(cpu
, SND_SOC_DAIFMT_CBM_CFM
);
32 static struct snd_soc_dai_link fsi_dai_link
= {
34 .stream_name
= "HDMI",
35 .codec_dai_name
= "sh_mobile_hdmi-hifi",
36 .platform_name
= "sh_fsi2",
37 .codec_name
= "sh-mobile-hdmi",
38 .init
= fsi_hdmi_dai_init
,
41 static struct snd_soc_card fsi_soc_card
= {
43 .dai_link
= &fsi_dai_link
,
47 static struct platform_device
*fsi_snd_device
;
49 static int fsi_hdmi_probe(struct platform_device
*pdev
)
52 const struct platform_device_id
*id_entry
;
53 struct fsi_hdmi_data
*pdata
;
55 id_entry
= pdev
->id_entry
;
57 dev_err(&pdev
->dev
, "unknown fsi hdmi\n");
61 pdata
= (struct fsi_hdmi_data
*)id_entry
->driver_data
;
63 fsi_snd_device
= platform_device_alloc("soc-audio", pdata
->id
);
67 fsi_dai_link
.cpu_dai_name
= pdata
->cpu_dai
;
68 fsi_soc_card
.name
= pdata
->card
;
70 platform_set_drvdata(fsi_snd_device
, &fsi_soc_card
);
71 ret
= platform_device_add(fsi_snd_device
);
74 platform_device_put(fsi_snd_device
);
80 static int fsi_hdmi_remove(struct platform_device
*pdev
)
82 platform_device_unregister(fsi_snd_device
);
86 static struct fsi_hdmi_data fsi2_a_hdmi
= {
87 .cpu_dai
= "fsia-dai",
92 static struct fsi_hdmi_data fsi2_b_hdmi
= {
93 .cpu_dai
= "fsib-dai",
98 static struct platform_device_id fsi_id_table
[] = {
100 { "sh_fsi2_a_hdmi", (kernel_ulong_t
)&fsi2_a_hdmi
},
101 { "sh_fsi2_b_hdmi", (kernel_ulong_t
)&fsi2_b_hdmi
},
105 static struct platform_driver fsi_hdmi
= {
107 .name
= "fsi-hdmi-audio",
109 .probe
= fsi_hdmi_probe
,
110 .remove
= fsi_hdmi_remove
,
111 .id_table
= fsi_id_table
,
114 module_platform_driver(fsi_hdmi
);
116 MODULE_LICENSE("GPL");
117 MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card");
118 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");