| // 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 ddk.protocol.scpi; |
| |
| using zx; |
| |
| const uint32 MAX_DVFS_OPPS = 16; |
| |
| [Layout="Packed"] |
| struct ScpiOppEntry { |
| uint32 freq_hz; |
| uint32 volt_mv; |
| }; |
| |
| [Layout="Packed"] |
| struct ScpiOpp { |
| array<ScpiOppEntry>:MAX_DVFS_OPPS opp; |
| /// In usecs. |
| uint32 latency; |
| uint32 count; |
| }; |
| |
| [Layout="ddk-protocol"] |
| interface Scpi { |
| 1: GetSensor(string name) -> (zx.status s, uint32 sensor_id); |
| 2: GetSensorValue(uint32 sensor_id) -> (zx.status s, uint32 sensor_value); |
| 3: GetDvfsInfo(uint8 power_domain) -> (zx.status s, ScpiOpp opps); |
| 4: GetDvfsIdx(uint8 power_domain) -> (zx.status s, uint16 index); |
| 5: SetDvfsIdx(uint8 power_domain, uint16 index) -> (zx.status s); |
| }; |