dts: bindings: usb: Add enum to maximum-speed property
Add enum to list what values of maximum-speed are exceptable since enum's get represented as strings in DT. This also allows us to generate a code enum to correspond to the string. We also introduce include/dt-bindings/usb/usb.h which is a hand coded definition of the enum. We don't have a great way to generate this right now, however it would be better if we did. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
983b493ac1
commit
2cac70e099
2 changed files with 27 additions and 0 deletions
|
@ -26,6 +26,11 @@ properties:
|
||||||
via DT, USB controllers should use their maximum
|
via DT, USB controllers should use their maximum
|
||||||
hardware capability.
|
hardware capability.
|
||||||
generation: define
|
generation: define
|
||||||
|
enum:
|
||||||
|
- "low-speed"
|
||||||
|
- "full-speed"
|
||||||
|
- "high-speed"
|
||||||
|
- "super-speed"
|
||||||
|
|
||||||
label:
|
label:
|
||||||
type: string
|
type: string
|
||||||
|
|
22
include/dt-bindings/usb/usb.h
Normal file
22
include/dt-bindings/usb/usb.h
Normal file
|
@ -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_ */
|
Loading…
Add table
Add a link
Reference in a new issue