developer | 0f312e8 | 2022-11-01 12:31:52 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: ISC */ |
| 2 | /* Copyright (C) 2022 MediaTek Inc. */ |
| 3 | |
| 4 | #ifndef __MT7921_ACPI_SAR_H |
| 5 | #define __MT7921_ACPI_SAR_H |
| 6 | |
| 7 | #define MT7921_ASAR_MIN_DYN 1 |
| 8 | #define MT7921_ASAR_MAX_DYN 8 |
| 9 | #define MT7921_ASAR_MIN_GEO 3 |
| 10 | #define MT7921_ASAR_MAX_GEO 8 |
| 11 | |
| 12 | #define MT7921_ACPI_MTCL "MTCL" |
| 13 | #define MT7921_ACPI_MTDS "MTDS" |
| 14 | #define MT7921_ACPI_MTGS "MTGS" |
| 15 | |
| 16 | struct mt7921_asar_dyn_limit { |
| 17 | u8 idx; |
| 18 | u8 frp[5]; |
| 19 | } __packed; |
| 20 | |
| 21 | struct mt7921_asar_dyn { |
| 22 | u8 names[4]; |
| 23 | u8 enable; |
| 24 | u8 nr_tbl; |
| 25 | struct mt7921_asar_dyn_limit tbl[0]; |
| 26 | } __packed; |
| 27 | |
| 28 | struct mt7921_asar_dyn_limit_v2 { |
| 29 | u8 idx; |
| 30 | u8 frp[11]; |
| 31 | } __packed; |
| 32 | |
| 33 | struct mt7921_asar_dyn_v2 { |
| 34 | u8 names[4]; |
| 35 | u8 enable; |
| 36 | u8 rsvd; |
| 37 | u8 nr_tbl; |
| 38 | struct mt7921_asar_dyn_limit_v2 tbl[0]; |
| 39 | } __packed; |
| 40 | |
| 41 | struct mt7921_asar_geo_band { |
| 42 | u8 pwr; |
| 43 | u8 offset; |
| 44 | } __packed; |
| 45 | |
| 46 | struct mt7921_asar_geo_limit { |
| 47 | u8 idx; |
| 48 | /* 0:2G, 1:5G */ |
| 49 | struct mt7921_asar_geo_band band[2]; |
| 50 | } __packed; |
| 51 | |
| 52 | struct mt7921_asar_geo { |
| 53 | u8 names[4]; |
| 54 | u8 version; |
| 55 | u8 nr_tbl; |
| 56 | struct mt7921_asar_geo_limit tbl[0]; |
| 57 | } __packed; |
| 58 | |
| 59 | struct mt7921_asar_geo_limit_v2 { |
| 60 | u8 idx; |
| 61 | /* 0:2G, 1:5G, 2:6G */ |
| 62 | struct mt7921_asar_geo_band band[3]; |
| 63 | } __packed; |
| 64 | |
| 65 | struct mt7921_asar_geo_v2 { |
| 66 | u8 names[4]; |
| 67 | u8 version; |
| 68 | u8 rsvd; |
| 69 | u8 nr_tbl; |
| 70 | struct mt7921_asar_geo_limit_v2 tbl[0]; |
| 71 | } __packed; |
| 72 | |
| 73 | struct mt7921_asar_cl { |
| 74 | u8 names[4]; |
| 75 | u8 version; |
| 76 | u8 mode_6g; |
| 77 | u8 cl6g[6]; |
| 78 | } __packed; |
| 79 | |
| 80 | struct mt7921_acpi_sar { |
| 81 | u8 ver; |
| 82 | union { |
| 83 | struct mt7921_asar_dyn *dyn; |
| 84 | struct mt7921_asar_dyn_v2 *dyn_v2; |
| 85 | }; |
| 86 | union { |
| 87 | struct mt7921_asar_geo *geo; |
| 88 | struct mt7921_asar_geo_v2 *geo_v2; |
| 89 | }; |
| 90 | struct mt7921_asar_cl *countrylist; |
| 91 | }; |
| 92 | |
| 93 | #endif |