wcd-spi-ac.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (c) 2018-2019, 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 __WCD_SPI_AC_H__
  13. #define __WCD_SPI_AC_H__
  14. #include <linux/types.h>
  15. #include <linux/bitops.h>
  16. enum wcd_spi_acc_req {
  17. WCD_SPI_ACCESS_REQUEST,
  18. WCD_SPI_ACCESS_RELEASE,
  19. WCD_SPI_ACCESS_MAX,
  20. };
  21. #define WCD_SPI_AC_DATA_TRANSFER BIT(0)
  22. #define WCD_SPI_AC_CONCURRENCY BIT(1)
  23. #define WCD_SPI_AC_REMOTE_DOWN BIT(2)
  24. #define WCD_SPI_AC_SVC_OFFLINE BIT(3)
  25. #define WCD_SPI_AC_UNINITIALIZED BIT(4)
  26. #if IS_ENABLED(CONFIG_WCD_SPI_AC)
  27. int wcd_spi_access_ctl(struct device *dev,
  28. enum wcd_spi_acc_req req,
  29. u32 reason);
  30. #else
  31. int wcd_spi_access_ctl(struct device *dev,
  32. enum wcd_spi_acc_req req,
  33. u32 reason)
  34. {
  35. return 0;
  36. }
  37. #endif /* end of CONFIG_WCD_SPI_AC */
  38. #endif /* end of __WCD_SPI_AC_H__ */