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 } __packed; 81 82 struct mt792x_asar_fg { 83 u8 names[4]; 84 u8 version; 85 u8 rsvd; 86 u8 nr_flag; 87 u8 rsvd1; 88 u8 flag[]; 89 } __packed; 90 91 struct mt792x_acpi_sar { 92 u8 ver; 93 union { 94 struct mt792x_asar_dyn *dyn; 95 struct mt792x_asar_dyn_v2 *dyn_v2; 96 }; 97 union { 98 struct mt792x_asar_geo *geo; 99 struct mt792x_asar_geo_v2 *geo_v2; 100 }; 101 struct mt792x_asar_cl *countrylist; 102 struct mt792x_asar_fg *fg; 103 }; 104 105 #endif 106