pcm5102a.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Driver for the PCM5102A codec
  4. *
  5. * Author: Florian Meier <[email protected]>
  6. * Copyright 2013
  7. */
  8. #include <linux/init.h>
  9. #include <linux/module.h>
  10. #include <linux/platform_device.h>
  11. #include <sound/soc.h>
  12. static struct snd_soc_dai_driver pcm5102a_dai = {
  13. .name = "pcm5102a-hifi",
  14. .playback = {
  15. .channels_min = 2,
  16. .channels_max = 2,
  17. .rates = SNDRV_PCM_RATE_8000_384000,
  18. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  19. SNDRV_PCM_FMTBIT_S24_LE |
  20. SNDRV_PCM_FMTBIT_S32_LE
  21. },
  22. };
  23. static struct snd_soc_component_driver soc_component_dev_pcm5102a = {
  24. .idle_bias_on = 1,
  25. .use_pmdown_time = 1,
  26. .endianness = 1,
  27. };
  28. static int pcm5102a_probe(struct platform_device *pdev)
  29. {
  30. return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm5102a,
  31. &pcm5102a_dai, 1);
  32. }
  33. static const struct of_device_id pcm5102a_of_match[] = {
  34. { .compatible = "ti,pcm5102a", },
  35. { }
  36. };
  37. MODULE_DEVICE_TABLE(of, pcm5102a_of_match);
  38. static struct platform_driver pcm5102a_codec_driver = {
  39. .probe = pcm5102a_probe,
  40. .driver = {
  41. .name = "pcm5102a-codec",
  42. .of_match_table = pcm5102a_of_match,
  43. },
  44. };
  45. module_platform_driver(pcm5102a_codec_driver);
  46. MODULE_DESCRIPTION("ASoC PCM5102A codec driver");
  47. MODULE_AUTHOR("Florian Meier <[email protected]>");
  48. MODULE_LICENSE("GPL v2");