wsa881x.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright (c) 2015-2017, 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 <sound/soc.h>
  16. #include <sound/info.h>
  17. #include "wsa881x-registers.h"
  18. #define WSA881X_MAX_SWR_PORTS 4
  19. #if IS_ENABLED(CONFIG_SND_SOC_WSA881X)
  20. extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
  21. u8 num_port, unsigned int *ch_mask,
  22. unsigned int *ch_rate);
  23. extern const u8 wsa881x_reg_readable[WSA881X_CACHE_SIZE];
  24. extern struct regmap_config wsa881x_regmap_config;
  25. extern int wsa881x_codec_info_create_codec_entry(
  26. struct snd_info_entry *codec_root,
  27. struct snd_soc_codec *codec);
  28. void wsa881x_regmap_defaults(struct regmap *regmap, u8 version);
  29. #else
  30. extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
  31. u8 num_port, unsigned int *ch_mask,
  32. unsigned int *ch_rate)
  33. {
  34. return 0;
  35. }
  36. extern int wsa881x_codec_info_create_codec_entry(
  37. struct snd_info_entry *codec_root,
  38. struct snd_soc_codec *codec)
  39. {
  40. return 0;
  41. }
  42. void wsa881x_regmap_defaults(struct regmap *regmap, u8 version)
  43. {
  44. }
  45. #endif
  46. #endif /* _WSA881X_H */