diff options
author | NeilBrown <neilb@suse.de> | 2011-12-19 08:06:18 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-05-17 17:04:25 +1000 |
commit | 70c896fa3a2ae674e071c229f4279f0712ec03fc (patch) | |
tree | eda1c408b38b809c9715b7d955c70eb0c543659c /sound/soc/omap | |
parent | abcc8a428730340928b58c0f7eabf6c36f96464a (diff) | |
download | kernel_goldelico_gta04-70c896fa3a2ae674e071c229f4279f0712ec03fc.zip kernel_goldelico_gta04-70c896fa3a2ae674e071c229f4279f0712ec03fc.tar.gz kernel_goldelico_gta04-70c896fa3a2ae674e071c229f4279f0712ec03fc.tar.bz2 |
Hacking around with sound.
Trying to make sound work on gta04. Still work to do.
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/Makefile | 3 | ||||
-rw-r--r-- | sound/soc/omap/gta04-audio.c | 33 | ||||
-rw-r--r-- | sound/soc/omap/gta04-fm.c | 14 | ||||
-rw-r--r-- | sound/soc/omap/gta04-headset.c | 4 | ||||
-rw-r--r-- | sound/soc/omap/gta04-voice.c | 4 |
5 files changed, 30 insertions, 28 deletions
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile index 5337069..e3f3885 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile @@ -20,7 +20,8 @@ snd-soc-am3517evm-objs := am3517evm.o snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o snd-soc-omap-twl4030-objs := omap-twl4030.o snd-soc-omap3pandora-objs := omap3pandora.o -snd-soc-gta04-objs := gta04-audio.o gta04-voice.o gta04-headset.o gta04-fm.o +snd-soc-gta04-objs := gta04-audio.o gta04-voice.o gta04-headset.o +# gta04-fm.o snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o diff --git a/sound/soc/omap/gta04-audio.c b/sound/soc/omap/gta04-audio.c index 3d55038..78fa530 100644 --- a/sound/soc/omap/gta04-audio.c +++ b/sound/soc/omap/gta04-audio.c @@ -22,6 +22,7 @@ #include <linux/clk.h> #include <linux/platform_device.h> +#include <linux/module.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> @@ -135,13 +136,14 @@ static const struct snd_soc_dapm_route audio_map[] = { */ }; -static int omap3gta04_init(struct snd_soc_codec *codec) +static int omap3gta04_init(struct snd_soc_pcm_runtime *runtime) { int ret; + struct snd_soc_codec *codec = runtime->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; ret = snd_soc_dapm_new_controls(dapm, gta04_dapm_widgets, - ARRAY_SIZE(gta04_dapm_widgets)); + ARRAY_SIZE(gta04_dapm_widgets)); if (ret < 0) return ret; @@ -179,41 +181,36 @@ static struct snd_soc_ops omap3gta04_ops = { }; /* Digital audio interface glue - connects codec <--> CPU */ -static struct snd_soc_dai_link omap3gta04_dai[] = { - { +static struct snd_soc_dai_link omap3gta04_dai = { .name = "TWL4030", .stream_name = "TWL4030", .cpu_dai_name = "omap-mcpdm-dai.0", + .platform_name = "omap-pcm-audio", .codec_dai_name = "twl4030-hifi", .ops = &omap3gta04_ops, .init = &omap3gta04_init - } }; /* Audio machine driver */ static struct snd_soc_card snd_soc_omap3gta04 = { .name = "gta04", -// .platform = &omap_soc_platform, - .dai_link = &omap3gta04_dai[0], - .num_links = ARRAY_SIZE(omap3gta04_dai), + .owner = THIS_MODULE, + .dai_link = &omap3gta04_dai, + .num_links = 1, }; -/* Audio subsystem */ -/*static struct snd_soc_driver omap3gta04_snd_devdata = { - .card = &snd_soc_omap3gta04, - .codec_dev = &soc_codec_dev_twl4030, -};*/ - static struct platform_device *omap3gta04_snd_device; static int __init omap3gta04_soc_init(void) { int ret; -/* if (!machine_is_gta04() && !machine_is_omap3_gta04()) { +#if 0 + if (!machine_is_gta04() && !machine_is_omap3_gta04()) { pr_debug("Not GTA04!\n"); return -ENODEV; - }*/ + } +#endif pr_info("GTA04 OMAP3 SoC snd init\n"); // FIXME: set any GPIOs i.e. enable Audio in/out switch @@ -226,8 +223,7 @@ static int __init omap3gta04_soc_init(void) } platform_set_drvdata(omap3gta04_snd_device, &snd_soc_omap3gta04); -// omap3gta04_snd_devdata.dev = &omap3gta04_snd_device->dev; -// *(unsigned int *)omap3gta04_dai[0].cpu_dai->private_data = 1; /* McBSP2 = TPS65950 */ + ret = platform_device_add(omap3gta04_snd_device); if (ret) goto err1; @@ -244,7 +240,6 @@ err1: static void __exit omap3gta04_soc_exit(void) { platform_device_unregister(omap3gta04_snd_device); - // switch off power } module_init(omap3gta04_soc_init); diff --git a/sound/soc/omap/gta04-fm.c b/sound/soc/omap/gta04-fm.c index 9a5d74e..e6e67b1 100644 --- a/sound/soc/omap/gta04-fm.c +++ b/sound/soc/omap/gta04-fm.c @@ -16,6 +16,7 @@ */ #include <linux/platform_device.h> +#include <linux/module.h> #include <sound/core.h> #include <sound/pcm.h> @@ -32,7 +33,7 @@ static int gta04_fm_hw_params(struct snd_pcm_substream *substream, /* setup codec dai and cpu dai hardware params */ struct snd_soc_pcm_runtime *rtd = substream->private_data; // struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; - struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; unsigned int fmt; int ret; @@ -58,13 +59,14 @@ static int gta04_fm_hw_params(struct snd_pcm_substream *substream, return 0; } -static int gta04_fm_init(struct snd_soc_codec *codec) +static int gta04_fm_init(struct snd_soc_pcm_runtime *runtime) { /* add controls */ /* add routes */ /* setup pins */ + struct snd_soc_codec *codec = runtime->codec; - snd_soc_dapm_sync(codec); + snd_soc_dapm_sync(&codec->dapm); return 0; } @@ -89,8 +91,8 @@ static struct snd_soc_ops gta04_fm_ops = { static struct snd_soc_dai_link gta04_fm_dai = { .name = "Si47xx", .stream_name = "Si47xx", - .cpu_dai = &omap_mcbsp_dai[3], - .codec_dai = &si47xx_dai, + .cpu_dai_name = "omap-mcbsp-dai.3", + .codec_dai_name = "Si47xx", .init = gta04_fm_init, .ops = >a04_fm_ops, }; @@ -98,7 +100,7 @@ static struct snd_soc_dai_link gta04_fm_dai = { /* fm machine driver */ static struct snd_soc_card gta04_fm_card = { .name = "gta04-fm", - .platform = &omap_soc_platform, +// .platform_name = "omap-pcm-audio", .dai_link = >a04_fm_dai, .num_links = 1, }; diff --git a/sound/soc/omap/gta04-headset.c b/sound/soc/omap/gta04-headset.c index e200ea7..af7c450 100644 --- a/sound/soc/omap/gta04-headset.c +++ b/sound/soc/omap/gta04-headset.c @@ -17,6 +17,7 @@ #include <linux/platform_device.h> +#include <linux/module.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> @@ -58,11 +59,12 @@ static int gta04_headset_hw_params(struct snd_pcm_substream *substream, return 0; } -static int gta04_headset_init(struct snd_soc_codec *codec) +static int gta04_headset_init(struct snd_soc_pcm_runtime *runtime) { /* add controls */ /* add routes */ /* setup pins */ + struct snd_soc_codec *codec = runtime->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; snd_soc_dapm_sync(dapm); return 0; diff --git a/sound/soc/omap/gta04-voice.c b/sound/soc/omap/gta04-voice.c index 4c475edf..dcc81cf 100644 --- a/sound/soc/omap/gta04-voice.c +++ b/sound/soc/omap/gta04-voice.c @@ -16,6 +16,7 @@ */ #include <linux/platform_device.h> +#include <linux/module.h> #include <sound/core.h> #include <sound/pcm.h> @@ -83,11 +84,12 @@ static int gta04_voice_hw_params(struct snd_pcm_substream *substream, return 0; } -static int gta04_voice_init(struct snd_soc_codec *codec) +static int gta04_voice_init(struct snd_soc_pcm_runtime *runtime) { /* add controls */ /* add routes */ /* setup pins */ + struct snd_soc_codec *codec = runtime->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; snd_soc_dapm_sync(dapm); return 0; |