1// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5library ddk.protocol.scpi;
6
7using zx;
8
9const uint32 MAX_DVFS_OPPS = 16;
10
11[Layout = "Packed"]
12struct ScpiOppEntry {
13    uint32 freq_hz;
14    uint32 volt_mv;
15};
16
17[Layout = "Packed"]
18struct ScpiOpp {
19    array<ScpiOppEntry>:MAX_DVFS_OPPS opp;
20    /// In usecs.
21    uint32 latency;
22    uint32 count;
23};
24
25[Layout = "ddk-protocol"]
26interface Scpi {
27    GetSensor(string name) -> (zx.status s, uint32 sensor_id);
28    GetSensorValue(uint32 sensor_id) -> (zx.status s, uint32 sensor_value);
29    GetDvfsInfo(uint8 power_domain) -> (zx.status s, ScpiOpp opps);
30    GetDvfsIdx(uint8 power_domain) -> (zx.status s, uint16 index);
31    SetDvfsIdx(uint8 power_domain, uint16 index) -> (zx.status s);
32};
33