0001
0002
0003
0004
0005
0006 #ifndef __SOC_QCOM_RPMH_H__
0007 #define __SOC_QCOM_RPMH_H__
0008
0009 #include <soc/qcom/tcs.h>
0010 #include <linux/platform_device.h>
0011
0012
0013 #if IS_ENABLED(CONFIG_QCOM_RPMH)
0014 int rpmh_write(const struct device *dev, enum rpmh_state state,
0015 const struct tcs_cmd *cmd, u32 n);
0016
0017 int rpmh_write_async(const struct device *dev, enum rpmh_state state,
0018 const struct tcs_cmd *cmd, u32 n);
0019
0020 int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
0021 const struct tcs_cmd *cmd, u32 *n);
0022
0023 void rpmh_invalidate(const struct device *dev);
0024
0025 #else
0026
0027 static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
0028 const struct tcs_cmd *cmd, u32 n)
0029 { return -ENODEV; }
0030
0031 static inline int rpmh_write_async(const struct device *dev,
0032 enum rpmh_state state,
0033 const struct tcs_cmd *cmd, u32 n)
0034 { return -ENODEV; }
0035
0036 static inline int rpmh_write_batch(const struct device *dev,
0037 enum rpmh_state state,
0038 const struct tcs_cmd *cmd, u32 *n)
0039 { return -ENODEV; }
0040
0041 static inline void rpmh_invalidate(const struct device *dev)
0042 {
0043 }
0044
0045 #endif
0046
0047 #endif