blob: 258aa0f37596762dbb54085d7e67b78f9ea566ec [file] [log] [blame]
Etienne Carriere02fd1262020-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
AKASHI Takahiro6c90f822023-10-11 19:06:58 +09008#include <dm/device.h>
9
Etienne Carriere02fd1262020-09-09 18:44:00 +020010struct scmi_msg;
Etienne Carriere05440292022-05-31 18:09:19 +020011struct scmi_channel;
Etienne Carriere02fd1262020-09-09 18:44:00 +020012
13/**
AKASHI Takahiro6c90f822023-10-11 19:06:58 +090014 * struct scmi_agent_priv - private data maintained by agent instance
15 * @clock_dev: SCMI clock protocol device
16 * @resetdom_dev: SCMI reset domain protocol device
17 * @voltagedom_dev: SCMI voltage domain protocol device
18 */
19struct scmi_agent_priv {
20 struct udevice *clock_dev;
21 struct udevice *resetdom_dev;
22 struct udevice *voltagedom_dev;
23};
24
25/**
Etienne Carriere02fd1262020-09-09 18:44:00 +020026 * struct scmi_transport_ops - The functions that a SCMI transport layer must implement.
27 */
28struct scmi_agent_ops {
29 /*
Etienne Carriere187cea12022-05-31 18:09:21 +020030 * of_get_channel - Get SCMI channel from SCMI agent device tree node
31 *
AKASHI Takahiro589ec9a2023-10-11 19:06:55 +090032 * @dev: SCMI agent device using the transport
33 * @protocol: SCMI protocol device using the transport
Etienne Carriere187cea12022-05-31 18:09:21 +020034 * @channel: Output reference to SCMI channel upon success
35 * Return 0 upon success and a negative errno on failure
36 */
AKASHI Takahiro589ec9a2023-10-11 19:06:55 +090037 int (*of_get_channel)(struct udevice *dev, struct udevice *protocol,
38 struct scmi_channel **channel);
Etienne Carriere187cea12022-05-31 18:09:21 +020039
40 /*
Etienne Carriere02fd1262020-09-09 18:44:00 +020041 * process_msg - Request transport to get the SCMI message processed
42 *
AKASHI Takahiro589ec9a2023-10-11 19:06:55 +090043 * @dev: SCMI agent device using the transport
Etienne Carriere02fd1262020-09-09 18:44:00 +020044 * @msg: SCMI message to be transmitted
45 */
Etienne Carriere05440292022-05-31 18:09:19 +020046 int (*process_msg)(struct udevice *dev, struct scmi_channel *channel,
47 struct scmi_msg *msg);
Etienne Carriere02fd1262020-09-09 18:44:00 +020048};
49
50#endif /* _SCMI_TRANSPORT_UCLASS_H */