s3c24xx_simtec_tlv320aic23.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
  2. *
  3. * Copyright 2009 Simtec Electronics
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/module.h>
  10. #include <sound/soc.h>
  11. #include "s3c24xx_simtec.h"
  12. /* supported machines:
  13. *
  14. * Machine Connections AMP
  15. * ------- ----------- ---
  16. * BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired)
  17. * VR1000 HPOUT, LIN None
  18. * VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
  19. * DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
  20. * Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R)
  21. */
  22. static const struct snd_soc_dapm_widget dapm_widgets[] = {
  23. SND_SOC_DAPM_HP("Headphone Jack", NULL),
  24. SND_SOC_DAPM_LINE("Line In", NULL),
  25. SND_SOC_DAPM_LINE("Line Out", NULL),
  26. SND_SOC_DAPM_MIC("Mic Jack", NULL),
  27. };
  28. static const struct snd_soc_dapm_route base_map[] = {
  29. { "Headphone Jack", NULL, "LHPOUT"},
  30. { "Headphone Jack", NULL, "RHPOUT"},
  31. { "Line Out", NULL, "LOUT" },
  32. { "Line Out", NULL, "ROUT" },
  33. { "LLINEIN", NULL, "Line In"},
  34. { "RLINEIN", NULL, "Line In"},
  35. { "MICIN", NULL, "Mic Jack"},
  36. };
  37. /**
  38. * simtec_tlv320aic23_init - initialise and add controls
  39. * @codec; The codec instance to attach to.
  40. *
  41. * Attach our controls and configure the necessary codec
  42. * mappings for our sound card instance.
  43. */
  44. static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
  45. {
  46. simtec_audio_init(rtd);
  47. return 0;
  48. }
  49. static struct snd_soc_dai_link simtec_dai_aic23 = {
  50. .name = "tlv320aic23",
  51. .stream_name = "TLV320AIC23",
  52. .codec_name = "tlv320aic3x-codec.0-001a",
  53. .cpu_dai_name = "s3c24xx-iis",
  54. .codec_dai_name = "tlv320aic3x-hifi",
  55. .platform_name = "s3c24xx-iis",
  56. .init = simtec_tlv320aic23_init,
  57. };
  58. /* simtec audio machine driver */
  59. static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
  60. .name = "Simtec",
  61. .owner = THIS_MODULE,
  62. .dai_link = &simtec_dai_aic23,
  63. .num_links = 1,
  64. .dapm_widgets = dapm_widgets,
  65. .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
  66. .dapm_routes = base_map,
  67. .num_dapm_routes = ARRAY_SIZE(base_map),
  68. };
  69. static int simtec_audio_tlv320aic23_probe(struct platform_device *pd)
  70. {
  71. return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
  72. }
  73. static struct platform_driver simtec_audio_tlv320aic23_driver = {
  74. .driver = {
  75. .name = "s3c24xx-simtec-tlv320aic23",
  76. .pm = simtec_audio_pm,
  77. },
  78. .probe = simtec_audio_tlv320aic23_probe,
  79. .remove = simtec_audio_remove,
  80. };
  81. module_platform_driver(simtec_audio_tlv320aic23_driver);
  82. MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
  83. MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
  84. MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
  85. MODULE_LICENSE("GPL");