swr-wcd.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. SWR_REGISTER_WAKEUP,
  24. SWR_DEREGISTER_WAKEUP,
  25. };
  26. struct swr_mstr_port {
  27. int num_port;
  28. u8 *port;
  29. };
  30. #define MCLK_FREQ 9600000
  31. #define MCLK_FREQ_NATIVE 11289600
  32. #if (IS_ENABLED(CONFIG_SOUNDWIRE_WCD_CTRL) || \
  33. IS_ENABLED(CONFIG_SOUNDWIRE_MSTR_CTRL))
  34. extern int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data);
  35. #else /* CONFIG_SOUNDWIRE_WCD_CTRL */
  36. static inline int swrm_wcd_notify(struct platform_device *pdev, u32 id,
  37. void *data)
  38. {
  39. return 0;
  40. }
  41. #endif /* CONFIG_SOUNDWIRE_WCD_CTRL */
  42. #endif /* _LINUX_SWR_WCD_H */