blob: ef9d69d6bc484f964a15535bf1fb0ec8340a48f9 [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.hardware.powerimpl;
using zx;
type PowerDomainStatus = strict enum : uint8 {
DISABLED = 1;
ENABLED = 2;
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
closed protocol PowerImpl {
/// Get status of a power domain
strict GetPowerDomainStatus(struct {
index uint32;
}) -> (struct {
s zx.Status;
status PowerDomainStatus;
});
/// Enable a power domain
strict EnablePowerDomain(struct {
index uint32;
}) -> (struct {
s zx.Status;
});
/// Disable a power domain
strict DisablePowerDomain(struct {
index uint32;
}) -> (struct {
s zx.Status;
});
/// Get Supported Voltage Range. min and max are in uV.
strict GetSupportedVoltageRange(struct {
index uint32;
}) -> (struct {
s zx.Status;
min uint32;
max uint32;
});
/// Request for a particular voltage. "voltage" and actual_voltage are in microvolts(uV)
strict RequestVoltage(struct {
index uint32;
voltage uint32;
}) -> (struct {
s zx.Status;
actual_voltage uint32;
});
/// Get current voltage in uV.
strict GetCurrentVoltage(struct {
index uint32;
}) -> (struct {
s zx.Status;
current_voltage uint32;
});
/// Write to ctrl register of PMIC
strict WritePmicCtrlReg(struct {
index uint32;
reg_addr uint32;
value uint32;
}) -> (struct {
s zx.Status;
});
/// Read ctrl register of PMIC
strict ReadPmicCtrlReg(struct {
index uint32;
reg_addr uint32;
}) -> (struct {
s zx.Status;
value uint32;
});
};