rpmh.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. int rpmh_flush(const struct device *dev);
  17. int rpmh_invalidate(const struct device *dev);
  18. #else
  19. static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
  20. const struct tcs_cmd *cmd, u32 n)
  21. { return -ENODEV; }
  22. static inline int rpmh_write_async(const struct device *dev,
  23. enum rpmh_state state,
  24. const struct tcs_cmd *cmd, u32 n)
  25. { return -ENODEV; }
  26. static inline int rpmh_write_batch(const struct device *dev,
  27. enum rpmh_state state,
  28. const struct tcs_cmd *cmd, u32 *n)
  29. { return -ENODEV; }
  30. static inline int rpmh_flush(const struct device *dev)
  31. { return -ENODEV; }
  32. static inline int rpmh_invalidate(const struct device *dev)
  33. { return -ENODEV; }
  34. #endif /* CONFIG_QCOM_RPMH */
  35. #endif /* __SOC_QCOM_RPMH_H__ */