smdk_wm9713.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * smdk_wm9713.c -- SoC audio for SMDK
  3. *
  4. * Copyright 2010 Samsung Electronics Co. Ltd.
  5. * Author: Jaswinder Singh Brar <jassi.brar@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of the
  10. * License, or (at your option) any later version.
  11. *
  12. */
  13. #include <linux/module.h>
  14. #include <linux/device.h>
  15. #include <sound/soc.h>
  16. #include "../codecs/wm9713.h"
  17. #include "s3c-dma.h"
  18. #include "s3c-ac97.h"
  19. static struct snd_soc_card smdk;
  20. /*
  21. Playback (HeadPhone):-
  22. Headphone Playback Switch - On
  23. $ amixer cset numid=4 1
  24. Right Headphone Out Mux - Headphone
  25. $ amixer cset numid=92 2
  26. Left Headphone Out Mux - Headphone
  27. $ amixer cset numid=93 2
  28. Right HP Mixer PCM Playback Switch - On
  29. $ amixer cset numid=75 1
  30. Left HP Mixer PCM Playback Switch - On
  31. $ amixer cset numid=81 1
  32. Capture (LineIn):-
  33. Right Capture Source - Line
  34. $ amixer cset numid=86 2
  35. Left Capture Source - Line
  36. $ amixer cset numid=87 2
  37. */
  38. static struct snd_soc_dai_link smdk_dai = {
  39. .name = "AC97",
  40. .stream_name = "AC97 PCM",
  41. .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM],
  42. .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI],
  43. };
  44. static struct snd_soc_card smdk = {
  45. .name = "SMDK",
  46. .platform = &s3c24xx_soc_platform,
  47. .dai_link = &smdk_dai,
  48. .num_links = 1,
  49. };
  50. static struct snd_soc_device smdk_snd_ac97_devdata = {
  51. .card = &smdk,
  52. .codec_dev = &soc_codec_dev_wm9713,
  53. };
  54. static struct platform_device *smdk_snd_ac97_device;
  55. static int __init smdk_init(void)
  56. {
  57. int ret;
  58. smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1);
  59. if (!smdk_snd_ac97_device)
  60. return -ENOMEM;
  61. platform_set_drvdata(smdk_snd_ac97_device,
  62. &smdk_snd_ac97_devdata);
  63. smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev;
  64. ret = platform_device_add(smdk_snd_ac97_device);
  65. if (ret)
  66. platform_device_put(smdk_snd_ac97_device);
  67. return ret;
  68. }
  69. static void __exit smdk_exit(void)
  70. {
  71. platform_device_unregister(smdk_snd_ac97_device);
  72. }
  73. module_init(smdk_init);
  74. module_exit(smdk_exit);
  75. /* Module information */
  76. MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com");
  77. MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713");
  78. MODULE_LICENSE("GPL");