smdk2450_wm9713.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * smdk2450_wm9713.c -- SoC audio for smdk2450
  3. *
  4. * Copyright (C) 2007, Ryu Euiyoul <ryu.real@gmail.com>
  5. *
  6. * Copyright 2007 Wolfson Microelectronics PLC.
  7. * Author: Graeme Gregory
  8. * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. * Revision history
  16. * 8th Mar 2007 Initial version.
  17. * 20th Sep 2007 Apply at smdk2450
  18. *
  19. */
  20. #include <linux/module.h>
  21. #include <linux/device.h>
  22. #include <sound/driver.h>
  23. #include <sound/core.h>
  24. #include <sound/pcm.h>
  25. #include <sound/soc.h>
  26. #include <sound/soc-dapm.h>
  27. #include "../codecs/wm9713.h"
  28. #include "s3c-pcm.h"
  29. #include "s3c24xx-ac97.h"
  30. static struct snd_soc_machine smdk2450;
  31. static struct snd_soc_dai_link smdk2450_dai[] = {
  32. {
  33. .name = "AC97",
  34. .stream_name = "AC97 HiFi",
  35. .cpu_dai = &s3c24xx_ac97_dai[0],
  36. .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI],
  37. },
  38. };
  39. static struct snd_soc_machine smdk2450 = {
  40. .name = "SMDK2450",
  41. .dai_link = smdk2450_dai,
  42. .num_links = ARRAY_SIZE(smdk2450_dai),
  43. };
  44. static struct snd_soc_device smdk2450_snd_ac97_devdata = {
  45. .machine = &smdk2450,
  46. .platform = &s3c24xx_soc_platform,
  47. .codec_dev = &soc_codec_dev_wm9713,
  48. };
  49. static struct platform_device *smdk2450_snd_ac97_device;
  50. static int __init smdk2450_init(void)
  51. {
  52. int ret;
  53. smdk2450_snd_ac97_device = platform_device_alloc("soc-audio", -1);
  54. if (!smdk2450_snd_ac97_device)
  55. return -ENOMEM;
  56. platform_set_drvdata(smdk2450_snd_ac97_device,
  57. &smdk2450_snd_ac97_devdata);
  58. smdk2450_snd_ac97_devdata.dev = &smdk2450_snd_ac97_device->dev;
  59. ret = platform_device_add(smdk2450_snd_ac97_device);
  60. if (ret)
  61. platform_device_put(smdk2450_snd_ac97_device);
  62. return ret;
  63. }
  64. static void __exit smdk2450_exit(void)
  65. {
  66. platform_device_unregister(smdk2450_snd_ac97_device);
  67. }
  68. module_init(smdk2450_init);
  69. module_exit(smdk2450_exit);
  70. /* Module information */
  71. MODULE_AUTHOR("Ryu Euiyoul");
  72. MODULE_DESCRIPTION("ALSA SoC WM9713 SMDK2450");
  73. MODULE_LICENSE("GPL");