diff options
| author | Mika Westerberg <mika.westerberg@iki.fi> | 2010-10-14 10:49:08 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-10-15 06:54:54 -0400 |
| commit | d42a280dc76c04f39d1f9a374cf5c23318c49004 (patch) | |
| tree | 92cc331f0419d1ac34baa1f42cd818172c1698d9 | |
| parent | 534bc7fa3c0a9084e7a2db33898d92577c64e4eb (diff) | |
ASoC: ep93xx: add Simplemachines Sim.One AC97 audio support
Add AC97 audio support for Simplemachines Sim.One board.
Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| -rw-r--r-- | arch/arm/mach-ep93xx/simone.c | 1 | ||||
| -rw-r--r-- | sound/soc/ep93xx/Kconfig | 9 | ||||
| -rw-r--r-- | sound/soc/ep93xx/Makefile | 2 | ||||
| -rw-r--r-- | sound/soc/ep93xx/simone.c | 89 |
4 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index 5dded5884133..f5f81f9719bd 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
| @@ -61,6 +61,7 @@ static void __init simone_init_machine(void) | |||
| 61 | ep93xx_register_fb(&simone_fb_info); | 61 | ep93xx_register_fb(&simone_fb_info); |
| 62 | ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, | 62 | ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, |
| 63 | ARRAY_SIZE(simone_i2c_board_info)); | 63 | ARRAY_SIZE(simone_i2c_board_info)); |
| 64 | ep93xx_register_ac97(); | ||
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") | 67 | MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") |
diff --git a/sound/soc/ep93xx/Kconfig b/sound/soc/ep93xx/Kconfig index 108e5ff3ffc2..57429041189c 100644 --- a/sound/soc/ep93xx/Kconfig +++ b/sound/soc/ep93xx/Kconfig | |||
| @@ -21,3 +21,12 @@ config SND_EP93XX_SOC_SNAPPERCL15 | |||
| 21 | help | 21 | help |
| 22 | Say Y or M here if you want to add support for I2S audio on the | 22 | Say Y or M here if you want to add support for I2S audio on the |
| 23 | Bluewater Systems Snapper CL15 module. | 23 | Bluewater Systems Snapper CL15 module. |
| 24 | |||
| 25 | config SND_EP93XX_SOC_SIMONE | ||
| 26 | tristate "SoC Audio support for Simplemachines Sim.One board" | ||
| 27 | depends on SND_EP93XX_SOC && MACH_SIM_ONE | ||
| 28 | select SND_EP93XX_SOC_AC97 | ||
| 29 | select SND_SOC_AC97_CODEC | ||
| 30 | help | ||
| 31 | Say Y or M here if you want to add support for AC97 audio on the | ||
| 32 | Simplemachines Sim.One board. | ||
diff --git a/sound/soc/ep93xx/Makefile b/sound/soc/ep93xx/Makefile index ac06e0092f95..8e7977fb6b7d 100644 --- a/sound/soc/ep93xx/Makefile +++ b/sound/soc/ep93xx/Makefile | |||
| @@ -9,5 +9,7 @@ obj-$(CONFIG_SND_EP93XX_SOC_AC97) += snd-soc-ep93xx-ac97.o | |||
| 9 | 9 | ||
| 10 | # EP93XX Machine Support | 10 | # EP93XX Machine Support |
| 11 | snd-soc-snappercl15-objs := snappercl15.o | 11 | snd-soc-snappercl15-objs := snappercl15.o |
| 12 | snd-soc-simone-objs := simone.o | ||
| 12 | 13 | ||
| 13 | obj-$(CONFIG_SND_EP93XX_SOC_SNAPPERCL15) += snd-soc-snappercl15.o | 14 | obj-$(CONFIG_SND_EP93XX_SOC_SNAPPERCL15) += snd-soc-snappercl15.o |
| 15 | obj-$(CONFIG_SND_EP93XX_SOC_SIMONE) += snd-soc-simone.o | ||
diff --git a/sound/soc/ep93xx/simone.c b/sound/soc/ep93xx/simone.c new file mode 100644 index 000000000000..4b0d19913728 --- /dev/null +++ b/sound/soc/ep93xx/simone.c | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | /* | ||
| 2 | * simone.c -- ASoC audio for Simplemachines Sim.One board | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010 Mika Westerberg | ||
| 5 | * | ||
| 6 | * Based on snappercl15 machine driver by Ryan Mallon. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/init.h> | ||
| 14 | #include <linux/module.h> | ||
| 15 | #include <linux/platform_device.h> | ||
| 16 | |||
| 17 | #include <sound/core.h> | ||
| 18 | #include <sound/pcm.h> | ||
| 19 | #include <sound/soc.h> | ||
| 20 | |||
| 21 | #include <asm/mach-types.h> | ||
| 22 | #include <mach/hardware.h> | ||
| 23 | |||
| 24 | #include "ep93xx-pcm.h" | ||
| 25 | |||
| 26 | static struct snd_soc_dai_link simone_dai = { | ||
| 27 | .name = "AC97", | ||
| 28 | .stream_name = "AC97 HiFi", | ||
| 29 | .cpu_dai_name = "ep93xx-ac97", | ||
| 30 | .codec_dai_name = "ac97-hifi", | ||
| 31 | .codec_name = "ac97-codec", | ||
| 32 | .platform_name = "ep93xx-pcm-audio", | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct snd_soc_card snd_soc_simone = { | ||
| 36 | .name = "Sim.One", | ||
| 37 | .dai_link = &simone_dai, | ||
| 38 | .num_links = 1, | ||
| 39 | }; | ||
| 40 | |||
| 41 | static struct platform_device *simone_snd_ac97_device; | ||
| 42 | static struct platform_device *simone_snd_device; | ||
| 43 | |||
| 44 | static int __init simone_init(void) | ||
| 45 | { | ||
| 46 | int ret; | ||
| 47 | |||
| 48 | if (!machine_is_sim_one()) | ||
| 49 | return -ENODEV; | ||
| 50 | |||
| 51 | simone_snd_ac97_device = platform_device_alloc("ac97-codec", -1); | ||
| 52 | if (!simone_snd_ac97_device) | ||
| 53 | return -ENOMEM; | ||
| 54 | |||
| 55 | ret = platform_device_add(simone_snd_ac97_device); | ||
| 56 | if (ret) | ||
| 57 | goto fail; | ||
| 58 | |||
| 59 | simone_snd_device = platform_device_alloc("soc-audio", -1); | ||
| 60 | if (!simone_snd_device) { | ||
| 61 | ret = -ENOMEM; | ||
| 62 | goto fail; | ||
| 63 | } | ||
| 64 | |||
| 65 | platform_set_drvdata(simone_snd_device, &snd_soc_simone); | ||
| 66 | ret = platform_device_add(simone_snd_device); | ||
| 67 | if (ret) { | ||
| 68 | platform_device_put(simone_snd_device); | ||
| 69 | goto fail; | ||
| 70 | } | ||
| 71 | |||
| 72 | return ret; | ||
| 73 | |||
| 74 | fail: | ||
| 75 | platform_device_put(simone_snd_ac97_device); | ||
| 76 | return ret; | ||
| 77 | } | ||
| 78 | module_init(simone_init); | ||
| 79 | |||
| 80 | static void __exit simone_exit(void) | ||
| 81 | { | ||
| 82 | platform_device_unregister(simone_snd_device); | ||
| 83 | platform_device_unregister(simone_snd_ac97_device); | ||
| 84 | } | ||
| 85 | module_exit(simone_exit); | ||
| 86 | |||
| 87 | MODULE_DESCRIPTION("ALSA SoC Simplemachines Sim.One"); | ||
| 88 | MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>"); | ||
| 89 | MODULE_LICENSE("GPL"); | ||
