smdk_wm9713.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 "s3c-dma.h"
  17. #include "s3c-ac97.h"
  18. static struct snd_soc_card smdk;
  19. /*
  20. * Default CFG switch settings to use this driver:
  21. *
  22. * SMDK6410: Set CFG1 1-3 On, CFG2 1-4 Off
  23. * SMDKC100: Set CFG6 1-3 On, CFG7 1 On
  24. * SMDKC110: Set CFGB10 1-2 Off, CFGB12 1-3 On
  25. * SMDKV210: Set CFGB10 1-2 Off, CFGB12 1-3 On
  26. */
  27. /*
  28. Playback (HeadPhone):-
  29. $ amixer sset 'Headphone' unmute
  30. $ amixer sset 'Right Headphone Out Mux' 'Headphone'
  31. $ amixer sset 'Left Headphone Out Mux' 'Headphone'
  32. $ amixer sset 'Right HP Mixer PCM' unmute
  33. $ amixer sset 'Left HP Mixer PCM' unmute
  34. Capture (LineIn):-
  35. $ amixer sset 'Right Capture Source' 'Line'
  36. $ amixer sset 'Left Capture Source' 'Line'
  37. */
  38. static struct snd_soc_dai_link smdk_dai = {
  39. .name = "AC97",
  40. .stream_name = "AC97 PCM",
  41. .platform_name = "s3c24xx-pcm-audio",
  42. .cpu_dai_name = "s3c-ac97",
  43. .codec_dai_name = "wm9713-hifi",
  44. .codec_name = "wm9713-codec",
  45. };
  46. static struct snd_soc_card smdk = {
  47. .name = "SMDK WM9713",
  48. .dai_link = &smdk_dai,
  49. .num_links = 1,
  50. };
  51. static struct platform_device *smdk_snd_wm9713_device;
  52. static struct platform_device *smdk_snd_ac97_device;
  53. static int __init smdk_init(void)
  54. {
  55. int ret;
  56. smdk_snd_wm9713_device = platform_device_alloc("wm9713-codec", -1);
  57. if (!smdk_snd_wm9713_device)
  58. return -ENOMEM;
  59. ret = platform_device_add(smdk_snd_wm9713_device);
  60. if (ret)
  61. goto err;
  62. smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1);
  63. if (!smdk_snd_ac97_device) {
  64. ret = -ENOMEM;
  65. goto err;
  66. }
  67. platform_set_drvdata(smdk_snd_ac97_device, &smdk);
  68. ret = platform_device_add(smdk_snd_ac97_device);
  69. if (ret) {
  70. platform_device_put(smdk_snd_ac97_device);
  71. goto err;
  72. }
  73. return 0;
  74. err:
  75. platform_device_put(smdk_snd_wm9713_device);
  76. return ret;
  77. }
  78. static void __exit smdk_exit(void)
  79. {
  80. platform_device_unregister(smdk_snd_ac97_device);
  81. platform_device_unregister(smdk_snd_wm9713_device);
  82. }
  83. module_init(smdk_init);
  84. module_exit(smdk_exit);
  85. /* Module information */
  86. MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com");
  87. MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713");
  88. MODULE_LICENSE("GPL");