blob: 1b0161a627a08f025b5c8b48abfd5d90a92dc834 [file] [log] [blame]
// Copyright 2018 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.scpi;
using zx;
const MAX_DVFS_OPPS uint32 = 16;
type ScpiOppEntry = struct {
/// The operating point frequency in Hz.
freq_hz uint32;
/// The operating point voltage in microvolts.
volt_uv uint32;
};
type ScpiOpp = struct {
/// The device's operating points.
opp array<ScpiOppEntry, MAX_DVFS_OPPS>;
/// In microseconds.
latency uint32;
/// The number of operating points in opp.
count uint32;
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
closed protocol Scpi {
strict GetSensor(struct {
name string:MAX;
}) -> (struct {
s zx.Status;
sensor_id uint32;
});
strict GetSensorValue(struct {
sensor_id uint32;
}) -> (struct {
s zx.Status;
sensor_value uint32;
});
strict GetDvfsInfo(struct {
power_domain uint8;
}) -> (struct {
s zx.Status;
opps ScpiOpp;
});
strict GetDvfsIdx(struct {
power_domain uint8;
}) -> (struct {
s zx.Status;
index uint16;
});
strict SetDvfsIdx(struct {
power_domain uint8;
index uint16;
}) -> (struct {
s zx.Status;
});
};