arm64: dts: rockchip: use new type-c framework on rk3399pro evb boards

Amends to support the new type-c framework.

Change-Id: I060da4667e6a5da9477841f80995c459021ef345
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
This commit is contained in:
Caesar Wang 2022-11-14 15:22:05 +08:00 committed by Tao Huang
parent a9a4f474d7
commit fb22b123d6
5 changed files with 376 additions and 80 deletions

View File

@ -8,6 +8,7 @@
#include <dt-bindings/display/drm_mipi_dsi.h>
#include <dt-bindings/sensor-dev.h>
#include <dt-bindings/pwm/pwm.h>
#include "dt-bindings/usb/pd.h"
#include "rk3399pro.dtsi"
#include "rk3399-linux.dtsi"
#include "rk3399-opp.dtsi"
@ -208,6 +209,16 @@ vcc_phy: vcc-phy-regulator {
regulator-boot-on;
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vcc5v0_sys: vccsys {
compatible = "regulator-fixed";
regulator-name = "vcc5v0_sys";
@ -243,7 +254,6 @@ wireless-bluetooth {
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
@ -746,7 +756,6 @@ regulator-state-mem {
bq25700: bq25700@6b {
compatible = "ti,bq25703";
reg = <0x6b>;
extcon = <&fusb0>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
@ -1072,8 +1081,16 @@ spi_dev@0 {
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
orientation-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
tcphy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
};
};
&tcphy1 {
@ -1144,7 +1161,15 @@ &usbdrd3_1 {
&usbdrd_dwc3_0 {
status = "okay";
extcon = <&fusb0>;
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbdrd_dwc3_1 {
@ -1178,13 +1203,6 @@ charger_ok_int: charger-ok-int {
};
};
fusb30x {
fusb0_int: fusb0-int {
rockchip,pins =
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
headphone {
hp_det: hp-det {
rockchip,pins =
@ -1275,6 +1293,16 @@ tp_irq_gpio: tp-irq-gpio {
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
vcc5v0_typec0_en: vcc5v0-typec0-en {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-bluetooth {
bt_irq_gpio: bt-irq-gpio {
rockchip,pins =

View File

@ -8,6 +8,7 @@
#include <dt-bindings/display/drm_mipi_dsi.h>
#include <dt-bindings/sensor-dev.h>
#include <dt-bindings/pwm/pwm.h>
#include "dt-bindings/usb/pd.h"
#include "rk3399pro.dtsi"
#include "rk3399-linux.dtsi"
#include "rk3399-opp.dtsi"
@ -196,6 +197,16 @@ sdio_pwrseq: sdio-pwrseq {
reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vcc_phy: vcc-phy-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_phy";
@ -238,7 +249,6 @@ wireless-bluetooth {
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
@ -647,7 +657,6 @@ regulator-state-mem {
bq25700: bq25700@6b {
compatible = "ti,bq25703";
reg = <0x6b>;
extcon = <&fusb0>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
@ -774,13 +783,52 @@ &i2c8 {
i2c-scl-falling-time-ns = <11>;
clock-frequency = <100000>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus_typec>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_role_sw: endpoint@0 {
remote-endpoint = <&dwc3_0_role_switch>;
};
};
};
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 1500, PDO_FIXED_USB_COMM)>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_orien_sw: endpoint {
remote-endpoint = <&tcphy0_orientation_switch>;
};
};
};
};
};
};
@ -982,8 +1030,16 @@ spi_dev@0 {
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
orientation-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
tcphy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
};
};
&tcphy1 {
@ -998,7 +1054,6 @@ &tsadc {
&u2phy0 {
status = "okay";
extcon = <&fusb0>;
u2phy0_otg: otg-port {
status = "okay";
@ -1054,7 +1109,15 @@ &usbdrd3_1 {
&usbdrd_dwc3_0 {
status = "okay";
extcon = <&fusb0>;
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbdrd_dwc3_1 {
@ -1088,13 +1151,6 @@ charger_ok_int: charger-ok-int {
};
};
fusb30x {
fusb0_int: fusb0-int {
rockchip,pins =
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
headphone {
hp_det: hp-det {
rockchip,pins =
@ -1146,6 +1202,16 @@ soc_slppin_rst: soc-slppin-rst {
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
vcc5v0_typec0_en: vcc5v0-typec0-en {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
sdio-pwrseq {
wifi_enable_h: wifi-enable-h {
rockchip,pins =

View File

@ -197,6 +197,16 @@ sdio_pwrseq: sdio-pwrseq {
reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vcc_phy: vcc-phy-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_phy";
@ -239,7 +249,6 @@ wireless-bluetooth {
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
@ -676,7 +685,6 @@ regulator-state-mem {
bq25700: bq25700@6b {
compatible = "ti,bq25703";
reg = <0x6b>;
extcon = <&fusb0>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
@ -750,15 +758,53 @@ &i2c8 {
i2c-scl-falling-time-ns = <11>;
clock-frequency = <100000>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus_typec>;
status = "okay";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_role_sw: endpoint@0 {
remote-endpoint = <&dwc3_0_role_switch>;
};
};
};
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 1500, PDO_FIXED_USB_COMM)>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_orien_sw: endpoint {
remote-endpoint = <&tcphy0_orientation_switch>;
};
};
};
};
};
};
&i2s1 {
@ -856,8 +902,16 @@ spi_dev@0 {
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
orientation-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
tcphy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
};
};
&tcphy1 {
@ -872,7 +926,6 @@ &tsadc {
&u2phy0 {
status = "okay";
extcon = <&fusb0>;
u2phy0_otg: otg-port {
status = "okay";
@ -928,7 +981,15 @@ &usbdrd3_1 {
&usbdrd_dwc3_0 {
status = "okay";
extcon = <&fusb0>;
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbdrd_dwc3_1 {
@ -956,13 +1017,6 @@ charger_ok_int: charger-ok-int {
};
};
fusb30x {
fusb0_int: fusb0-int {
rockchip,pins =
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
headphone {
hp_det: hp-det {
rockchip,pins =
@ -1048,6 +1102,16 @@ tp_irq_gpio: tp-irq-gpio {
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
vcc5v0_typec0_en: vcc5v0-typec0-en {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-bluetooth {
uart0_gpios: uart0-gpios {
rockchip,pins =

View File

@ -8,6 +8,7 @@
#include <dt-bindings/display/drm_mipi_dsi.h>
#include <dt-bindings/sensor-dev.h>
#include <dt-bindings/pwm/pwm.h>
#include "dt-bindings/usb/pd.h"
#include "rk3399pro.dtsi"
#include "rk3399-linux.dtsi"
#include "rk3399-opp.dtsi"
@ -201,6 +202,26 @@ usbacm_video_control: usbacm-video-control {
status = "disabled";
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vcc_phy: vcc-phy-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_phy";
@ -243,7 +264,6 @@ wireless-bluetooth {
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
@ -657,7 +677,6 @@ regulator-state-mem {
bq25700: bq25700@6b {
compatible = "ti,bq25703";
reg = <0x6b>;
extcon = <&fusb0>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
@ -786,16 +805,53 @@ &i2c8 {
i2c-scl-falling-time-ns = <11>;
clock-frequency = <100000>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
vbus-5v-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus_typec>;
status = "okay";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_role_sw: endpoint@0 {
remote-endpoint = <&dwc3_0_role_switch>;
};
};
};
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 1500, PDO_FIXED_USB_COMM)>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_orien_sw: endpoint {
remote-endpoint = <&tcphy0_orientation_switch>;
};
};
};
};
};
};
&i2s1 {
@ -995,8 +1051,16 @@ spi_dev@0 {
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
orientation-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
tcphy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
};
};
&tcphy1 {
@ -1011,7 +1075,6 @@ &tsadc {
&u2phy0 {
status = "okay";
extcon = <&fusb0>;
u2phy0_otg: otg-port {
status = "okay";
@ -1067,7 +1130,15 @@ &usbdrd3_1 {
&usbdrd_dwc3_0 {
status = "okay";
extcon = <&fusb0>;
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbdrd_dwc3_1 {
@ -1108,13 +1179,6 @@ cam_pwren_high: cam-pwren-high {
};
};
fusb30x {
fusb0_int: fusb0-int {
rockchip,pins =
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
headphone {
hp_det: hp-det {
rockchip,pins =
@ -1205,6 +1269,16 @@ tp_irq_gpio: tp-irq-gpio {
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
vcc5v0_typec0_en: vcc5v0-typec0-en {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-bluetooth {
bt_irq_gpio: bt-irq-gpio {
rockchip,pins =

View File

@ -8,6 +8,7 @@
#include <dt-bindings/display/drm_mipi_dsi.h>
#include <dt-bindings/sensor-dev.h>
#include <dt-bindings/pwm/pwm.h>
#include "dt-bindings/usb/pd.h"
#include "rk3399pro.dtsi"
#include "rk3399-android.dtsi"
#include "rk3399-opp.dtsi"
@ -198,6 +199,16 @@ sdio_pwrseq: sdio-pwrseq {
reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
};
vbus_typec: vbus-typec-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_typec0_en>;
regulator-name = "vbus_typec";
vin-supply = <&vcc5v0_sys>;
};
vcc_phy: vcc-phy-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_phy";
@ -240,7 +251,6 @@ wireless-bluetooth {
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
@ -661,7 +671,6 @@ regulator-state-mem {
bq25700: bq25700@6b {
compatible = "ti,bq25703";
reg = <0x6b>;
extcon = <&fusb0>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
@ -735,16 +744,53 @@ &i2c8 {
i2c-scl-falling-time-ns = <11>;
clock-frequency = <100000>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
vbus-5v-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus_typec>;
status = "okay";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_role_sw: endpoint@0 {
remote-endpoint = <&dwc3_0_role_switch>;
};
};
};
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 1500, PDO_FIXED_USB_COMM)>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_orien_sw: endpoint {
remote-endpoint = <&tcphy0_orientation_switch>;
};
};
};
};
};
};
&i2s1 {
@ -838,8 +884,16 @@ spi_dev@0 {
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
orientation-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
tcphy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
};
};
&tcphy1 {
@ -854,7 +908,6 @@ &tsadc {
&u2phy0 {
status = "okay";
extcon = <&fusb0>;
u2phy0_otg: otg-port {
status = "okay";
@ -911,7 +964,15 @@ &usbdrd3_1 {
&usbdrd_dwc3_0 {
status = "okay";
extcon = <&fusb0>;
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbdrd_dwc3_1 {
@ -939,13 +1000,6 @@ charger_ok_int: charger-ok-int {
};
};
fusb30x {
fusb0_int: fusb0-int {
rockchip,pins =
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
headphone {
hp_det: hp-det {
rockchip,pins =
@ -1031,6 +1085,16 @@ tp_irq_gpio: tp-irq-gpio {
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
};
vcc5v0_typec0_en: vcc5v0-typec0-en {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-bluetooth {
uart0_gpios: uart0-gpios {
rockchip,pins =