From c7eb1131bdbc4a9efb345c5aceca5deae9f28add Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 17 Aug 2020 08:59:57 +0200 Subject: dt-bindings: extcon: ptn5150: Convert binding to DT schema Convert the ptn-5150 extcon driver bindings to DT schema format using json-schema. The differences with original bindings document: - Use "gpios" suffix for the "int" and "vbus" gpio, - Skip generic "pinctrl" property as it is not really required. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Vijai Kumar K Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/extcon/extcon-ptn5150.txt | 27 ----------- .../devicetree/bindings/extcon/extcon-ptn5150.yaml | 53 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 27 deletions(-) delete mode 100644 Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt create mode 100644 Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml (limited to 'Documentation/devicetree/bindings/extcon') diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt deleted file mode 100644 index 936fbdf12815..000000000000 --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt +++ /dev/null @@ -1,27 +0,0 @@ -* PTN5150 CC (Configuration Channel) Logic device - -PTN5150 is a small thin low power CC logic chip supporting the USB Type-C -connector application with CC control logic detection and indication functions. -It is interfaced to the host controller using an I2C interface. - -Required properties: -- compatible: should be "nxp,ptn5150" -- reg: specifies the I2C slave address of the device -- int-gpio: should contain a phandle and GPIO specifier for the GPIO pin - connected to the PTN5150's INTB pin. -- vbus-gpio: should contain a phandle and GPIO specifier for the GPIO pin which - is used to control VBUS. -- pinctrl-names : a pinctrl state named "default" must be defined. -- pinctrl-0 : phandle referencing pin configuration of interrupt and vbus - control. - -Example: - ptn5150@1d { - compatible = "nxp,ptn5150"; - reg = <0x1d>; - int-gpio = <&msmgpio 78 GPIO_ACTIVE_HIGH>; - vbus-gpio = <&msmgpio 148 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&ptn5150_default>; - status = "okay"; - }; diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml new file mode 100644 index 000000000000..f6316f12028b --- /dev/null +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/extcon/extcon-ptn5150.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PTN5150 CC (Configuration Channel) Logic device + +maintainers: + - Krzysztof Kozlowski + +description: | + PTN5150 is a small thin low power CC logic chip supporting the USB Type-C + connector application with CC control logic detection and indication + functions. It is interfaced to the host controller using an I2C interface. + +properties: + compatible: + const: nxp,ptn5150 + + int-gpios: + description: + GPIO pin (input) connected to the PTN5150's INTB pin. + + reg: + maxItems: 1 + + vbus-gpios: + description: + GPIO pin (output) used to control VBUS. + +required: + - compatible + - int-gpios + - reg + - vbus-gpios + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ptn5150@1d { + compatible = "nxp,ptn5150"; + reg = <0x1d>; + int-gpios = <&msmgpio 78 GPIO_ACTIVE_HIGH>; + vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>; + }; + }; -- cgit v1.2.3 From 5076372d135ae34ef65388a39590576cd9a2436c Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 17 Aug 2020 08:59:58 +0200 Subject: dt-bindings: extcon: ptn5150: Use generic "interrupts" property Interrupts do not have to be always GPIO based so instead of expecting "int-gpios" property and converting the GPIO to an interrupt, just accept any interrupt via generic "interrupts" property. Mark the old "int-gpios" as deprecated. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Vijai Kumar K Signed-off-by: Chanwoo Choi --- Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Documentation/devicetree/bindings/extcon') diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml index f6316f12028b..1ddc97db3e61 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml @@ -19,8 +19,13 @@ properties: const: nxp,ptn5150 int-gpios: + deprecated: true description: GPIO pin (input) connected to the PTN5150's INTB pin. + Use "interrupts" instead. + + interrupts: + maxItems: 1 reg: maxItems: 1 @@ -31,7 +36,7 @@ properties: required: - compatible - - int-gpios + - interrupts - reg - vbus-gpios @@ -40,6 +45,7 @@ additionalProperties: false examples: - | #include + #include i2c { #address-cells = <1>; #size-cells = <0>; @@ -47,7 +53,8 @@ examples: ptn5150@1d { compatible = "nxp,ptn5150"; reg = <0x1d>; - int-gpios = <&msmgpio 78 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&msmgpio>; + interrupts = <78 IRQ_TYPE_LEVEL_HIGH>; vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>; }; }; -- cgit v1.2.3 From e6b02afce100e97292c0eb0cd1ccfa71d0453e48 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 17 Aug 2020 08:59:59 +0200 Subject: dt-bindings: extcon: ptn5150: Make 'vbus-gpios' optional The PTN5150 chip can be used in hardware designs with only reporting of USB Type-C connection, without the VBUS control. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Vijai Kumar K Signed-off-by: Chanwoo Choi --- Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/devicetree/bindings/extcon') diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml index 1ddc97db3e61..4b0f414486d2 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml @@ -32,13 +32,13 @@ properties: vbus-gpios: description: - GPIO pin (output) used to control VBUS. + GPIO pin (output) used to control VBUS. If skipped, no such control + takes place. required: - compatible - interrupts - reg - - vbus-gpios additionalProperties: false -- cgit v1.2.3