wm8804-spi.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * wm8804-spi.c -- WM8804 S/PDIF transceiver driver - SPI
  4. *
  5. * Copyright 2015 Cirrus Logic Inc
  6. *
  7. * Author: Charles Keepax <[email protected]>
  8. */
  9. #include <linux/init.h>
  10. #include <linux/module.h>
  11. #include <linux/spi/spi.h>
  12. #include "wm8804.h"
  13. static int wm8804_spi_probe(struct spi_device *spi)
  14. {
  15. struct regmap *regmap;
  16. regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config);
  17. if (IS_ERR(regmap))
  18. return PTR_ERR(regmap);
  19. return wm8804_probe(&spi->dev, regmap);
  20. }
  21. static void wm8804_spi_remove(struct spi_device *spi)
  22. {
  23. wm8804_remove(&spi->dev);
  24. }
  25. static const struct of_device_id wm8804_of_match[] = {
  26. { .compatible = "wlf,wm8804", },
  27. { }
  28. };
  29. MODULE_DEVICE_TABLE(of, wm8804_of_match);
  30. static struct spi_driver wm8804_spi_driver = {
  31. .driver = {
  32. .name = "wm8804",
  33. .pm = &wm8804_pm,
  34. .of_match_table = wm8804_of_match,
  35. },
  36. .probe = wm8804_spi_probe,
  37. .remove = wm8804_spi_remove
  38. };
  39. module_spi_driver(wm8804_spi_driver);
  40. MODULE_DESCRIPTION("ASoC WM8804 driver - SPI");
  41. MODULE_AUTHOR("Charles Keepax <[email protected]>");
  42. MODULE_LICENSE("GPL");