blob: 1e276e0ff466b1e03c2764da8f9cff98c46098af [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.manager;
using zx;
// TODO(ravoorir): When the system power states are properly defined,
// replace these flags.
/// All available flags currently treated as system power states.
const uint32 SUSPEND_FLAG_REBOOT = 0xdcdc0100;
const uint32 SUSPEND_FLAG_REBOOT_BOOTLOADER = 0xdcdc0101;
const uint32 SUSPEND_FLAG_REBOOT_RECOVERY = 0xdcdc0102;
const uint32 SUSPEND_FLAG_POWEROFF = 0xdcdc0200;
const uint32 SUSPEND_FLAG_MEXEC = 0xdcdc0300;
const uint32 SUSPEND_FLAG_SUSPEND_RAM = 0xdcdc0400;
enum SystemPowerState : uint8 {
SYSTEM_POWER_STATE_REBOOT = 0;
SYSTEM_POWER_STATE_REBOOT_BOOTLOADER = 1;
SYSTEM_POWER_STATE_REBOOT_RECOVERY = 2;
SYSTEM_POWER_STATE_REBOOT_POWEROFF = 3;
SYSTEM_POWER_STATE_REBOOT_MEXEC = 4;
SYSTEM_POWER_STATE_REBOOT_SUSPEND_RAM = 5;
};
const uint32 MAX_SYSTEM_POWER_STATES = 6;
/// Provides administration services for the device manager service and the device tree it controls.
[Discoverable, Layout = "Simple"]
protocol Administrator {
/// Ask all devices to enter the suspend state indicated by `flags`. Flags should be some
/// combination of `DEVICE_SUSPEND_FLAG_*` from the DDK.
Suspend(uint32 flags) -> (zx.status status);
};