diff --git a/dts/bindings/usb/usb.yaml b/dts/bindings/usb/usb.yaml index 77fb17be488..292eab20406 100644 --- a/dts/bindings/usb/usb.yaml +++ b/dts/bindings/usb/usb.yaml @@ -26,6 +26,11 @@ properties: via DT, USB controllers should use their maximum hardware capability. generation: define + enum: + - "low-speed" + - "full-speed" + - "high-speed" + - "super-speed" label: type: string diff --git a/include/dt-bindings/usb/usb.h b/include/dt-bindings/usb/usb.h new file mode 100644 index 00000000000..e64f28f8760 --- /dev/null +++ b/include/dt-bindings/usb/usb.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_USB_USB_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_USB_USB_H_ + +/* Ideally we'd generate this enum to match what's coming out of the YAML, + * however, we dont have a good way to know how to name such an enum from + * the generation point of view, so for now we just hand code the enum. This + * enum is expected to match the order in the yaml (dts/bindings/usb/usb.yaml) + */ + +enum dt_usb_maximum_speed { + DT_USB_MAXIMUM_SPEED_LOW_SPEED, + DT_USB_MAXIMUM_SPEED_FULL_SPEED, + DT_USB_MAXIMUM_SPEED_HIGH_SPEED, + DT_USB_MAXIMUM_SPEED_SUPER_SPEED, +}; + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_USB_USB_H_ */