s3c24xx_simtec_tlv320aic23.c 2.6 KB

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