This adds a simple device tree binding for a GPIO-based VBUS detection PHY. Cc: Felipe Balbi <balbi@xxxxxxxxxx> Cc: devicetree@xxxxxxxxxxxxxxx Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> --- .../bindings/phy/phy-usb-vbus-gpio.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-usb-vbus-gpio.yaml diff --git a/Documentation/devicetree/bindings/phy/phy-usb-vbus-gpio.yaml b/Documentation/devicetree/bindings/phy/phy-usb-vbus-gpio.yaml new file mode 100644 index 000000000000..4e10b58f8235 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-usb-vbus-gpio.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/phy-usb-vbus-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO-based VBUS detection USB PHY + +maintainers: + - Linus Walleij <linus.walleij@xxxxxxxxxx> + +description: A VBUS event occurs when a USB plug is attached to + a USB host and peripheral, the voltage (VBUS) is exposed from the + host to the peripheral when the last of the two ends of the + cable is plugged in. This can be either on the host side or on + the peripheral side, whichever comes last. It is possible to + provide a very simple USB VBUS detection mechanism by using a + GPIO line that will trigger on an edge event on the VBUS + pin. + +properties: + compatible: + const: phy-usb-vbus-gpio + + "#phy-cells": + const: 0 + + vbus-gpios: + maxItems: 1 + description: The GPIO line connected to VBUS + +required: + - compatible + - "#phy-cells" + - vbus-gpios + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + usb1_phy: phy { + compatible = "phy-usb-vbus-gpio"; + #phy-cells = <0>; + vbus-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + }; -- 2.37.3