swr-wcd.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (c) 2015, 2017-2018 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 _LINUX_SWR_WCD_H
  13. #define _LINUX_SWR_WCD_H
  14. #include <linux/module.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/device.h>
  17. #include <linux/bitops.h>
  18. enum {
  19. SWR_CH_MAP,
  20. SWR_DEVICE_DOWN,
  21. SWR_DEVICE_UP,
  22. SWR_SUBSYS_RESTART,
  23. SWR_SET_NUM_RX_CH,
  24. SWR_CLK_FREQ,
  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 */