blob: 41f299b255072e31f14225ad6045b747e46e9dd1 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.device.power.test;
using zx;
using fuchsia.device;
type TestStatusInfo = struct {
/// Driver will respond to suspend hook with this status.
suspend_status zx.status;
/// Driver will respond to resume hook with this status.
resume_status zx.status;
/// This is the out_power_state we want as a reply.
out_power_state uint8;
/// This is the out_perf_state we want as a reply.
out_performance_state uint8;
};
protocol TestDevice {
/// Add Test Device with some powerargs
AddDeviceWithPowerArgs(struct {
info vector<fuchsia.device.DevicePowerStateInfo>;
perf_state_info vector<fuchsia.device.DevicePerformanceStateInfo>;
make_visible bool;
}) -> (struct {}) error zx.status;
/// Get current power state of the device
GetCurrentDevicePowerState() -> (struct {
cur_state fuchsia.device.DevicePowerState;
}) error zx.status;
/// Get the suspend reason of the last suspend call
GetCurrentSuspendReason() -> (struct {
cur_suspend_reason uint8;
}) error zx.status;
/// Get current auto suspend status and deepest_sleep_state
GetCurrentDeviceAutoSuspendConfig() -> (struct {
enabled bool;
deepest_sleep_state fuchsia.device.DevicePowerState;
}) error zx.status;
SetTestStatusInfo(struct {
test_info TestStatusInfo;
}) -> (struct {}) error zx.status;
GetSuspendCompletionEvent() -> (resource struct {
event zx.handle:EVENT;
}) error zx.status;
};