| // 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.clockimpl; |
| |
| using zx; |
| |
| /// Each method in this protocol has a corresponding method in clock.banjo |
| /// with an additional ID parameter. |
| /// The ID parameter in each method below designates the clock in the system |
| /// that the call is intended to target. |
| /// Conversely, each instance of ZX_PROTOCOL_CLOCK pertains to only one clock |
| /// in the system. |
| /// See clock.banjo for documentation for each method. |
| [Transport = "Banjo", BanjoLayout = "ddk-protocol"] |
| protocol ClockImpl { |
| /// Clock Gating Control. |
| Enable(uint32 id) -> (zx.status s); |
| Disable(uint32 id) -> (zx.status s); |
| IsEnabled(uint32 id) -> (zx.status s, bool enabled); |
| |
| /// Clock Frequency Scaling Control. |
| SetRate(uint32 id, uint64 hz) -> (zx.status s); |
| QuerySupportedRate(uint32 id, uint64 hz) -> (zx.status s, uint64 hz); |
| GetRate(uint32 id) -> (zx.status s, uint64 hz); |
| |
| /// Clock input control. |
| SetInput(uint32 id, uint32 idx) -> (zx.status s); |
| GetNumInputs(uint32 id) -> (zx.status s, uint32 n); |
| GetInput(uint32 id) -> (zx.status s, uint32 index); |
| }; |