em-x270.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. #include <linux/module.h>
  22. #include <linux/moduleparam.h>
  23. #include <linux/device.h>
  24. #include <sound/core.h>
  25. #include <sound/pcm.h>
  26. #include <sound/soc.h>
  27. #include <asm/mach-types.h>
  28. #include <mach/audio.h>
  29. #include "../codecs/wm9712.h"
  30. #include "pxa2xx-ac97.h"
  31. static struct snd_soc_dai_link em_x270_dai[] = {
  32. {
  33. .name = "AC97",
  34. .stream_name = "AC97 HiFi",
  35. .cpu_dai_name = "pxa2xx-ac97",
  36. .codec_dai_name = "wm9712-hifi",
  37. .platform_name = "pxa-pcm-audio",
  38. .codec_name = "wm9712-codec",
  39. },
  40. {
  41. .name = "AC97 Aux",
  42. .stream_name = "AC97 Aux",
  43. .cpu_dai_name = "pxa2xx-ac97-aux",
  44. .codec_dai_name ="wm9712-aux",
  45. .platform_name = "pxa-pcm-audio",
  46. .codec_name = "wm9712-codec",
  47. },
  48. };
  49. static struct snd_soc_card em_x270 = {
  50. .name = "EM-X270",
  51. .owner = THIS_MODULE,
  52. .dai_link = em_x270_dai,
  53. .num_links = ARRAY_SIZE(em_x270_dai),
  54. };
  55. static struct platform_device *em_x270_snd_device;
  56. static int __init em_x270_init(void)
  57. {
  58. int ret;
  59. if (!(machine_is_em_x270() || machine_is_exeda()
  60. || machine_is_cm_x300()))
  61. return -ENODEV;
  62. em_x270_snd_device = platform_device_alloc("soc-audio", -1);
  63. if (!em_x270_snd_device)
  64. return -ENOMEM;
  65. platform_set_drvdata(em_x270_snd_device, &em_x270);
  66. ret = platform_device_add(em_x270_snd_device);
  67. if (ret)
  68. platform_device_put(em_x270_snd_device);
  69. return ret;
  70. }
  71. static void __exit em_x270_exit(void)
  72. {
  73. platform_device_unregister(em_x270_snd_device);
  74. }
  75. module_init(em_x270_init);
  76. module_exit(em_x270_exit);
  77. /* Module information */
  78. MODULE_AUTHOR("Mike Rapoport");
  79. MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
  80. MODULE_LICENSE("GPL");