Implement support for RPMh reads, these allow reading out the current votes for RPMh controlled resources such as regulators and interconnects. Link: https://patch.msgid.link/20260108-rpmh-regulator-fixes-v1-4-d1b5b300b665@linaro.org Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
31 lines
879 B
C
31 lines
879 B
C
/* 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 <dm/device-internal.h>
|
|
#include <soc/qcom/tcs.h>
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_QCOM_RPMH)
|
|
int rpmh_write(const struct udevice *dev, enum rpmh_state state,
|
|
const struct tcs_cmd *cmd, u32 n);
|
|
int rpmh_read(const struct udevice *dev, enum rpmh_state state, struct tcs_cmd *cmd);
|
|
#else
|
|
|
|
static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
|
|
const struct tcs_cmd *cmd, u32 n)
|
|
{ return -ENODEV; }
|
|
static inline int rpmh_read(const struct udevice *dev, struct tcs_cmd *cmd)
|
|
{ return -ENODEV; }
|
|
|
|
#endif /* CONFIG_QCOM_RPMH */
|
|
|
|
/* u-boot: no multithreading */
|
|
#define rpmh_write_async(dev, state, cmd, n) rpmh_write(dev, state, cmd, n)
|
|
|
|
#endif /* __SOC_QCOM_RPMH_H__ */
|