1 // SPDX-License-Identifier: GPL-2.0+
3 * Test for power-management controller uclass (PMC)
5 * Copyright 2019 Google LLC
10 #include <power/acpi_pmc.h>
14 /* Base test of the PMC uclass */
15 static int dm_test_pmc_base(struct unit_test_state *uts)
17 struct acpi_pmc_upriv *upriv;
20 ut_assertok(uclass_first_device_err(UCLASS_ACPI_PMC, &dev));
22 ut_assertok(pmc_disable_tco(dev));
23 ut_assertok(pmc_init(dev));
24 ut_assertok(pmc_prev_sleep_state(dev));
26 /* Check some values to see that I/O works */
27 upriv = dev_get_uclass_priv(dev);
28 ut_asserteq(0x24, upriv->gpe0_sts[1]);
29 ut_asserteq(0x64, upriv->tco1_sts);
33 DM_TEST(dm_test_pmc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);