18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __SOC_QCOM_RPMH_H__
78c2ecf20Sopenharmony_ci#define __SOC_QCOM_RPMH_H__
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <soc/qcom/tcs.h>
108c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_QCOM_RPMH)
148c2ecf20Sopenharmony_ciint rpmh_write(const struct device *dev, enum rpmh_state state,
158c2ecf20Sopenharmony_ci	       const struct tcs_cmd *cmd, u32 n);
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciint rpmh_write_async(const struct device *dev, enum rpmh_state state,
188c2ecf20Sopenharmony_ci		     const struct tcs_cmd *cmd, u32 n);
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciint rpmh_write_batch(const struct device *dev, enum rpmh_state state,
218c2ecf20Sopenharmony_ci		     const struct tcs_cmd *cmd, u32 *n);
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_civoid rpmh_invalidate(const struct device *dev);
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#else
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistatic inline int rpmh_write(const struct device *dev, enum rpmh_state state,
288c2ecf20Sopenharmony_ci			     const struct tcs_cmd *cmd, u32 n)
298c2ecf20Sopenharmony_ci{ return -ENODEV; }
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistatic inline int rpmh_write_async(const struct device *dev,
328c2ecf20Sopenharmony_ci				   enum rpmh_state state,
338c2ecf20Sopenharmony_ci				   const struct tcs_cmd *cmd, u32 n)
348c2ecf20Sopenharmony_ci{ return -ENODEV; }
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistatic inline int rpmh_write_batch(const struct device *dev,
378c2ecf20Sopenharmony_ci				   enum rpmh_state state,
388c2ecf20Sopenharmony_ci				   const struct tcs_cmd *cmd, u32 *n)
398c2ecf20Sopenharmony_ci{ return -ENODEV; }
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistatic inline void rpmh_invalidate(const struct device *dev)
428c2ecf20Sopenharmony_ci{
438c2ecf20Sopenharmony_ci}
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#endif /* CONFIG_QCOM_RPMH */
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#endif /* __SOC_QCOM_RPMH_H__ */
48