blob: 3421fbf1ee3e491a45ffc6b1355ff1e7a0be6f86 [file] [log] [blame]
Caleb Connolly90ff5812024-07-15 12:08:02 +02001/* 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
Caleb Connolly14794852024-07-15 12:08:13 +02009#include <dm/device-internal.h>
Caleb Connolly90ff5812024-07-15 12:08:02 +020010#include <soc/qcom/tcs.h>
Caleb Connolly90ff5812024-07-15 12:08:02 +020011
12
13#if IS_ENABLED(CONFIG_QCOM_RPMH)
Caleb Connolly14794852024-07-15 12:08:13 +020014int rpmh_write(const struct udevice *dev, enum rpmh_state state,
Caleb Connolly90ff5812024-07-15 12:08:02 +020015 const struct tcs_cmd *cmd, u32 n);
16
Caleb Connolly90ff5812024-07-15 12:08:02 +020017#else
18
19static 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 Connolly90ff5812024-07-15 12:08:02 +020023#endif /* CONFIG_QCOM_RPMH */
24
Caleb Connolly49deb542024-07-15 12:08:12 +020025/* u-boot: no multithreading */
26#define rpmh_write_async(dev, state, cmd, n) rpmh_write(dev, state, cmd, n)
27
Caleb Connolly90ff5812024-07-15 12:08:02 +020028#endif /* __SOC_QCOM_RPMH_H__ */