wcd-spi-ac.h 849 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  3. */
  4. #ifndef __WCD_SPI_AC_H__
  5. #define __WCD_SPI_AC_H__
  6. #include <linux/types.h>
  7. #include <linux/bitops.h>
  8. enum wcd_spi_acc_req {
  9. WCD_SPI_ACCESS_REQUEST,
  10. WCD_SPI_ACCESS_RELEASE,
  11. WCD_SPI_ACCESS_MAX,
  12. };
  13. #define WCD_SPI_AC_DATA_TRANSFER BIT(0)
  14. #define WCD_SPI_AC_CONCURRENCY BIT(1)
  15. #define WCD_SPI_AC_REMOTE_DOWN BIT(2)
  16. #define WCD_SPI_AC_SVC_OFFLINE BIT(3)
  17. #define WCD_SPI_AC_UNINITIALIZED BIT(4)
  18. #if IS_ENABLED(CONFIG_WCD_SPI_AC)
  19. int wcd_spi_access_ctl(struct device *dev,
  20. enum wcd_spi_acc_req req,
  21. u32 reason);
  22. #else
  23. int wcd_spi_access_ctl(struct device *dev,
  24. enum wcd_spi_acc_req req,
  25. u32 reason)
  26. {
  27. return 0;
  28. }
  29. #endif /* end of CONFIG_WCD_SPI_AC */
  30. #endif /* end of __WCD_SPI_AC_H__ */