blob: 529109af2ea60ba1a5cec65b516b1c045b6cb2f6 [file] [log] [blame]
// Copyright 2023 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.
@available(added=HEAD)
library fuchsia.hardware.usb.phy;
using zx;
@discoverable
open protocol UsbPhy {
/// Informs the PHY when peripheral role connect status changed.
flexible ConnectStatusChanged(struct {
connected bool;
}) -> () error zx.Status;
};
service Service {
device client_end:UsbPhy;
};
@discoverable
open protocol ConnectionWatcher {
/// Hanging-get that notifies callers when USB has been connected or
/// disconnected. Returns immediately on the first call, or if the
/// connection status has changed since the last call.
///
/// Returns:
/// - `ZX_ERR_BAD_STATE`: A hanging-get call was already pending.
flexible WatchConnectStatusChanged() -> (struct {
connected bool;
}) error zx.Status;
};
service ConnectionWatcherService {
watcher client_end:ConnectionWatcher;
};
type ProtocolVersion = flexible enum {
USB_2_0 = 2;
USB_3_0 = 3;
};
type Mode = flexible enum {
UNKNOWN = 0;
HOST = 1;
PERIPHERAL = 2;
OTG = 3;
};
type UsbPhyMode = table {
1: protocol ProtocolVersion;
2: dr_mode Mode;
3: is_otg_capable bool;
};
type AmlogicPhyType = flexible enum {
G12_A = 0;
G12_B = 1;
};
@serializable
type Metadata = table {
1: usb_phy_modes vector<UsbPhyMode>:MAX;
/// Optional.
2: phy_type AmlogicPhyType;
};