wsa881x-analog.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015, 2018-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _WSA881X_H
  6. #define _WSA881X_H
  7. #include <linux/regmap.h>
  8. #include "wsa881x-registers-analog.h"
  9. #include <sound/soc.h>
  10. #define WSA881X_I2C_SPK0_SLAVE0_ADDR 0x0E
  11. #define WSA881X_I2C_SPK0_SLAVE1_ADDR 0x44
  12. #define WSA881X_I2C_SPK1_SLAVE0_ADDR 0x0F
  13. #define WSA881X_I2C_SPK1_SLAVE1_ADDR 0x45
  14. #define WSA881X_I2C_SPK0_SLAVE0 0
  15. #define WSA881X_I2C_SPK1_SLAVE0 1
  16. #define MAX_WSA881X_DEVICE 2
  17. #define WSA881X_DIGITAL_SLAVE 0
  18. #define WSA881X_ANALOG_SLAVE 1
  19. enum {
  20. WSA881X_1_X = 0,
  21. WSA881X_2_0,
  22. };
  23. #define WSA881X_IS_2_0(ver) \
  24. ((ver == WSA881X_2_0) ? 1 : 0)
  25. extern const u8 wsa881x_ana_reg_readable[WSA881X_CACHE_SIZE];
  26. extern struct reg_default wsa881x_ana_reg_defaults[WSA881X_CACHE_SIZE];
  27. extern struct regmap_config wsa881x_ana_regmap_config[2];
  28. int wsa881x_get_client_index(void);
  29. int wsa881x_get_probing_count(void);
  30. int wsa881x_get_presence_count(void);
  31. int wsa881x_set_mclk_callback(
  32. int (*enable_mclk_callback)(struct snd_soc_card *, bool));
  33. void wsa881x_update_reg_defaults_2_0(void);
  34. void wsa881x_update_regmap_2_0(struct regmap *regmap, int flag);
  35. #endif /* _WSA881X_H */