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