summaryrefslogtreecommitdiff
path: root/src/soc/amd/cezanne
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-05-12 01:42:37 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-05-13 00:58:26 +0000
commit2d0bf34201b68e10597c16d5684c14dd4c9587ea (patch)
treefe54921a0c78d4e3ee68d84396367d56cb1ddfa4 /src/soc/amd/cezanne
parentdd882f3812c5fe2fa3f709ed5e61938e723ba51d (diff)
soc/amd: factor out acpigen_write_alib_dptc to common code
Also drop unneeded intermediate cast to void * before casting the address of the struct dptc_input type variables to uint8_t *. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ie1e2aa1ec728a4e16d3a587d7400cdfc8962f443 Reviewed-on: https://review.coreboot.org/c/coreboot/+/54077 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/cezanne')
-rw-r--r--src/soc/amd/cezanne/root_complex.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/soc/amd/cezanne/root_complex.c b/src/soc/amd/cezanne/root_complex.c
index 3ed137ce19..f101680228 100644
--- a/src/soc/amd/cezanne/root_complex.c
+++ b/src/soc/amd/cezanne/root_complex.c
@@ -195,29 +195,9 @@ static void acipgen_dptci(void)
config->sustained_power_limit_tablet_mode_mW,
config->fast_ppt_limit_tablet_mode_mW,
config->slow_ppt_limit_tablet_mode_mW);
- /* Scope (\_SB) */
- acpigen_write_scope("\\_SB");
- /* Method(DPTC, 0, Serialized) */
- acpigen_write_method_serialized("DPTC", 0);
-
- /* TODO: The code assumes that if DPTC gets called the following object exists */
- /* If (LEqual ("\_SB.PCI0.LPCB.EC0.TBMD", 1)) */
- acpigen_write_if_lequal_namestr_int("\\_SB.PCI0.LPCB.EC0.TBMD", 1);
-
- acpigen_dptc_call_alib("TABB", (uint8_t *)(void *)&tablet_mode_input,
- sizeof(tablet_mode_input));
-
- /* Else */
- acpigen_write_else();
-
- acpigen_dptc_call_alib("DEFB", (uint8_t *)(void *)&default_input,
- sizeof(default_input));
-
- acpigen_pop_len(); /* Else */
-
- acpigen_pop_len(); /* Method DPTC */
- acpigen_pop_len(); /* Scope \_SB */
+ acpigen_write_alib_dptc((uint8_t *)&default_input, sizeof(default_input),
+ (uint8_t *)&tablet_mode_input, sizeof(tablet_mode_input));
}
static void root_complex_fill_ssdt(const struct device *device)