ASoC: sh: fsi: use simple-card instead of fsi-hdmi
Kuninori Morimoto [Mon, 9 Apr 2012 04:18:58 +0000 (21:18 -0700)]
This patch uses simple-card driver instead of fsi-hdmi on each board.
This patch removes fsi-hdmi driver which is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
sound/soc/sh/Kconfig
sound/soc/sh/Makefile
sound/soc/sh/fsi-hdmi.c [deleted file]

index b397512..8302265 100644 (file)
@@ -909,8 +909,26 @@ static struct platform_device lcdc1_device = {
        },
 };
 
+static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
+       .cpu_daifmt     = SND_SOC_DAIFMT_CBM_CFM,
+};
+
+static struct asoc_simple_card_info fsi2_hdmi_info = {
+       .name           = "HDMI",
+       .card           = "FSI2B-HDMI",
+       .cpu_dai        = "fsib-dai",
+       .codec          = "sh-mobile-hdmi",
+       .platform       = "sh_fsi2",
+       .codec_dai      = "sh_mobile_hdmi-hifi",
+       .init           = &fsi2_hdmi_init_info,
+};
+
 static struct platform_device fsi_hdmi_device = {
-       .name           = "sh_fsi2_b_hdmi",
+       .name   = "asoc-simple-card",
+       .id     = 1,
+       .dev    = {
+               .platform_data  = &fsi2_hdmi_info,
+       },
 };
 
 static struct gpio_led ap4evb_leds[] = {
index 4a46138..1bf1b2b 100644 (file)
@@ -503,8 +503,26 @@ static struct platform_device hdmi_lcdc_device = {
        },
 };
 
+static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
+       .cpu_daifmt     = SND_SOC_DAIFMT_CBM_CFM,
+};
+
+static struct asoc_simple_card_info fsi2_hdmi_info = {
+       .name           = "HDMI",
+       .card           = "FSI2B-HDMI",
+       .cpu_dai        = "fsib-dai",
+       .codec          = "sh-mobile-hdmi",
+       .platform       = "sh_fsi2",
+       .codec_dai      = "sh_mobile_hdmi-hifi",
+       .init           = &fsi2_hdmi_init_info,
+};
+
 static struct platform_device fsi_hdmi_device = {
-       .name           = "sh_fsi2_b_hdmi",
+       .name   = "asoc-simple-card",
+       .id     = 1,
+       .dev    = {
+               .platform_data  = &fsi2_hdmi_info,
+       },
 };
 
 static void __init hdmi_init_pm_clock(void)
index c68b90b..9ef49c8 100644 (file)
@@ -54,13 +54,6 @@ config SND_FSI_DA7210
          This option enables generic sound support for the
          FSI - DA7210 unit
 
-config SND_FSI_HDMI
-       tristate "FSI-HDMI sound support"
-       depends on SND_SOC_SH4_FSI && FB_SH_MOBILE_HDMI
-       help
-         This option enables generic sound support for the
-         FSI - HDMI unit
-
 config SND_SIU_MIGOR
        tristate "SIU sound support on Migo-R"
        depends on SH_MIGOR
index 01808cd..f37fc3a 100644 (file)
@@ -15,10 +15,8 @@ obj-$(CONFIG_SND_SOC_SH4_SIU)        += snd-soc-siu.o
 ## boards
 snd-soc-sh7760-ac97-objs       := sh7760-ac97.o
 snd-soc-fsi-da7210-objs                := fsi-da7210.o
-snd-soc-fsi-hdmi-objs          := fsi-hdmi.o
 snd-soc-migor-objs             := migor.o
 
 obj-$(CONFIG_SND_SH7760_AC97)  += snd-soc-sh7760-ac97.o
 obj-$(CONFIG_SND_FSI_DA7210)   += snd-soc-fsi-da7210.o
-obj-$(CONFIG_SND_FSI_HDMI)     += snd-soc-fsi-hdmi.o
 obj-$(CONFIG_SND_SIU_MIGOR)    += snd-soc-migor.o
diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c
deleted file mode 100644 (file)
index 6e41908..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * FSI - HDMI sound support
- *
- * Copyright (C) 2010 Renesas Solutions Corp.
- * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <sound/sh_fsi.h>
-
-struct fsi_hdmi_data {
-       const char *cpu_dai;
-       const char *card;
-       int id;
-};
-
-static int fsi_hdmi_dai_init(struct snd_soc_pcm_runtime *rtd)
-{
-       struct snd_soc_dai *cpu = rtd->cpu_dai;
-       int ret;
-
-       ret = snd_soc_dai_set_fmt(cpu, SND_SOC_DAIFMT_CBM_CFM);
-
-       return ret;
-}
-
-static struct snd_soc_dai_link fsi_dai_link = {
-       .name           = "HDMI",
-       .stream_name    = "HDMI",
-       .codec_dai_name = "sh_mobile_hdmi-hifi",
-       .platform_name  = "sh_fsi2",
-       .codec_name     = "sh-mobile-hdmi",
-       .init           = fsi_hdmi_dai_init,
-};
-
-static struct snd_soc_card fsi_soc_card  = {
-       .owner          = THIS_MODULE,
-       .dai_link       = &fsi_dai_link,
-       .num_links      = 1,
-};
-
-static struct platform_device *fsi_snd_device;
-
-static int fsi_hdmi_probe(struct platform_device *pdev)
-{
-       int ret = -ENOMEM;
-       const struct platform_device_id *id_entry;
-       struct fsi_hdmi_data *pdata;
-
-       id_entry = pdev->id_entry;
-       if (!id_entry) {
-               dev_err(&pdev->dev, "unknown fsi hdmi\n");
-               return -ENODEV;
-       }
-
-       pdata = (struct fsi_hdmi_data *)id_entry->driver_data;
-
-       fsi_snd_device = platform_device_alloc("soc-audio", pdata->id);
-       if (!fsi_snd_device)
-               goto out;
-
-       fsi_dai_link.cpu_dai_name       = pdata->cpu_dai;
-       fsi_soc_card.name               = pdata->card;
-
-       platform_set_drvdata(fsi_snd_device, &fsi_soc_card);
-       ret = platform_device_add(fsi_snd_device);
-
-       if (ret)
-               platform_device_put(fsi_snd_device);
-
-out:
-       return ret;
-}
-
-static int fsi_hdmi_remove(struct platform_device *pdev)
-{
-       platform_device_unregister(fsi_snd_device);
-       return 0;
-}
-
-static struct fsi_hdmi_data fsi2_a_hdmi = {
-       .cpu_dai        = "fsia-dai",
-       .card           = "FSI2A-HDMI",
-       .id             = FSI_PORT_A,
-};
-
-static struct fsi_hdmi_data fsi2_b_hdmi = {
-       .cpu_dai        = "fsib-dai",
-       .card           = "FSI2B-HDMI",
-       .id             = FSI_PORT_B,
-};
-
-static struct platform_device_id fsi_id_table[] = {
-       /* FSI 2 */
-       { "sh_fsi2_a_hdmi",     (kernel_ulong_t)&fsi2_a_hdmi },
-       { "sh_fsi2_b_hdmi",     (kernel_ulong_t)&fsi2_b_hdmi },
-       {},
-};
-
-static struct platform_driver fsi_hdmi = {
-       .driver = {
-               .name   = "fsi-hdmi-audio",
-       },
-       .probe          = fsi_hdmi_probe,
-       .remove         = fsi_hdmi_remove,
-       .id_table       = fsi_id_table,
-};
-
-module_platform_driver(fsi_hdmi);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card");
-MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");