| // 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 ddk.protocol.power; |
| |
| using zx; |
| |
| enum PowerDomainStatus : uint8 { |
| DISABLED = 1; |
| ENABLED = 2; |
| }; |
| |
| [Layout = "ddk-protocol"] |
| protocol Power { |
| /// Enable power domain |
| EnablePowerDomain() -> (zx.status s); |
| /// Disable power domain |
| DisablePowerDomain() -> (zx.status s); |
| /// Get Supported Voltage Range |
| GetSupportedVoltageRange() -> (zx.status s, uint32 min, uint32 max); |
| /// Request a particular voltage |
| RequestVoltage(uint32 voltage) -> (zx.status s, uint32 actual_voltage); |
| /// Get current voltage |
| GetCurrentVoltage(uint32 index) -> (zx.status s, uint32 current_voltage); |
| /// Get power domain status |
| GetPowerDomainStatus() -> (zx.status s, PowerDomainStatus status); |
| /// Write to ctrl register of PMIC |
| WritePmicCtrlReg(uint32 reg_addr, uint32 value) -> (zx.status s); |
| /// Read ctrl register of PMIC |
| ReadPmicCtrlReg(uint32 reg_addr) -> (zx.status s, uint32 value); |
| }; |