adav801.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * ADAV801 audio driver
  3. *
  4. * Copyright 2014 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2.
  7. */
  8. #include <linux/module.h>
  9. #include <linux/spi/spi.h>
  10. #include <linux/regmap.h>
  11. #include <sound/soc.h>
  12. #include "adav80x.h"
  13. static const struct spi_device_id adav80x_spi_id[] = {
  14. { "adav801", 0 },
  15. { }
  16. };
  17. MODULE_DEVICE_TABLE(spi, adav80x_spi_id);
  18. static int adav80x_spi_probe(struct spi_device *spi)
  19. {
  20. struct regmap_config config;
  21. config = adav80x_regmap_config;
  22. config.read_flag_mask = 0x01;
  23. return adav80x_bus_probe(&spi->dev, devm_regmap_init_spi(spi, &config));
  24. }
  25. static int adav80x_spi_remove(struct spi_device *spi)
  26. {
  27. snd_soc_unregister_codec(&spi->dev);
  28. return 0;
  29. }
  30. static struct spi_driver adav80x_spi_driver = {
  31. .driver = {
  32. .name = "adav801",
  33. },
  34. .probe = adav80x_spi_probe,
  35. .remove = adav80x_spi_remove,
  36. .id_table = adav80x_spi_id,
  37. };
  38. module_spi_driver(adav80x_spi_driver);
  39. MODULE_DESCRIPTION("ASoC ADAV801 driver");
  40. MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
  41. MODULE_AUTHOR("Yi Li <yi.li@analog.com>>");
  42. MODULE_LICENSE("GPL");