]> www.infradead.org Git - users/hch/misc.git/commitdiff
arm64: dts: rockchip: Add USB and charger to Gameforce Ace
authorChris Morgan <macromorgan@hotmail.com>
Thu, 4 Sep 2025 16:05:30 +0000 (11:05 -0500)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 12 Sep 2025 07:34:09 +0000 (09:34 +0200)
Add support for the BQ25703A charger manager and boost regulator to
the Gameforce Ace. Add the USB-C port and PHY as well as they all
depend on each other for operation.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20250904160530.66178-6-macroalpha82@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts

index 55fc7cbef58d906a0572d19e6f07686ba5d02f38..f5894672fcbd37b8ba71357b64b5c07e4d04f74f 100644 (file)
        pinctrl-0 = <&i2c6m3_xfer>;
        status = "okay";
 
+       fusb302: typec@22 {
+               compatible = "fcs,fusb302";
+               reg = <0x22>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PC7 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-0 = <&usbc0_int>;
+               pinctrl-names = "default";
+               vbus-supply = <&usb_otg_vbus>;
+
+               connector {
+                       compatible = "usb-c-connector";
+                       data-role = "dual";
+                       label = "USB-C";
+                       op-sink-microwatt = <1000000>;
+                       power-role = "dual";
+                       self-powered;
+                       sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+                                    PDO_FIXED(9000, 3000, PDO_FIXED_USB_COMM)
+                                    PDO_FIXED(12000, 3000, PDO_FIXED_USB_COMM)>;
+                       source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+                       try-power-role = "sink";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       usbc0_orien_sw: endpoint {
+                                               remote-endpoint = <&usbdp_phy0_orientation_switch>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       usbc0_role_sw: endpoint {
+                                               remote-endpoint = <&dwc3_0_role_switch>;
+                                       };
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+                                       dp_altmode_mux: endpoint {
+                                               remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
+                                       };
+                               };
+                       };
+               };
+       };
+
        rtc_hym8563: rtc@51 {
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                         0x2F 0x00 0x64 0xA5 0xB5 0x1C 0xF0 0x49>;
                cellwise,monitor-interval-ms = <5000>;
                monitored-battery = <&battery>;
+               power-supplies = <&bq25703>;
                status = "okay";
        };
+
+       bq25703: charger@6b {
+               compatible = "ti,bq25703a";
+               reg = <0x6b>;
+               input-current-limit-microamp = <5000000>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PD5 IRQ_TYPE_LEVEL_LOW>;
+               monitored-battery = <&battery>;
+               pinctrl-0 = <&charger_int_h>;
+               pinctrl-names = "default";
+               power-supplies = <&fusb302>;
+
+               regulators {
+                       usb_otg_vbus: vbus {
+                               enable-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
+                               pinctrl-0 = <&boost_enable_h>;
+                               pinctrl-names = "default";
+                               regulator-max-microamp = <960000>;
+                               regulator-max-microvolt = <5088000>;
+                               regulator-min-microamp = <512000>;
+                               regulator-min-microvolt = <4992000>;
+                               regulator-name = "usb_otg_vbus";
+                       };
+               };
+       };
 };
 
 &i2c7 {
                        rockchip,pins =
                                <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
                };
+
+               usbc_sbu_dc: usbc-sbu-dc {
+                       rockchip,pins =
+                               <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>,
+                               <4 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
        };
 
        vcc3v3-lcd {
        };
 };
 
+&usb_host0_xhci {
+       usb-role-switch;
+       status = "okay";
+
+       port {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               dwc3_0_role_switch: endpoint@0 {
+                       reg = <0>;
+                       remote-endpoint = <&usbc0_role_sw>;
+               };
+       };
+};
+
+&usbdp_phy0 {
+       mode-switch;
+       orientation-switch;
+       pinctrl-0 = <&usbc_sbu_dc>;
+       pinctrl-names = "default";
+       sbu1-dc-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>;
+       sbu2-dc-gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>;
+       rockchip,dp-lane-mux = <2 3>;
+       status = "okay";
+
+       port {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               usbdp_phy0_orientation_switch: endpoint@0 {
+                       reg = <0>;
+                       remote-endpoint = <&usbc0_orien_sw>;
+               };
+
+               usbdp_phy0_dp_altmode_mux: endpoint@1 {
+                       reg = <1>;
+                       remote-endpoint = <&dp_altmode_mux>;
+               };
+       };
+};
+
 &vop {
        status = "okay";
 };