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