Sudeep Holla | aa4f886 | 2017-03-28 11:36:07 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * SCMI Message Protocol driver header |
| 4 | * |
| 5 | * Copyright (C) 2018 ARM Ltd. |
| 6 | */ |
| 7 | #include <linux/types.h> |
| 8 | |
Sudeep Holla | b6f20ff | 2017-06-06 11:16:15 +0100 | [diff] [blame^] | 9 | #define SCMI_MAX_STR_SIZE 16 |
| 10 | |
| 11 | /** |
| 12 | * struct scmi_revision_info - version information structure |
| 13 | * |
| 14 | * @major_ver: Major ABI version. Change here implies risk of backward |
| 15 | * compatibility break. |
| 16 | * @minor_ver: Minor ABI version. Change here implies new feature addition, |
| 17 | * or compatible change in ABI. |
| 18 | * @num_protocols: Number of protocols that are implemented, excluding the |
| 19 | * base protocol. |
| 20 | * @num_agents: Number of agents in the system. |
| 21 | * @impl_ver: A vendor-specific implementation version. |
| 22 | * @vendor_id: A vendor identifier(Null terminated ASCII string) |
| 23 | * @sub_vendor_id: A sub-vendor identifier(Null terminated ASCII string) |
| 24 | */ |
| 25 | struct scmi_revision_info { |
| 26 | u16 major_ver; |
| 27 | u16 minor_ver; |
| 28 | u8 num_protocols; |
| 29 | u8 num_agents; |
| 30 | u32 impl_ver; |
| 31 | char vendor_id[SCMI_MAX_STR_SIZE]; |
| 32 | char sub_vendor_id[SCMI_MAX_STR_SIZE]; |
| 33 | }; |
| 34 | |
Sudeep Holla | aa4f886 | 2017-03-28 11:36:07 +0100 | [diff] [blame] | 35 | /** |
| 36 | * struct scmi_handle - Handle returned to ARM SCMI clients for usage. |
| 37 | * |
| 38 | * @dev: pointer to the SCMI device |
Sudeep Holla | b6f20ff | 2017-06-06 11:16:15 +0100 | [diff] [blame^] | 39 | * @version: pointer to the structure containing SCMI version information |
Sudeep Holla | aa4f886 | 2017-03-28 11:36:07 +0100 | [diff] [blame] | 40 | */ |
| 41 | struct scmi_handle { |
| 42 | struct device *dev; |
Sudeep Holla | b6f20ff | 2017-06-06 11:16:15 +0100 | [diff] [blame^] | 43 | struct scmi_revision_info *version; |
| 44 | }; |
| 45 | |
| 46 | enum scmi_std_protocol { |
| 47 | SCMI_PROTOCOL_BASE = 0x10, |
| 48 | SCMI_PROTOCOL_POWER = 0x11, |
| 49 | SCMI_PROTOCOL_SYSTEM = 0x12, |
| 50 | SCMI_PROTOCOL_PERF = 0x13, |
| 51 | SCMI_PROTOCOL_CLOCK = 0x14, |
| 52 | SCMI_PROTOCOL_SENSOR = 0x15, |
Sudeep Holla | aa4f886 | 2017-03-28 11:36:07 +0100 | [diff] [blame] | 53 | }; |