rpmh.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SOC_QCOM_RPMH_H__
  6. #define __SOC_QCOM_RPMH_H__
  7. #include <soc/qcom/tcs.h>
  8. #include <linux/platform_device.h>
  9. #if IS_ENABLED(CONFIG_QCOM_RPMH)
  10. int rpmh_write(const struct device *dev, enum rpmh_state state,
  11. const struct tcs_cmd *cmd, u32 n);
  12. int rpmh_write_async(const struct device *dev, enum rpmh_state state,
  13. const struct tcs_cmd *cmd, u32 n);
  14. int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
  15. const struct tcs_cmd *cmd, u32 *n);
  16. void rpmh_invalidate(const struct device *dev);
  17. #else
  18. static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
  19. const struct tcs_cmd *cmd, u32 n)
  20. { return -ENODEV; }
  21. static inline int rpmh_write_async(const struct device *dev,
  22. enum rpmh_state state,
  23. const struct tcs_cmd *cmd, u32 n)
  24. { return -ENODEV; }
  25. static inline int rpmh_write_batch(const struct device *dev,
  26. enum rpmh_state state,
  27. const struct tcs_cmd *cmd, u32 *n)
  28. { return -ENODEV; }
  29. static inline void rpmh_invalidate(const struct device *dev)
  30. {
  31. }
  32. #endif /* CONFIG_QCOM_RPMH */
  33. #endif /* __SOC_QCOM_RPMH_H__ */