smdk_wm9713.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. * Default CFG switch settings to use this driver:
  22. *
  23. * SMDK6410: Set CFG1 1-3 On, CFG2 1-4 Off
  24. * SMDKC100: Set CFG6 1-3 On, CFG7 1 On
  25. */
  26. /*
  27. Playback (HeadPhone):-
  28. $ amixer sset 'Headphone' unmute
  29. $ amixer sset 'Right Headphone Out Mux' 'Headphone'
  30. $ amixer sset 'Left Headphone Out Mux' 'Headphone'
  31. $ amixer sset 'Right HP Mixer PCM' unmute
  32. $ amixer sset 'Left HP Mixer PCM' unmute
  33. Capture (LineIn):-
  34. $ amixer sset 'Right Capture Source' 'Line'
  35. $ amixer sset 'Left Capture Source' 'Line'
  36. */
  37. static struct snd_soc_dai_link smdk_dai = {
  38. .name = "AC97",
  39. .stream_name = "AC97 PCM",
  40. .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM],
  41. .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI],
  42. };
  43. static struct snd_soc_card smdk = {
  44. .name = "SMDK",
  45. .platform = &s3c24xx_soc_platform,
  46. .dai_link = &smdk_dai,
  47. .num_links = 1,
  48. };
  49. static struct snd_soc_device smdk_snd_ac97_devdata = {
  50. .card = &smdk,
  51. .codec_dev = &soc_codec_dev_wm9713,
  52. };
  53. static struct platform_device *smdk_snd_ac97_device;
  54. static int __init smdk_init(void)
  55. {
  56. int ret;
  57. smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1);
  58. if (!smdk_snd_ac97_device)
  59. return -ENOMEM;
  60. platform_set_drvdata(smdk_snd_ac97_device,
  61. &smdk_snd_ac97_devdata);
  62. smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev;
  63. ret = platform_device_add(smdk_snd_ac97_device);
  64. if (ret)
  65. platform_device_put(smdk_snd_ac97_device);
  66. return ret;
  67. }
  68. static void __exit smdk_exit(void)
  69. {
  70. platform_device_unregister(smdk_snd_ac97_device);
  71. }
  72. module_init(smdk_init);
  73. module_exit(smdk_exit);
  74. /* Module information */
  75. MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com");
  76. MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713");
  77. MODULE_LICENSE("GPL");