wsa881x-analog.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _WSA881X_H
  13. #define _WSA881X_H
  14. #include <linux/regmap.h>
  15. #include "wsa881x-registers-analog.h"
  16. #include <sound/soc.h>
  17. #define WSA881X_I2C_SPK0_SLAVE0_ADDR 0x0E
  18. #define WSA881X_I2C_SPK0_SLAVE1_ADDR 0x44
  19. #define WSA881X_I2C_SPK1_SLAVE0_ADDR 0x0F
  20. #define WSA881X_I2C_SPK1_SLAVE1_ADDR 0x45
  21. #define WSA881X_I2C_SPK0_SLAVE0 0
  22. #define WSA881X_I2C_SPK1_SLAVE0 1
  23. #define MAX_WSA881X_DEVICE 2
  24. #define WSA881X_DIGITAL_SLAVE 0
  25. #define WSA881X_ANALOG_SLAVE 1
  26. enum {
  27. WSA881X_1_X = 0,
  28. WSA881X_2_0,
  29. };
  30. #define WSA881X_IS_2_0(ver) \
  31. ((ver == WSA881X_2_0) ? 1 : 0)
  32. extern const u8 wsa881x_ana_reg_readable[WSA881X_CACHE_SIZE];
  33. extern struct reg_default wsa881x_ana_reg_defaults[WSA881X_CACHE_SIZE];
  34. extern struct regmap_config wsa881x_ana_regmap_config[2];
  35. int wsa881x_get_client_index(void);
  36. int wsa881x_get_probing_count(void);
  37. int wsa881x_get_presence_count(void);
  38. int wsa881x_set_mclk_callback(
  39. int (*enable_mclk_callback)(struct snd_soc_card *, bool));
  40. void wsa881x_update_reg_defaults_2_0(void);
  41. void wsa881x_update_regmap_2_0(struct regmap *regmap, int flag);
  42. #endif /* _WSA881X_H */