| 1 | /* |
| 2 | * SoC audio driver for EM-X270, eXeda and CM-X300 |
| 3 | * |
| 4 | * Copyright 2007, 2009 CompuLab, Ltd. |
| 5 | * |
| 6 | * Author: Mike Rapoport <mike@compulab.co.il> |
| 7 | * |
| 8 | * Copied from tosa.c: |
| 9 | * Copyright 2005 Wolfson Microelectronics PLC. |
| 10 | * Copyright 2005 Openedhand Ltd. |
| 11 | * |
| 12 | * Authors: Liam Girdwood <lrg@slimlogic.co.uk> |
| 13 | * Richard Purdie <richard@openedhand.com> |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify it |
| 16 | * under the terms of the GNU General Public License as published by the |
| 17 | * Free Software Foundation; either version 2 of the License, or (at your |
| 18 | * option) any later version. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <linux/module.h> |
| 23 | #include <linux/moduleparam.h> |
| 24 | #include <linux/device.h> |
| 25 | |
| 26 | #include <sound/core.h> |
| 27 | #include <sound/pcm.h> |
| 28 | #include <sound/soc.h> |
| 29 | #include <sound/soc-dapm.h> |
| 30 | |
| 31 | #include <asm/mach-types.h> |
| 32 | #include <mach/audio.h> |
| 33 | |
| 34 | #include "../codecs/wm9712.h" |
| 35 | #include "pxa2xx-pcm.h" |
| 36 | #include "pxa2xx-ac97.h" |
| 37 | |
| 38 | static struct snd_soc_dai_link em_x270_dai[] = { |
| 39 | { |
| 40 | .name = "AC97", |
| 41 | .stream_name = "AC97 HiFi", |
| 42 | .cpu_dai_name = "pxa-ac97.0", |
| 43 | .codec_dai_name = "wm9712-hifi", |
| 44 | .platform_name = "pxa-pcm-audio", |
| 45 | .codec_name = "wm9712-codec", |
| 46 | }, |
| 47 | { |
| 48 | .name = "AC97 Aux", |
| 49 | .stream_name = "AC97 Aux", |
| 50 | .cpu_dai_name = "pxa-ac97.1", |
| 51 | .codec_dai_name ="wm9712-aux", |
| 52 | .platform_name = "pxa-pcm-audio", |
| 53 | .codec_name = "wm9712-codec", |
| 54 | }, |
| 55 | }; |
| 56 | |
| 57 | static struct snd_soc_card em_x270 = { |
| 58 | .name = "EM-X270", |
| 59 | .dai_link = em_x270_dai, |
| 60 | .num_links = ARRAY_SIZE(em_x270_dai), |
| 61 | }; |
| 62 | |
| 63 | static struct platform_device *em_x270_snd_device; |
| 64 | |
| 65 | static int __init em_x270_init(void) |
| 66 | { |
| 67 | int ret; |
| 68 | |
| 69 | if (!(machine_is_em_x270() || machine_is_exeda() |
| 70 | || machine_is_cm_x300())) |
| 71 | return -ENODEV; |
| 72 | |
| 73 | em_x270_snd_device = platform_device_alloc("soc-audio", -1); |
| 74 | if (!em_x270_snd_device) |
| 75 | return -ENOMEM; |
| 76 | |
| 77 | platform_set_drvdata(em_x270_snd_device, &em_x270); |
| 78 | ret = platform_device_add(em_x270_snd_device); |
| 79 | |
| 80 | if (ret) |
| 81 | platform_device_put(em_x270_snd_device); |
| 82 | |
| 83 | return ret; |
| 84 | } |
| 85 | |
| 86 | static void __exit em_x270_exit(void) |
| 87 | { |
| 88 | platform_device_unregister(em_x270_snd_device); |
| 89 | } |
| 90 | |
| 91 | module_init(em_x270_init); |
| 92 | module_exit(em_x270_exit); |
| 93 | |
| 94 | /* Module information */ |
| 95 | MODULE_AUTHOR("Mike Rapoport"); |
| 96 | MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300"); |
| 97 | MODULE_LICENSE("GPL"); |