Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 1 | /* 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 Takahiro | 6c90f82 | 2023-10-11 19:06:58 +0900 | [diff] [blame^] | 8 | #include <dm/device.h> |
| 9 | |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 10 | struct scmi_msg; |
Etienne Carriere | 0544029 | 2022-05-31 18:09:19 +0200 | [diff] [blame] | 11 | struct scmi_channel; |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 12 | |
| 13 | /** |
AKASHI Takahiro | 6c90f82 | 2023-10-11 19:06:58 +0900 | [diff] [blame^] | 14 | * 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 | */ |
| 19 | struct scmi_agent_priv { |
| 20 | struct udevice *clock_dev; |
| 21 | struct udevice *resetdom_dev; |
| 22 | struct udevice *voltagedom_dev; |
| 23 | }; |
| 24 | |
| 25 | /** |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 26 | * struct scmi_transport_ops - The functions that a SCMI transport layer must implement. |
| 27 | */ |
| 28 | struct scmi_agent_ops { |
| 29 | /* |
Etienne Carriere | 187cea1 | 2022-05-31 18:09:21 +0200 | [diff] [blame] | 30 | * of_get_channel - Get SCMI channel from SCMI agent device tree node |
| 31 | * |
AKASHI Takahiro | 589ec9a | 2023-10-11 19:06:55 +0900 | [diff] [blame] | 32 | * @dev: SCMI agent device using the transport |
| 33 | * @protocol: SCMI protocol device using the transport |
Etienne Carriere | 187cea1 | 2022-05-31 18:09:21 +0200 | [diff] [blame] | 34 | * @channel: Output reference to SCMI channel upon success |
| 35 | * Return 0 upon success and a negative errno on failure |
| 36 | */ |
AKASHI Takahiro | 589ec9a | 2023-10-11 19:06:55 +0900 | [diff] [blame] | 37 | int (*of_get_channel)(struct udevice *dev, struct udevice *protocol, |
| 38 | struct scmi_channel **channel); |
Etienne Carriere | 187cea1 | 2022-05-31 18:09:21 +0200 | [diff] [blame] | 39 | |
| 40 | /* |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 41 | * process_msg - Request transport to get the SCMI message processed |
| 42 | * |
AKASHI Takahiro | 589ec9a | 2023-10-11 19:06:55 +0900 | [diff] [blame] | 43 | * @dev: SCMI agent device using the transport |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 44 | * @msg: SCMI message to be transmitted |
| 45 | */ |
Etienne Carriere | 0544029 | 2022-05-31 18:09:19 +0200 | [diff] [blame] | 46 | int (*process_msg)(struct udevice *dev, struct scmi_channel *channel, |
| 47 | struct scmi_msg *msg); |
Etienne Carriere | 02fd126 | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | #endif /* _SCMI_TRANSPORT_UCLASS_H */ |