ssm2602-spi.c 836 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * SSM2602 SPI audio driver
  4. *
  5. * Copyright 2014 Analog Devices Inc.
  6. */
  7. #include <linux/module.h>
  8. #include <linux/spi/spi.h>
  9. #include <linux/regmap.h>
  10. #include <sound/soc.h>
  11. #include "ssm2602.h"
  12. static int ssm2602_spi_probe(struct spi_device *spi)
  13. {
  14. return ssm2602_probe(&spi->dev, SSM2602,
  15. devm_regmap_init_spi(spi, &ssm2602_regmap_config));
  16. }
  17. static const struct of_device_id ssm2602_of_match[] = {
  18. { .compatible = "adi,ssm2602", },
  19. { }
  20. };
  21. MODULE_DEVICE_TABLE(of, ssm2602_of_match);
  22. static struct spi_driver ssm2602_spi_driver = {
  23. .driver = {
  24. .name = "ssm2602",
  25. .of_match_table = ssm2602_of_match,
  26. },
  27. .probe = ssm2602_spi_probe,
  28. };
  29. module_spi_driver(ssm2602_spi_driver);
  30. MODULE_DESCRIPTION("ASoC SSM2602 SPI driver");
  31. MODULE_AUTHOR("Cliff Cai");
  32. MODULE_LICENSE("GPL");