aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-04-09 00:18:28 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-13 06:29:26 -0400
commitaf8a2fe12fae1b59178dc96e396e5665bcbea7da (patch)
treefd8d1e36ff014148a16a34c501806d464c5cc0e8
parentf2390880ec0264a0ed26b32c23bc23435b4297da (diff)
ASoC: sh: fsi: use simple-card instead of fsi-ak4642
This patch uses simple-card driver instead of fsi-ak4642 on each board. To select AK4642 driver, each boards select it on Kconfig. This patch removes fsi-ak4642 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>
-rw-r--r--arch/arm/mach-shmobile/Kconfig2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c15
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c15
-rw-r--r--arch/sh/boards/Kconfig1
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c15
-rw-r--r--include/sound/sh_fsi.h12
-rw-r--r--sound/soc/sh/Kconfig8
-rw-r--r--sound/soc/sh/Makefile2
-rw-r--r--sound/soc/sh/fsi-ak4642.c108
9 files changed, 39 insertions, 139 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 34560cab45d9..2cda0c2af230 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -58,6 +58,7 @@ config MACH_AP4EVB
58 depends on ARCH_SH7372 58 depends on ARCH_SH7372
59 select ARCH_REQUIRE_GPIOLIB 59 select ARCH_REQUIRE_GPIOLIB
60 select SH_LCD_MIPI_DSI 60 select SH_LCD_MIPI_DSI
61 select SND_SOC_AK4642 if SND_SIMPLE_CARD
61 62
62choice 63choice
63 prompt "AP4EVB LCD panel selection" 64 prompt "AP4EVB LCD panel selection"
@@ -82,6 +83,7 @@ config MACH_MACKEREL
82 bool "mackerel board" 83 bool "mackerel board"
83 depends on ARCH_SH7372 84 depends on ARCH_SH7372
84 select ARCH_REQUIRE_GPIOLIB 85 select ARCH_REQUIRE_GPIOLIB
86 select SND_SOC_AK4642 if SND_SIMPLE_CARD
85 87
86config MACH_KOTA2 88config MACH_KOTA2
87 bool "KOTA2 board" 89 bool "KOTA2 board"
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index b56dde2732bb..b39751244daa 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -50,6 +50,7 @@
50#include <media/soc_camera.h> 50#include <media/soc_camera.h>
51 51
52#include <sound/sh_fsi.h> 52#include <sound/sh_fsi.h>
53#include <sound/simple_card.h>
53 54
54#include <video/sh_mobile_hdmi.h> 55#include <video/sh_mobile_hdmi.h>
55#include <video/sh_mobile_lcdc.h> 56#include <video/sh_mobile_lcdc.h>
@@ -785,17 +786,25 @@ static struct platform_device fsi_device = {
785 }, 786 },
786}; 787};
787 788
788static struct fsi_ak4642_info fsi2_ak4643_info = { 789static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
790 .fmt = SND_SOC_DAIFMT_LEFT_J,
791 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
792 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
793 .sysclk = 11289600,
794};
795
796static struct asoc_simple_card_info fsi2_ak4643_info = {
789 .name = "AK4643", 797 .name = "AK4643",
790 .card = "FSI2A-AK4643", 798 .card = "FSI2A-AK4643",
791 .cpu_dai = "fsia-dai", 799 .cpu_dai = "fsia-dai",
792 .codec = "ak4642-codec.0-0013", 800 .codec = "ak4642-codec.0-0013",
793 .platform = "sh_fsi2", 801 .platform = "sh_fsi2",
794 .id = FSI_PORT_A, 802 .codec_dai = "ak4642-hifi",
803 .init = &fsi2_ak4643_init_info,
795}; 804};
796 805
797static struct platform_device fsi_ak4643_device = { 806static struct platform_device fsi_ak4643_device = {
798 .name = "fsi-ak4642-audio", 807 .name = "asoc-simple-card",
799 .dev = { 808 .dev = {
800 .platform_data = &fsi2_ak4643_info, 809 .platform_data = &fsi2_ak4643_info,
801 }, 810 },
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index f49e28abe0ab..4a461384d27c 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -53,6 +53,7 @@
53#include <media/soc_camera.h> 53#include <media/soc_camera.h>
54#include <media/soc_camera_platform.h> 54#include <media/soc_camera_platform.h>
55#include <sound/sh_fsi.h> 55#include <sound/sh_fsi.h>
56#include <sound/simple_card.h>
56 57
57#include <mach/common.h> 58#include <mach/common.h>
58#include <mach/irqs.h> 59#include <mach/irqs.h>
@@ -941,17 +942,25 @@ static struct platform_device fsi_device = {
941 }, 942 },
942}; 943};
943 944
944static struct fsi_ak4642_info fsi2_ak4643_info = { 945static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
946 .fmt = SND_SOC_DAIFMT_LEFT_J,
947 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
948 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
949 .sysclk = 11289600,
950};
951
952static struct asoc_simple_card_info fsi2_ak4643_info = {
945 .name = "AK4643", 953 .name = "AK4643",
946 .card = "FSI2A-AK4643", 954 .card = "FSI2A-AK4643",
947 .cpu_dai = "fsia-dai", 955 .cpu_dai = "fsia-dai",
948 .codec = "ak4642-codec.0-0013", 956 .codec = "ak4642-codec.0-0013",
949 .platform = "sh_fsi2", 957 .platform = "sh_fsi2",
950 .id = FSI_PORT_A, 958 .codec_dai = "ak4642-hifi",
959 .init = &fsi2_ak4643_init_info,
951}; 960};
952 961
953static struct platform_device fsi_ak4643_device = { 962static struct platform_device fsi_ak4643_device = {
954 .name = "fsi-ak4642-audio", 963 .name = "asoc-simple-card",
955 .dev = { 964 .dev = {
956 .platform_data = &fsi2_ak4643_info, 965 .platform_data = &fsi2_ak4643_info,
957 }, 966 },
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index d893411022d5..0da49f3b0f4f 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -54,6 +54,7 @@ config SH_7724_SOLUTION_ENGINE
54 select SOLUTION_ENGINE 54 select SOLUTION_ENGINE
55 depends on CPU_SUBTYPE_SH7724 55 depends on CPU_SUBTYPE_SH7724
56 select ARCH_REQUIRE_GPIOLIB 56 select ARCH_REQUIRE_GPIOLIB
57 select SND_SOC_AK4642 if SND_SIMPLE_CARD
57 help 58 help
58 Select 7724 SolutionEngine if configuring for a Hitachi SH7724 59 Select 7724 SolutionEngine if configuring for a Hitachi SH7724
59 evaluation board. 60 evaluation board.
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index c540b16547c3..5cc5ed44d9af 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -28,6 +28,7 @@
28#include <video/sh_mobile_lcdc.h> 28#include <video/sh_mobile_lcdc.h>
29#include <media/sh_mobile_ceu.h> 29#include <media/sh_mobile_ceu.h>
30#include <sound/sh_fsi.h> 30#include <sound/sh_fsi.h>
31#include <sound/simple_card.h>
31#include <asm/io.h> 32#include <asm/io.h>
32#include <asm/heartbeat.h> 33#include <asm/heartbeat.h>
33#include <asm/clock.h> 34#include <asm/clock.h>
@@ -304,17 +305,25 @@ static struct platform_device fsi_device = {
304 }, 305 },
305}; 306};
306 307
307static struct fsi_ak4642_info fsi_ak4642_info = { 308static struct asoc_simple_dai_init_info fsi2_ak4642_init_info = {
309 .fmt = SND_SOC_DAIFMT_LEFT_J,
310 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
311 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
312 .sysclk = 11289600,
313};
314
315static struct asoc_simple_card_info fsi_ak4642_info = {
308 .name = "AK4642", 316 .name = "AK4642",
309 .card = "FSIA-AK4642", 317 .card = "FSIA-AK4642",
310 .cpu_dai = "fsia-dai", 318 .cpu_dai = "fsia-dai",
311 .codec = "ak4642-codec.0-0012", 319 .codec = "ak4642-codec.0-0012",
312 .platform = "sh_fsi.0", 320 .platform = "sh_fsi.0",
313 .id = FSI_PORT_A, 321 .codec_dai = "ak4642-hifi",
322 .init = &fsi2_ak4642_init_info,
314}; 323};
315 324
316static struct platform_device fsi_ak4642_device = { 325static struct platform_device fsi_ak4642_device = {
317 .name = "fsi-ak4642-audio", 326 .name = "asoc-simple-card",
318 .dev = { 327 .dev = {
319 .platform_data = &fsi_ak4642_info, 328 .platform_data = &fsi_ak4642_info,
320 }, 329 },
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index b457e87fbd08..956e30e89ea8 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -84,16 +84,4 @@ struct sh_fsi_platform_info {
84 struct sh_fsi_port_info port_b; 84 struct sh_fsi_port_info port_b;
85}; 85};
86 86
87/*
88 * for fsi-ak4642
89 */
90struct fsi_ak4642_info {
91 const char *name;
92 const char *card;
93 const char *cpu_dai;
94 const char *codec;
95 const char *platform;
96 int id;
97};
98
99#endif /* __SOUND_FSI_H */ 87#endif /* __SOUND_FSI_H */
diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig
index d8e06a607a22..c68b90b29959 100644
--- a/sound/soc/sh/Kconfig
+++ b/sound/soc/sh/Kconfig
@@ -46,14 +46,6 @@ config SND_SH7760_AC97
46 This option enables generic sound support for the first 46 This option enables generic sound support for the first
47 AC97 unit of the SH7760. 47 AC97 unit of the SH7760.
48 48
49config SND_FSI_AK4642
50 tristate "FSI-AK4642 sound support"
51 depends on SND_SOC_SH4_FSI && I2C
52 select SND_SOC_AK4642
53 help
54 This option enables generic sound support for the
55 FSI - AK4642 unit
56
57config SND_FSI_DA7210 49config SND_FSI_DA7210
58 tristate "FSI-DA7210 sound support" 50 tristate "FSI-DA7210 sound support"
59 depends on SND_SOC_SH4_FSI && I2C 51 depends on SND_SOC_SH4_FSI && I2C
diff --git a/sound/soc/sh/Makefile b/sound/soc/sh/Makefile
index 94476d4c0fd5..01808cd0e6f6 100644
--- a/sound/soc/sh/Makefile
+++ b/sound/soc/sh/Makefile
@@ -14,13 +14,11 @@ obj-$(CONFIG_SND_SOC_SH4_SIU) += snd-soc-siu.o
14 14
15## boards 15## boards
16snd-soc-sh7760-ac97-objs := sh7760-ac97.o 16snd-soc-sh7760-ac97-objs := sh7760-ac97.o
17snd-soc-fsi-ak4642-objs := fsi-ak4642.o
18snd-soc-fsi-da7210-objs := fsi-da7210.o 17snd-soc-fsi-da7210-objs := fsi-da7210.o
19snd-soc-fsi-hdmi-objs := fsi-hdmi.o 18snd-soc-fsi-hdmi-objs := fsi-hdmi.o
20snd-soc-migor-objs := migor.o 19snd-soc-migor-objs := migor.o
21 20
22obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o 21obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o
23obj-$(CONFIG_SND_FSI_AK4642) += snd-soc-fsi-ak4642.o
24obj-$(CONFIG_SND_FSI_DA7210) += snd-soc-fsi-da7210.o 22obj-$(CONFIG_SND_FSI_DA7210) += snd-soc-fsi-da7210.o
25obj-$(CONFIG_SND_FSI_HDMI) += snd-soc-fsi-hdmi.o 23obj-$(CONFIG_SND_FSI_HDMI) += snd-soc-fsi-hdmi.o
26obj-$(CONFIG_SND_SIU_MIGOR) += snd-soc-migor.o 24obj-$(CONFIG_SND_SIU_MIGOR) += snd-soc-migor.o
diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
deleted file mode 100644
index 97f540aabbdd..000000000000
--- a/sound/soc/sh/fsi-ak4642.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * FSI-AK464x sound support for ms7724se
3 *
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@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 <linux/module.h>
14#include <sound/sh_fsi.h>
15
16struct fsi_ak4642_data {
17 const char *name;
18 const char *card;
19 const char *cpu_dai;
20 const char *codec;
21 const char *platform;
22 int id;
23};
24
25static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd)
26{
27 struct snd_soc_dai *codec = rtd->codec_dai;
28 struct snd_soc_dai *cpu = rtd->cpu_dai;
29 int ret;
30
31 ret = snd_soc_dai_set_fmt(codec, SND_SOC_DAIFMT_LEFT_J |
32 SND_SOC_DAIFMT_CBM_CFM);
33 if (ret < 0)
34 return ret;
35
36 ret = snd_soc_dai_set_sysclk(codec, 0, 11289600, 0);
37 if (ret < 0)
38 return ret;
39
40 ret = snd_soc_dai_set_fmt(cpu, SND_SOC_DAIFMT_LEFT_J |
41 SND_SOC_DAIFMT_CBS_CFS);
42
43 return ret;
44}
45
46static struct snd_soc_dai_link fsi_dai_link = {
47 .codec_dai_name = "ak4642-hifi",
48 .init = fsi_ak4642_dai_init,
49};
50
51static struct snd_soc_card fsi_soc_card = {
52 .owner = THIS_MODULE,
53 .dai_link = &fsi_dai_link,
54 .num_links = 1,
55};
56
57static struct platform_device *fsi_snd_device;
58
59static int fsi_ak4642_probe(struct platform_device *pdev)
60{
61 int ret = -ENOMEM;
62 struct fsi_ak4642_info *pinfo = pdev->dev.platform_data;
63
64 if (!pinfo) {
65 dev_err(&pdev->dev, "no info for fsi ak4642\n");
66 goto out;
67 }
68
69 fsi_snd_device = platform_device_alloc("soc-audio", pinfo->id);
70 if (!fsi_snd_device)
71 goto out;
72
73 fsi_dai_link.name = pinfo->name;
74 fsi_dai_link.stream_name = pinfo->name;
75 fsi_dai_link.cpu_dai_name = pinfo->cpu_dai;
76 fsi_dai_link.platform_name = pinfo->platform;
77 fsi_dai_link.codec_name = pinfo->codec;
78 fsi_soc_card.name = pinfo->card;
79
80 platform_set_drvdata(fsi_snd_device, &fsi_soc_card);
81 ret = platform_device_add(fsi_snd_device);
82
83 if (ret)
84 platform_device_put(fsi_snd_device);
85
86out:
87 return ret;
88}
89
90static int fsi_ak4642_remove(struct platform_device *pdev)
91{
92 platform_device_unregister(fsi_snd_device);
93 return 0;
94}
95
96static struct platform_driver fsi_ak4642 = {
97 .driver = {
98 .name = "fsi-ak4642-audio",
99 },
100 .probe = fsi_ak4642_probe,
101 .remove = fsi_ak4642_remove,
102};
103
104module_platform_driver(fsi_ak4642);
105
106MODULE_LICENSE("GPL");
107MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
108MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");