2018-06-20 21:27:01 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SOC_QCOM_RPMH_H__
|
|
|
|
#define __SOC_QCOM_RPMH_H__
|
|
|
|
|
|
|
|
#include <soc/qcom/tcs.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_QCOM_RPMH)
|
|
|
|
int rpmh_write(const struct device *dev, enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 n);
|
|
|
|
|
2018-06-20 21:27:05 +08:00
|
|
|
int rpmh_write_async(const struct device *dev, enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 n);
|
|
|
|
|
2018-06-20 21:27:06 +08:00
|
|
|
int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 *n);
|
|
|
|
|
2020-06-18 21:05:53 +08:00
|
|
|
void rpmh_invalidate(const struct device *dev);
|
2018-06-20 21:27:04 +08:00
|
|
|
|
2018-06-20 21:27:01 +08:00
|
|
|
#else
|
|
|
|
|
|
|
|
static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 n)
|
|
|
|
{ return -ENODEV; }
|
|
|
|
|
2018-06-20 21:27:05 +08:00
|
|
|
static inline int rpmh_write_async(const struct device *dev,
|
|
|
|
enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 n)
|
|
|
|
{ return -ENODEV; }
|
2018-06-20 21:27:04 +08:00
|
|
|
|
2018-06-20 21:27:06 +08:00
|
|
|
static inline int rpmh_write_batch(const struct device *dev,
|
|
|
|
enum rpmh_state state,
|
|
|
|
const struct tcs_cmd *cmd, u32 *n)
|
|
|
|
{ return -ENODEV; }
|
|
|
|
|
2020-06-18 21:05:53 +08:00
|
|
|
static inline void rpmh_invalidate(const struct device *dev)
|
|
|
|
{
|
|
|
|
}
|
2018-06-20 21:27:04 +08:00
|
|
|
|
2018-06-20 21:27:01 +08:00
|
|
|
#endif /* CONFIG_QCOM_RPMH */
|
|
|
|
|
|
|
|
#endif /* __SOC_QCOM_RPMH_H__ */
|