From 7e8fd3f3ec18658b721676d49c920b5801d807cc Mon Sep 17 00:00:00 2001 From: Josep Orga Date: Tue, 7 Nov 2023 19:52:20 +0100 Subject: [PATCH] arm64: dts: defconfig: imx8mp-somdevices: Add USB ID and USB power support. Signed-off-by: Josep Orga --- .../boot/dts/freescale/imx8mp-somdevices.dtsi | 50 +++++++++++++++++-- .../arm64/configs/imx8mp_somdevices_defconfig | 2 +- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-somdevices.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-somdevices.dtsi index 18516035fc84..1ecc40276e1c 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-somdevices.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-somdevices.dtsi @@ -42,6 +42,28 @@ status = "disabled"; }; + reg_usb0: regulator-usb0 { + compatible = "regulator-fixed"; + regulator-name = "vbus0_regulator"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_vbus>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_usb1: regulator-usb1 { + compatible = "regulator-fixed"; + regulator-name = "vbus1_regulator"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb1_vbus>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; pinctrl-names = "default"; @@ -602,6 +624,7 @@ }; &usb3_phy0 { + vbus-supply = <®_usb0>; status = "okay"; }; @@ -616,11 +639,18 @@ adp-disable; usb-role-switch; status = "okay"; + + connector { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_id>; + compatible = "gpio-usb-b-connector", "usb-b-connector"; + type = "micro"; + id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; }; &usb3_phy1 { - fsl,phy-tx-preemp-amp-tune = <3>; - fsl,phy-tx-vref-tune = <0xb>; + vbus-supply = <®_usb1>; status = "okay"; }; @@ -629,8 +659,6 @@ }; &usb_dwc3_1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usb1_vbus>; dr_mode = "host"; status = "okay"; }; @@ -916,9 +944,21 @@ >; }; + pinctrl_usb0_id: usb0-id { + fsl,pins = < + MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x19 + >; + }; + + pinctrl_usb0_vbus: usb0grp { + fsl,pins = < + MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12 0x19 + >; + }; + pinctrl_usb1_vbus: usb1grp { fsl,pins = < - MX8MP_IOMUXC_GPIO1_IO14__USB2_PWR 0x19 + MX8MP_IOMUXC_GPIO1_IO14__GPIO1_IO14 0x19 >; }; diff --git a/arch/arm64/configs/imx8mp_somdevices_defconfig b/arch/arm64/configs/imx8mp_somdevices_defconfig index 1a134ee733f1..cbb540a832b1 100644 --- a/arch/arm64/configs/imx8mp_somdevices_defconfig +++ b/arch/arm64/configs/imx8mp_somdevices_defconfig @@ -627,7 +627,7 @@ CONFIG_SND_SOC_WSA881X=m CONFIG_SND_SIMPLE_CARD=y CONFIG_SND_AUDIO_GRAPH_CARD=y CONFIG_I2C_HID=m -CONFIG_USB_CONN_GPIO=y +CONFIG_USB_CONN_GPIO=m CONFIG_USB=y CONFIG_USB_OTG=y CONFIG_USB_XHCI_HCD=y -- 2.17.1