swr-wcd.h 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015, 2017-2019 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _LINUX_SWR_WCD_H
  6. #define _LINUX_SWR_WCD_H
  7. #include <linux/module.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/device.h>
  10. #include <linux/bitops.h>
  11. enum {
  12. SWR_CH_MAP,
  13. SWR_DEVICE_DOWN,
  14. SWR_DEVICE_UP,
  15. SWR_SUBSYS_RESTART,
  16. SWR_SET_NUM_RX_CH,
  17. SWR_CLK_FREQ,
  18. SWR_DEVICE_SSR_DOWN,
  19. SWR_DEVICE_SSR_UP,
  20. SWR_REGISTER_WAKE_IRQ,
  21. SWR_SET_PORT_MAP,
  22. SWR_REQ_CLK_SWITCH,
  23. };
  24. struct swr_mstr_port {
  25. int num_port;
  26. u8 *port;
  27. };
  28. #define MCLK_FREQ 9600000
  29. #define MCLK_FREQ_NATIVE 11289600
  30. #if (IS_ENABLED(CONFIG_SOUNDWIRE_WCD_CTRL) || \
  31. IS_ENABLED(CONFIG_SOUNDWIRE_MSTR_CTRL))
  32. extern int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data);
  33. #else /* CONFIG_SOUNDWIRE_WCD_CTRL */
  34. static inline int swrm_wcd_notify(struct platform_device *pdev, u32 id,
  35. void *data)
  36. {
  37. return 0;
  38. }
  39. #endif /* CONFIG_SOUNDWIRE_WCD_CTRL */
  40. #endif /* _LINUX_SWR_WCD_H */