wm8731.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * wm8731.h -- WM8731 Soc Audio driver
  4. *
  5. * Copyright 2005 Openedhand Ltd.
  6. *
  7. * Author: Richard Purdie <[email protected]>
  8. *
  9. * Based on wm8753.h
  10. */
  11. #ifndef _WM8731_H
  12. #define _WM8731_H
  13. #include <linux/mutex.h>
  14. #include <linux/regmap.h>
  15. #include <linux/regulator/consumer.h>
  16. struct clk;
  17. struct snd_pcm_hw_constraint_list;
  18. /* WM8731 register space */
  19. #define WM8731_LINVOL 0x00
  20. #define WM8731_RINVOL 0x01
  21. #define WM8731_LOUT1V 0x02
  22. #define WM8731_ROUT1V 0x03
  23. #define WM8731_APANA 0x04
  24. #define WM8731_APDIGI 0x05
  25. #define WM8731_PWR 0x06
  26. #define WM8731_IFACE 0x07
  27. #define WM8731_SRATE 0x08
  28. #define WM8731_ACTIVE 0x09
  29. #define WM8731_RESET 0x0f
  30. #define WM8731_CACHEREGNUM 10
  31. #define WM8731_SYSCLK_MCLK 0
  32. #define WM8731_SYSCLK_XTAL 1
  33. #define WM8731_DAI 0
  34. #define WM8731_NUM_SUPPLIES 4
  35. /* codec private data */
  36. struct wm8731_priv {
  37. struct regmap *regmap;
  38. struct clk *mclk;
  39. struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES];
  40. const struct snd_pcm_hw_constraint_list *constraints;
  41. unsigned int sysclk;
  42. int sysclk_type;
  43. int playback_fs;
  44. bool deemph;
  45. struct mutex lock;
  46. };
  47. extern const struct regmap_config wm8731_regmap;
  48. int wm8731_init(struct device *dev, struct wm8731_priv *wm8731);
  49. #endif