Caleb Connolly | 90ff581 | 2024-07-15 12:08:02 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #ifndef __SOC_QCOM_RPMH_H__ |
| 7 | #define __SOC_QCOM_RPMH_H__ |
| 8 | |
| 9 | #include <soc/qcom/tcs.h> |
| 10 | #include <linux/platform_device.h> |
| 11 | |
| 12 | |
| 13 | #if IS_ENABLED(CONFIG_QCOM_RPMH) |
| 14 | int rpmh_write(const struct device *dev, enum rpmh_state state, |
| 15 | const struct tcs_cmd *cmd, u32 n); |
| 16 | |
Caleb Connolly | 90ff581 | 2024-07-15 12:08:02 +0200 | [diff] [blame] | 17 | #else |
| 18 | |
| 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 | |
Caleb Connolly | 90ff581 | 2024-07-15 12:08:02 +0200 | [diff] [blame] | 23 | #endif /* CONFIG_QCOM_RPMH */ |
| 24 | |
Caleb Connolly | 49deb54 | 2024-07-15 12:08:12 +0200 | [diff] [blame^] | 25 | /* u-boot: no multithreading */ |
| 26 | #define rpmh_write_async(dev, state, cmd, n) rpmh_write(dev, state, cmd, n) |
| 27 | |
Caleb Connolly | 90ff581 | 2024-07-15 12:08:02 +0200 | [diff] [blame] | 28 | #endif /* __SOC_QCOM_RPMH_H__ */ |