arm64: dts: rdu3: add UCS1002 charge controller node
authorLucas Stach <l.stach@pengutronix.de>
Fri, 12 Jul 2019 13:59:48 +0000 (15:59 +0200)
committerShawn Guo <shawnguo@kernel.org>
Sat, 3 Aug 2019 10:28:18 +0000 (12:28 +0200)
Add the charge controller node. With the controller driver loaded
the VBUS of the user USB socket is controlled exclusively via i2c
with the GPIO controls ignored, so vbus-supply for the user USB
port must be linked to the charge controller.

Hog the previously used GPIO control to unconditionally enable
VBUS until the driver is loaded.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi

index 7a1706f..af99473 100644 (file)
                regulator-always-on;
        };
 
-       reg_5p0_user_usb: regulator-5p0-user-usb {
-               compatible = "regulator-fixed";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_reg_user_usb>;
-               vin-supply = <&reg_5p0_main>;
-               regulator-name = "5V_USER_USB";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               gpio = <&gpio3 12 GPIO_ACTIVE_LOW>;
-               startup-delay-us = <1000>;
-       };
-
        reg_usdhc2_vmmc: regulator-vsd-3v3 {
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_reg_usdhc2>;
                line-name = "usb-mode1";
        };
 
+       usb-pwr {
+               gpio-hog;
+               gpios = <12 GPIO_ACTIVE_LOW>;
+               output-high;
+               line-name = "usb-pwr-ctrl-en-n";
+       };
+
        usb-mode2 {
                gpio-hog;
                gpios = <13 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c1>;
        status = "okay";
+
+       ucs1002: charger@32 {
+               compatible = "microchip,ucs1002";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ucs1002>;
+               reg = <0x32>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <17 IRQ_TYPE_EDGE_BOTH>,
+                            <18 IRQ_TYPE_EDGE_BOTH>;
+               interrupt-names = "a_det", "alert";
+       };
 };
 
 &i2c2 {
 };
 
 &usb3_phy0 {
-       vbus-supply = <&reg_5p0_user_usb>;
+       vbus-supply = <&ucs1002>;
        status = "okay";
 };
 
                fsl,pins = <
                        MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10             0x6
                        MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11             0x6
+                       MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12             0x6
                        MX8MQ_IOMUXC_NAND_DATA07_GPIO3_IO13             0x6
                >;
        };
                >;
        };
 
-       pinctrl_reg_user_usb: reguserusbgrp {
-               fsl,pins = <
-                       MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12             0x6
-               >;
-       };
-
        pinctrl_switch_irq: switchgrp {
                fsl,pins = <
                        MX8MQ_IOMUXC_GPIO1_IO15_GPIO1_IO15              0x41
                >;
        };
 
+       pinctrl_ucs1002: ucs1002grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_NAND_WE_B_GPIO3_IO17               0x41
+                       MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18               0x41
+               >;
+       };
+
        pinctrl_usbhub: usbhubgrp {
                fsl,pins = <
                        MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25               0x41