blob: c7ae37a476d52be1740b150e0be01a943ffe3fe3 [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.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")
@banjo_layout("ddk-protocol")
closed protocol ClockImpl {
/// Clock Gating Control.
strict Enable(struct {
id uint32;
}) -> (struct {
s zx.Status;
});
strict Disable(struct {
id uint32;
}) -> (struct {
s zx.Status;
});
strict IsEnabled(struct {
id uint32;
}) -> (struct {
s zx.Status;
enabled bool;
});
/// Clock Frequency Scaling Control.
strict SetRate(struct {
id uint32;
hz uint64;
}) -> (struct {
s zx.Status;
});
strict QuerySupportedRate(struct {
id uint32;
hz uint64;
}) -> (struct {
s zx.Status;
hz uint64;
});
strict GetRate(struct {
id uint32;
}) -> (struct {
s zx.Status;
hz uint64;
});
/// Clock input control.
strict SetInput(struct {
id uint32;
idx uint32;
}) -> (struct {
s zx.Status;
});
strict GetNumInputs(struct {
id uint32;
}) -> (struct {
s zx.Status;
n uint32;
});
strict GetInput(struct {
id uint32;
}) -> (struct {
s zx.Status;
index uint32;
});
};