swr-wcd.h 1.2 KB

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