Subrata Banik | 8d70cf7 | 2022-10-13 10:19:04 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Ivy Jian | 665c58b | 2023-03-16 17:18:35 +0800 | [diff] [blame] | 3 | #include <acpi/acpigen.h> |
| 4 | #include <baseboard/variants.h> |
| 5 | #include <fw_config.h> |
Subrata Banik | 8d70cf7 | 2022-10-13 10:19:04 +0530 | [diff] [blame] | 6 | #include <sar.h> |
Ivy Jian | 665c58b | 2023-03-16 17:18:35 +0800 | [diff] [blame] | 7 | #include <variant/gpio.h> |
Subrata Banik | 8d70cf7 | 2022-10-13 10:19:04 +0530 | [diff] [blame] | 8 | |
Caveh Jalali | 4519c0d | 2023-05-17 12:50:40 -0700 | [diff] [blame^] | 9 | #define TCP2_AUX_SHIFT 4 |
| 10 | #define TCP_AUX_MASK 0x03 |
| 11 | #define TCP_AUX_FOLLOW_CC1 0x01 |
| 12 | |
Subrata Banik | 8d70cf7 | 2022-10-13 10:19:04 +0530 | [diff] [blame] | 13 | const char *get_wifi_sar_cbfs_filename(void) |
| 14 | { |
| 15 | return "wifi_sar_0.hex"; |
| 16 | } |
Ivy Jian | 665c58b | 2023-03-16 17:18:35 +0800 | [diff] [blame] | 17 | |
| 18 | void variant_generate_s0ix_hook(enum s0ix_entry entry) |
| 19 | { |
| 20 | if (entry == S0IX_ENTRY) { |
| 21 | if (fw_config_probe(FW_CONFIG(UFC, UFC_USB))) |
| 22 | acpigen_soc_clear_tx_gpio(GPP_B09); |
| 23 | } else if (entry == S0IX_EXIT) { |
| 24 | if (fw_config_probe(FW_CONFIG(UFC, UFC_USB))) |
| 25 | acpigen_soc_set_tx_gpio(GPP_B09); |
| 26 | } |
| 27 | } |
Ravi Sarawadi | 9afa18f | 2023-02-07 09:33:46 -0800 | [diff] [blame] | 28 | |
| 29 | void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config) |
| 30 | { |
| 31 | config->cnvi_bt_audio_offload = fw_config_probe(FW_CONFIG(AUDIO, |
| 32 | MAX98360_ALC5682I_I2S)); |
Caveh Jalali | 4519c0d | 2023-05-17 12:50:40 -0700 | [diff] [blame^] | 33 | |
| 34 | if (fw_config_probe(FW_CONFIG(DB_USB, USB4_ANX7452)) || |
| 35 | fw_config_probe(FW_CONFIG(DB_USB, USB4_ANX7452_V2))) { |
| 36 | /* |
| 37 | * Configure TCP2 for |
| 38 | * "SBU orientation not handled by external retimer" |
| 39 | */ |
| 40 | config->tcss_aux_ori &= ~(TCP_AUX_MASK << TCP2_AUX_SHIFT); |
| 41 | config->tcss_aux_ori |= TCP_AUX_FOLLOW_CC1 << TCP2_AUX_SHIFT; |
| 42 | } |
Ravi Sarawadi | 9afa18f | 2023-02-07 09:33:46 -0800 | [diff] [blame] | 43 | } |