smdk_wm9713.c 2.6 KB

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