Commit af8a2fe1 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f2390880
...@@ -58,6 +58,7 @@ config MACH_AP4EVB ...@@ -58,6 +58,7 @@ config MACH_AP4EVB
depends on ARCH_SH7372 depends on ARCH_SH7372
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select SH_LCD_MIPI_DSI select SH_LCD_MIPI_DSI
select SND_SOC_AK4642 if SND_SIMPLE_CARD
choice choice
prompt "AP4EVB LCD panel selection" prompt "AP4EVB LCD panel selection"
...@@ -82,6 +83,7 @@ config MACH_MACKEREL ...@@ -82,6 +83,7 @@ config MACH_MACKEREL
bool "mackerel board" bool "mackerel board"
depends on ARCH_SH7372 depends on ARCH_SH7372
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select SND_SOC_AK4642 if SND_SIMPLE_CARD
config MACH_KOTA2 config MACH_KOTA2
bool "KOTA2 board" bool "KOTA2 board"
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
#include <sound/simple_card.h>
#include <video/sh_mobile_hdmi.h> #include <video/sh_mobile_hdmi.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
...@@ -785,17 +786,25 @@ static struct platform_device fsi_device = { ...@@ -785,17 +786,25 @@ static struct platform_device fsi_device = {
}, },
}; };
static struct fsi_ak4642_info fsi2_ak4643_info = { static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
.fmt = SND_SOC_DAIFMT_LEFT_J,
.codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
.sysclk = 11289600,
};
static struct asoc_simple_card_info fsi2_ak4643_info = {
.name = "AK4643", .name = "AK4643",
.card = "FSI2A-AK4643", .card = "FSI2A-AK4643",
.cpu_dai = "fsia-dai", .cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0013", .codec = "ak4642-codec.0-0013",
.platform = "sh_fsi2", .platform = "sh_fsi2",
.id = FSI_PORT_A, .codec_dai = "ak4642-hifi",
.init = &fsi2_ak4643_init_info,
}; };
static struct platform_device fsi_ak4643_device = { static struct platform_device fsi_ak4643_device = {
.name = "fsi-ak4642-audio", .name = "asoc-simple-card",
.dev = { .dev = {
.platform_data = &fsi2_ak4643_info, .platform_data = &fsi2_ak4643_info,
}, },
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/soc_camera_platform.h> #include <media/soc_camera_platform.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
#include <sound/simple_card.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/irqs.h> #include <mach/irqs.h>
...@@ -941,17 +942,25 @@ static struct platform_device fsi_device = { ...@@ -941,17 +942,25 @@ static struct platform_device fsi_device = {
}, },
}; };
static struct fsi_ak4642_info fsi2_ak4643_info = { static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
.fmt = SND_SOC_DAIFMT_LEFT_J,
.codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
.sysclk = 11289600,
};
static struct asoc_simple_card_info fsi2_ak4643_info = {
.name = "AK4643", .name = "AK4643",
.card = "FSI2A-AK4643", .card = "FSI2A-AK4643",
.cpu_dai = "fsia-dai", .cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0013", .codec = "ak4642-codec.0-0013",
.platform = "sh_fsi2", .platform = "sh_fsi2",
.id = FSI_PORT_A, .codec_dai = "ak4642-hifi",
.init = &fsi2_ak4643_init_info,
}; };
static struct platform_device fsi_ak4643_device = { static struct platform_device fsi_ak4643_device = {
.name = "fsi-ak4642-audio", .name = "asoc-simple-card",
.dev = { .dev = {
.platform_data = &fsi2_ak4643_info, .platform_data = &fsi2_ak4643_info,
}, },
......
...@@ -54,6 +54,7 @@ config SH_7724_SOLUTION_ENGINE ...@@ -54,6 +54,7 @@ config SH_7724_SOLUTION_ENGINE
select SOLUTION_ENGINE select SOLUTION_ENGINE
depends on CPU_SUBTYPE_SH7724 depends on CPU_SUBTYPE_SH7724
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select SND_SOC_AK4642 if SND_SIMPLE_CARD
help help
Select 7724 SolutionEngine if configuring for a Hitachi SH7724 Select 7724 SolutionEngine if configuring for a Hitachi SH7724
evaluation board. evaluation board.
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
#include <sound/simple_card.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/heartbeat.h> #include <asm/heartbeat.h>
#include <asm/clock.h> #include <asm/clock.h>
...@@ -304,17 +305,25 @@ static struct platform_device fsi_device = { ...@@ -304,17 +305,25 @@ static struct platform_device fsi_device = {
}, },
}; };
static struct fsi_ak4642_info fsi_ak4642_info = { static struct asoc_simple_dai_init_info fsi2_ak4642_init_info = {
.fmt = SND_SOC_DAIFMT_LEFT_J,
.codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
.sysclk = 11289600,
};
static struct asoc_simple_card_info fsi_ak4642_info = {
.name = "AK4642", .name = "AK4642",
.card = "FSIA-AK4642", .card = "FSIA-AK4642",
.cpu_dai = "fsia-dai", .cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0012", .codec = "ak4642-codec.0-0012",
.platform = "sh_fsi.0", .platform = "sh_fsi.0",
.id = FSI_PORT_A, .codec_dai = "ak4642-hifi",
.init = &fsi2_ak4642_init_info,
}; };
static struct platform_device fsi_ak4642_device = { static struct platform_device fsi_ak4642_device = {
.name = "fsi-ak4642-audio", .name = "asoc-simple-card",
.dev = { .dev = {
.platform_data = &fsi_ak4642_info, .platform_data = &fsi_ak4642_info,
}, },
......
...@@ -84,16 +84,4 @@ struct sh_fsi_platform_info { ...@@ -84,16 +84,4 @@ struct sh_fsi_platform_info {
struct sh_fsi_port_info port_b; struct sh_fsi_port_info port_b;
}; };
/*
* for fsi-ak4642
*/
struct fsi_ak4642_info {
const char *name;
const char *card;
const char *cpu_dai;
const char *codec;
const char *platform;
int id;
};
#endif /* __SOUND_FSI_H */ #endif /* __SOUND_FSI_H */
...@@ -46,14 +46,6 @@ config SND_SH7760_AC97 ...@@ -46,14 +46,6 @@ config SND_SH7760_AC97
This option enables generic sound support for the first This option enables generic sound support for the first
AC97 unit of the SH7760. AC97 unit of the SH7760.
config SND_FSI_AK4642
tristate "FSI-AK4642 sound support"
depends on SND_SOC_SH4_FSI && I2C
select SND_SOC_AK4642
help
This option enables generic sound support for the
FSI - AK4642 unit
config SND_FSI_DA7210 config SND_FSI_DA7210
tristate "FSI-DA7210 sound support" tristate "FSI-DA7210 sound support"
depends on SND_SOC_SH4_FSI && I2C depends on SND_SOC_SH4_FSI && I2C
......
...@@ -14,13 +14,11 @@ obj-$(CONFIG_SND_SOC_SH4_SIU) += snd-soc-siu.o ...@@ -14,13 +14,11 @@ obj-$(CONFIG_SND_SOC_SH4_SIU) += snd-soc-siu.o
## boards ## boards
snd-soc-sh7760-ac97-objs := sh7760-ac97.o snd-soc-sh7760-ac97-objs := sh7760-ac97.o
snd-soc-fsi-ak4642-objs := fsi-ak4642.o
snd-soc-fsi-da7210-objs := fsi-da7210.o snd-soc-fsi-da7210-objs := fsi-da7210.o
snd-soc-fsi-hdmi-objs := fsi-hdmi.o snd-soc-fsi-hdmi-objs := fsi-hdmi.o
snd-soc-migor-objs := migor.o snd-soc-migor-objs := migor.o
obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o
obj-$(CONFIG_SND_FSI_AK4642) += snd-soc-fsi-ak4642.o
obj-$(CONFIG_SND_FSI_DA7210) += snd-soc-fsi-da7210.o obj-$(CONFIG_SND_FSI_DA7210) += snd-soc-fsi-da7210.o
obj-$(CONFIG_SND_FSI_HDMI) += snd-soc-fsi-hdmi.o obj-$(CONFIG_SND_FSI_HDMI) += snd-soc-fsi-hdmi.o
obj-$(CONFIG_SND_SIU_MIGOR) += snd-soc-migor.o obj-$(CONFIG_SND_SIU_MIGOR) += snd-soc-migor.o
/*
* FSI-AK464x sound support for ms7724se
*
* Copyright (C) 2009 Renesas Solutions Corp.
* Kuninori Morimoto <morimoto.kuninori@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_ak4642_data {
const char *name;
const char *card;
const char *cpu_dai;
const char *codec;
const char *platform;
int id;
};
static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *codec = rtd->codec_dai;
struct snd_soc_dai *cpu = rtd->cpu_dai;
int ret;
ret = snd_soc_dai_set_fmt(codec, SND_SOC_DAIFMT_LEFT_J |
SND_SOC_DAIFMT_CBM_CFM);
if (ret < 0)
return ret;
ret = snd_soc_dai_set_sysclk(codec, 0, 11289600, 0);
if (ret < 0)
return ret;
ret = snd_soc_dai_set_fmt(cpu, SND_SOC_DAIFMT_LEFT_J |
SND_SOC_DAIFMT_CBS_CFS);
return ret;
}
static struct snd_soc_dai_link fsi_dai_link = {
.codec_dai_name = "ak4642-hifi",
.init = fsi_ak4642_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_ak4642_probe(struct platform_device *pdev)
{
int ret = -ENOMEM;
struct fsi_ak4642_info *pinfo = pdev->dev.platform_data;
if (!pinfo) {
dev_err(&pdev->dev, "no info for fsi ak4642\n");
goto out;
}
fsi_snd_device = platform_device_alloc("soc-audio", pinfo->id);
if (!fsi_snd_device)
goto out;
fsi_dai_link.name = pinfo->name;
fsi_dai_link.stream_name = pinfo->name;
fsi_dai_link.cpu_dai_name = pinfo->cpu_dai;
fsi_dai_link.platform_name = pinfo->platform;
fsi_dai_link.codec_name = pinfo->codec;
fsi_soc_card.name = pinfo->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_ak4642_remove(struct platform_device *pdev)
{
platform_device_unregister(fsi_snd_device);
return 0;
}
static struct platform_driver fsi_ak4642 = {
.driver = {
.name = "fsi-ak4642-audio",
},
.probe = fsi_ak4642_probe,
.remove = fsi_ak4642_remove,
};
module_platform_driver(fsi_ak4642);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment