* [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection
@ 2011-01-12 6:31 Kuninori Morimoto
2011-01-12 6:32 ` [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id Kuninori Morimoto
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2011-01-12 6:31 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood
Dear Mark, Liam
Kuninori Morimoto (2):
ASoC: sh: fsi-ak4642: fixup platform device id
ASoC: sh: fsi-hdmi: Add FSI port and HDMI selection
1st patch fixup platform device id.
2nd patch add FSI PortA/B selection to FSI-HDMI
These patches are tested on Ecovec, AP4EVB, Mackerel board,
and Paul's rmobile-latest + Mark's for-2.6.38 branch.
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id
2011-01-12 6:31 [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Kuninori Morimoto
@ 2011-01-12 6:32 ` Kuninori Morimoto
2011-01-12 23:22 ` Mark Brown
2011-01-12 6:34 ` [PATCH 2/2] ASoC: sh: fsi-hdmi: Add FSI Port/HDMI selection Kuninori Morimoto
2011-01-12 11:13 ` [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Liam Girdwood
2 siblings, 1 reply; 5+ messages in thread
From: Kuninori Morimoto @ 2011-01-12 6:32 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/sh/fsi-ak4642.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
index 88fff23..ce058c7 100644
--- a/sound/soc/sh/fsi-ak4642.c
+++ b/sound/soc/sh/fsi-ak4642.c
@@ -18,6 +18,7 @@ struct fsi_ak4642_data {
const char *cpu_dai;
const char *codec;
const char *platform;
+ int id;
};
static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd)
@@ -66,7 +67,7 @@ static int fsi_ak4642_probe(struct platform_device *pdev)
pdata = (struct fsi_ak4642_data *)id_entry->driver_data;
- fsi_snd_device = platform_device_alloc("soc-audio", FSI_PORT_A);
+ fsi_snd_device = platform_device_alloc("soc-audio", pdata->id);
if (!fsi_snd_device)
goto out;
@@ -99,6 +100,7 @@ static struct fsi_ak4642_data fsi_a_ak4642 = {
.cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0012",
.platform = "sh_fsi.0",
+ .id = FSI_PORT_A,
};
static struct fsi_ak4642_data fsi_b_ak4642 = {
@@ -107,6 +109,7 @@ static struct fsi_ak4642_data fsi_b_ak4642 = {
.cpu_dai = "fsib-dai",
.codec = "ak4642-codec.0-0012",
.platform = "sh_fsi.0",
+ .id = FSI_PORT_B,
};
static struct fsi_ak4642_data fsi_a_ak4643 = {
@@ -115,6 +118,7 @@ static struct fsi_ak4642_data fsi_a_ak4643 = {
.cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0013",
.platform = "sh_fsi.0",
+ .id = FSI_PORT_A,
};
static struct fsi_ak4642_data fsi_b_ak4643 = {
@@ -123,6 +127,7 @@ static struct fsi_ak4642_data fsi_b_ak4643 = {
.cpu_dai = "fsib-dai",
.codec = "ak4642-codec.0-0013",
.platform = "sh_fsi.0",
+ .id = FSI_PORT_B,
};
static struct fsi_ak4642_data fsi2_a_ak4642 = {
@@ -131,6 +136,7 @@ static struct fsi_ak4642_data fsi2_a_ak4642 = {
.cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0012",
.platform = "sh_fsi2",
+ .id = FSI_PORT_A,
};
static struct fsi_ak4642_data fsi2_b_ak4642 = {
@@ -139,6 +145,7 @@ static struct fsi_ak4642_data fsi2_b_ak4642 = {
.cpu_dai = "fsib-dai",
.codec = "ak4642-codec.0-0012",
.platform = "sh_fsi2",
+ .id = FSI_PORT_B,
};
static struct fsi_ak4642_data fsi2_a_ak4643 = {
@@ -147,6 +154,7 @@ static struct fsi_ak4642_data fsi2_a_ak4643 = {
.cpu_dai = "fsia-dai",
.codec = "ak4642-codec.0-0013",
.platform = "sh_fsi2",
+ .id = FSI_PORT_A,
};
static struct fsi_ak4642_data fsi2_b_ak4643 = {
@@ -155,6 +163,7 @@ static struct fsi_ak4642_data fsi2_b_ak4643 = {
.cpu_dai = "fsib-dai",
.codec = "ak4642-codec.0-0013",
.platform = "sh_fsi2",
+ .id = FSI_PORT_B,
};
static struct platform_device_id fsi_id_table[] = {
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ASoC: sh: fsi-hdmi: Add FSI Port/HDMI selection
2011-01-12 6:31 [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Kuninori Morimoto
2011-01-12 6:32 ` [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id Kuninori Morimoto
@ 2011-01-12 6:34 ` Kuninori Morimoto
2011-01-12 11:13 ` [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Liam Girdwood
2 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2011-01-12 6:34 UTC (permalink / raw)
To: Paul Mundt, Mark Brown; +Cc: Linux-ALSA, Liam Girdwood
This patch add platform_device_id which can control
FSI2 PortA/PortB from platform data.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
Paul
Can you please check this patch ?
It add new platform data to board-ap4evb, board-mackerel
arch/arm/mach-shmobile/board-ap4evb.c | 5 ++
arch/arm/mach-shmobile/board-mackerel.c | 5 ++
sound/soc/sh/fsi-hdmi.c | 66 ++++++++++++++++++++++++++++--
3 files changed, 71 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 246bf32..32e7ae2 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -783,6 +783,10 @@ static struct platform_device hdmi_device = {
},
};
+static struct platform_device fsi_hdmi_device = {
+ .name = "sh_fsi2_b_hdmi",
+};
+
static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
unsigned long *parent_freq)
{
@@ -936,6 +940,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
&usb1_host_device,
&fsi_device,
&fsi_ak4643_device,
+ &fsi_hdmi_device,
&sh_mmcif_device,
&lcdc1_device,
&lcdc_device,
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 7a383d5..d8ef724 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -421,6 +421,10 @@ static struct platform_device hdmi_device = {
},
};
+static struct platform_device fsi_hdmi_device = {
+ .name = "sh_fsi2_b_hdmi",
+};
+
static int __init hdmi_init_pm_clock(void)
{
struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
@@ -934,6 +938,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
&leds_device,
&fsi_device,
&fsi_ak4643_device,
+ &fsi_hdmi_device,
&sdhi0_device,
#if !defined(CONFIG_MMC_SH_MMCIF)
&sdhi1_device,
diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c
index 96d8ce3..9719985 100644
--- a/sound/soc/sh/fsi-hdmi.c
+++ b/sound/soc/sh/fsi-hdmi.c
@@ -12,6 +12,12 @@
#include <linux/platform_device.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;
@@ -25,7 +31,6 @@ static int fsi_hdmi_dai_init(struct snd_soc_pcm_runtime *rtd)
static struct snd_soc_dai_link fsi_dai_link = {
.name = "HDMI",
.stream_name = "HDMI",
- .cpu_dai_name = "fsib-dai", /* fsi B */
.codec_dai_name = "sh_mobile_hdmi-hifi",
.platform_name = "sh_fsi2",
.codec_name = "sh-mobile-hdmi",
@@ -33,21 +38,33 @@ static struct snd_soc_dai_link fsi_dai_link = {
};
static struct snd_soc_card fsi_soc_card = {
- .name = "FSI (SH MOBILE HDMI)",
.dai_link = &fsi_dai_link,
.num_links = 1,
};
static struct platform_device *fsi_snd_device;
-static int __init fsi_hdmi_init(void)
+static int fsi_hdmi_probe(struct platform_device *pdev)
{
int ret = -ENOMEM;
+ const struct platform_device_id *id_entry;
+ struct fsi_hdmi_data *pdata;
- fsi_snd_device = platform_device_alloc("soc-audio", FSI_PORT_B);
+ 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);
@@ -58,9 +75,48 @@ out:
return ret;
}
-static void __exit fsi_hdmi_exit(void)
+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 (SH MOBILE HDMI)",
+ .id = FSI_PORT_A,
+};
+
+static struct fsi_hdmi_data fsi2_b_hdmi = {
+ .cpu_dai = "fsib-dai",
+ .card = "FSI2B (SH MOBILE 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,
+};
+
+static int __init fsi_hdmi_init(void)
+{
+ return platform_driver_register(&fsi_hdmi);
+}
+
+static void __exit fsi_hdmi_exit(void)
+{
+ platform_driver_unregister(&fsi_hdmi);
}
module_init(fsi_hdmi_init);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection
2011-01-12 6:31 [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Kuninori Morimoto
2011-01-12 6:32 ` [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id Kuninori Morimoto
2011-01-12 6:34 ` [PATCH 2/2] ASoC: sh: fsi-hdmi: Add FSI Port/HDMI selection Kuninori Morimoto
@ 2011-01-12 11:13 ` Liam Girdwood
2 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-01-12 11:13 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown
On Wed, 2011-01-12 at 15:31 +0900, Kuninori Morimoto wrote:
> Dear Mark, Liam
>
> Kuninori Morimoto (2):
> ASoC: sh: fsi-ak4642: fixup platform device id
> ASoC: sh: fsi-hdmi: Add FSI port and HDMI selection
>
> 1st patch fixup platform device id.
> 2nd patch add FSI PortA/B selection to FSI-HDMI
>
> These patches are tested on Ecovec, AP4EVB, Mackerel board,
> and Paul's rmobile-latest + Mark's for-2.6.38 branch.
>
> Best regards
> --
> Kuninori Morimoto
>
All
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id
2011-01-12 6:32 ` [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id Kuninori Morimoto
@ 2011-01-12 23:22 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-01-12 23:22 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Linux-ALSA, Liam Girdwood
On Wed, Jan 12, 2011 at 03:32:07PM +0900, Kuninori Morimoto wrote:
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Applied. It'd be really helpful if you could provide more verbose
changelogs - with this one it's really not clear what the problem is
that you're fixing or how the change fixes it.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-12 23:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 6:31 [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Kuninori Morimoto
2011-01-12 6:32 ` [PATCH 1/2] ASoC: sh: fsi-ak4642: fixup platform device id Kuninori Morimoto
2011-01-12 23:22 ` Mark Brown
2011-01-12 6:34 ` [PATCH 2/2] ASoC: sh: fsi-hdmi: Add FSI Port/HDMI selection Kuninori Morimoto
2011-01-12 11:13 ` [PATCH 0/2] ASoC: sh: fsi-codecs: add/modify FSI selection Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).