1 /* SPDX-License-Identifier: ISC */ 2 /* Copyright (C) 2023 MediaTek Inc. */ 3 4 #ifndef __MT7921_ACPI_SAR_H 5 #define __MT7921_ACPI_SAR_H 6 7 #define MT792x_ASAR_MIN_DYN 1 8 #define MT792x_ASAR_MAX_DYN 8 9 #define MT792x_ASAR_MIN_GEO 3 10 #define MT792x_ASAR_MAX_GEO 8 11 #define MT792x_ASAR_MIN_FG 8 12 13 #define MT792x_ACPI_MTCL "MTCL" 14 #define MT792x_ACPI_MTDS "MTDS" 15 #define MT792x_ACPI_MTGS "MTGS" 16 #define MT792x_ACPI_MTFG "MTFG" 17 18 struct mt792x_asar_dyn_limit { 19 u8 idx; 20 u8 frp[5]; 21 } __packed; 22 23 struct mt792x_asar_dyn { 24 u8 names[4]; 25 u8 enable; 26 u8 nr_tbl; 27 DECLARE_FLEX_ARRAY(struct mt792x_asar_dyn_limit, tbl); 28 } __packed; 29 30 struct mt792x_asar_dyn_limit_v2 { 31 u8 idx; 32 u8 frp[11]; 33 } __packed; 34 35 struct mt792x_asar_dyn_v2 { 36 u8 names[4]; 37 u8 enable; 38 u8 rsvd; 39 u8 nr_tbl; 40 DECLARE_FLEX_ARRAY(struct mt792x_asar_dyn_limit_v2, tbl); 41 } __packed; 42 43 struct mt792x_asar_geo_band { 44 u8 pwr; 45 u8 offset; 46 } __packed; 47 48 struct mt792x_asar_geo_limit { 49 u8 idx; 50 /* 0:2G, 1:5G */ 51 struct mt792x_asar_geo_band band[2]; 52 } __packed; 53 54 struct mt792x_asar_geo { 55 u8 names[4]; 56 u8 version; 57 u8 nr_tbl; 58 DECLARE_FLEX_ARRAY(struct mt792x_asar_geo_limit, tbl); 59 } __packed; 60 61 struct mt792x_asar_geo_limit_v2 { 62 u8 idx; 63 /* 0:2G, 1:5G, 2:6G */ 64 struct mt792x_asar_geo_band band[3]; 65 } __packed; 66 67 struct mt792x_asar_geo_v2 { 68 u8 names[4]; 69 u8 version; 70 u8 rsvd; 71 u8 nr_tbl; 72 DECLARE_FLEX_ARRAY(struct mt792x_asar_geo_limit_v2, tbl); 73 } __packed; 74 75 struct mt792x_asar_cl { 76 u8 names[4]; 77 u8 version; 78 u8 mode_6g; 79 u8 cl6g[6]; 80 u8 mode_5g9; 81 u8 cl5g9[6]; 82 } __packed; 83 84 struct mt792x_asar_fg { 85 u8 names[4]; 86 u8 version; 87 u8 rsvd; 88 u8 nr_flag; 89 u8 rsvd1; 90 u8 flag[]; 91 } __packed; 92 93 struct mt792x_acpi_sar { 94 u8 ver; 95 union { 96 struct mt792x_asar_dyn *dyn; 97 struct mt792x_asar_dyn_v2 *dyn_v2; 98 }; 99 union { 100 struct mt792x_asar_geo *geo; 101 struct mt792x_asar_geo_v2 *geo_v2; 102 }; 103 struct mt792x_asar_cl *countrylist; 104 struct mt792x_asar_fg *fg; 105 }; 106 107 #endif 108