blob: b1c93532c0eac440fd187e0aac6618663a680aba [file] [log] [blame]
Etienne Carriere358599e2020-09-09 18:44:00 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2019-2020 Linaro Limited.
4 */
5#ifndef _SCMI_AGENT_UCLASS_H
6#define _SCMI_AGENT_UCLASS_H
7
8struct udevice;
9struct scmi_msg;
Etienne Carriere85dc5822022-05-31 18:09:19 +020010struct scmi_channel;
Etienne Carriere358599e2020-09-09 18:44:00 +020011
12/**
13 * struct scmi_transport_ops - The functions that a SCMI transport layer must implement.
14 */
15struct scmi_agent_ops {
16 /*
Etienne Carriere8e968012022-05-31 18:09:21 +020017 * of_get_channel - Get SCMI channel from SCMI agent device tree node
18 *
19 * @dev: SCMI protocol device using the transport
20 * @channel: Output reference to SCMI channel upon success
21 * Return 0 upon success and a negative errno on failure
22 */
23 int (*of_get_channel)(struct udevice *dev, struct scmi_channel **channel);
24
25 /*
Etienne Carriere358599e2020-09-09 18:44:00 +020026 * process_msg - Request transport to get the SCMI message processed
27 *
Etienne Carriere8bcb1b42022-05-31 18:09:18 +020028 * @dev: SCMI protocol device using the transport
Etienne Carriere358599e2020-09-09 18:44:00 +020029 * @msg: SCMI message to be transmitted
30 */
Etienne Carriere85dc5822022-05-31 18:09:19 +020031 int (*process_msg)(struct udevice *dev, struct scmi_channel *channel,
32 struct scmi_msg *msg);
Etienne Carriere358599e2020-09-09 18:44:00 +020033};
34
35#endif /* _SCMI_TRANSPORT_UCLASS_H */