blob: 425dff8f2191dbe734926556332c61895b565557 [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;
/// All available suspend flags
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;
/// TODO(ravoorir): When the system power states are properly defined,
/// remove the suspend flags. For now, treat each suspend flag as a system
/// power state.
enum SystemPowerState : uint8 {
SYSTEM_POWER_STATE_REBOOT = 0;
SYSTEM_POWER_STATE_REBOOT_BOOTLOADER = 1;
SYSTEM_POWER_STATE_REBOOT_RECOVERY = 2;
SYSTEM_POWER_STATE_POWEROFF = 3;
SYSTEM_POWER_STATE_MEXEC = 4;
SYSTEM_POWER_STATE_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);
};