2020-09-09 16:44:00 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2019-2020 Linaro Limited.
|
|
|
|
*/
|
|
|
|
#ifndef _SCMI_AGENT_UCLASS_H
|
|
|
|
#define _SCMI_AGENT_UCLASS_H
|
|
|
|
|
2023-10-11 10:06:58 +00:00
|
|
|
#include <dm/device.h>
|
|
|
|
|
2020-09-09 16:44:00 +00:00
|
|
|
struct scmi_msg;
|
2022-05-31 16:09:19 +00:00
|
|
|
struct scmi_channel;
|
2020-09-09 16:44:00 +00:00
|
|
|
|
2023-10-11 10:06:58 +00:00
|
|
|
/**
|
|
|
|
* struct scmi_agent_priv - private data maintained by agent instance
|
|
|
|
* @clock_dev: SCMI clock protocol device
|
|
|
|
* @resetdom_dev: SCMI reset domain protocol device
|
|
|
|
* @voltagedom_dev: SCMI voltage domain protocol device
|
|
|
|
*/
|
|
|
|
struct scmi_agent_priv {
|
|
|
|
struct udevice *clock_dev;
|
|
|
|
struct udevice *resetdom_dev;
|
|
|
|
struct udevice *voltagedom_dev;
|
|
|
|
};
|
|
|
|
|
2020-09-09 16:44:00 +00:00
|
|
|
/**
|
|
|
|
* struct scmi_transport_ops - The functions that a SCMI transport layer must implement.
|
|
|
|
*/
|
|
|
|
struct scmi_agent_ops {
|
2022-05-31 16:09:21 +00:00
|
|
|
/*
|
|
|
|
* of_get_channel - Get SCMI channel from SCMI agent device tree node
|
|
|
|
*
|
2023-10-11 10:06:55 +00:00
|
|
|
* @dev: SCMI agent device using the transport
|
|
|
|
* @protocol: SCMI protocol device using the transport
|
2022-05-31 16:09:21 +00:00
|
|
|
* @channel: Output reference to SCMI channel upon success
|
|
|
|
* Return 0 upon success and a negative errno on failure
|
|
|
|
*/
|
2023-10-11 10:06:55 +00:00
|
|
|
int (*of_get_channel)(struct udevice *dev, struct udevice *protocol,
|
|
|
|
struct scmi_channel **channel);
|
2022-05-31 16:09:21 +00:00
|
|
|
|
2020-09-09 16:44:00 +00:00
|
|
|
/*
|
|
|
|
* process_msg - Request transport to get the SCMI message processed
|
|
|
|
*
|
2023-10-11 10:06:55 +00:00
|
|
|
* @dev: SCMI agent device using the transport
|
2020-09-09 16:44:00 +00:00
|
|
|
* @msg: SCMI message to be transmitted
|
|
|
|
*/
|
2022-05-31 16:09:19 +00:00
|
|
|
int (*process_msg)(struct udevice *dev, struct scmi_channel *channel,
|
|
|
|
struct scmi_msg *msg);
|
2020-09-09 16:44:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _SCMI_TRANSPORT_UCLASS_H */
|