diff options
author | Lina Iyer <ilina@codeaurora.org> | 2018-06-20 18:57:01 +0530 |
---|---|---|
committer | Andy Gross <andy.gross@linaro.org> | 2018-07-21 13:32:40 -0500 |
commit | c1038456b02b86cc4445441a8d33c5aca0ac103e (patch) | |
tree | 6f46aa9f6099d620b67b72c3faec2eafeb4a35cd /include/soc | |
parent | fc087fe5a45e7210be89fe015505e1bb3746395c (diff) | |
download | linux-c1038456b02b86cc4445441a8d33c5aca0ac103e.tar.bz2 |
drivers: qcom: rpmh: add RPMH helper functions
Sending RPMH requests and waiting for response from the controller
through a callback is common functionality across all platform drivers.
To simplify drivers, add a library functions to create RPMH client and
send resource state requests.
rpmh_write() is a synchronous blocking call that can be used to send
active state requests.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/qcom/rpmh.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/soc/qcom/rpmh.h b/include/soc/qcom/rpmh.h new file mode 100644 index 000000000000..c1d0f902bd71 --- /dev/null +++ b/include/soc/qcom/rpmh.h @@ -0,0 +1,25 @@ +/* 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); + +#else + +static inline int rpmh_write(const struct device *dev, enum rpmh_state state, + const struct tcs_cmd *cmd, u32 n) +{ return -ENODEV; } + +#endif /* CONFIG_QCOM_RPMH */ + +#endif /* __SOC_QCOM_RPMH_H__ */ |