Etienne Carriere | 358599e | 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 | |
| 8 | struct udevice; |
| 9 | struct scmi_msg; |
Etienne Carriere | 85dc582 | 2022-05-31 18:09:19 +0200 | [diff] [blame] | 10 | struct scmi_channel; |
Etienne Carriere | 358599e | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 11 | |
| 12 | /** |
| 13 | * struct scmi_transport_ops - The functions that a SCMI transport layer must implement. |
| 14 | */ |
| 15 | struct scmi_agent_ops { |
| 16 | /* |
Etienne Carriere | 8e96801 | 2022-05-31 18:09:21 +0200 | [diff] [blame] | 17 | * 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 Carriere | 358599e | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 26 | * process_msg - Request transport to get the SCMI message processed |
| 27 | * |
Etienne Carriere | 8bcb1b4 | 2022-05-31 18:09:18 +0200 | [diff] [blame] | 28 | * @dev: SCMI protocol device using the transport |
Etienne Carriere | 358599e | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 29 | * @msg: SCMI message to be transmitted |
| 30 | */ |
Etienne Carriere | 85dc582 | 2022-05-31 18:09:19 +0200 | [diff] [blame] | 31 | int (*process_msg)(struct udevice *dev, struct scmi_channel *channel, |
| 32 | struct scmi_msg *msg); |
Etienne Carriere | 358599e | 2020-09-09 18:44:00 +0200 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | #endif /* _SCMI_TRANSPORT_UCLASS_H */ |