Skip to content

DTB Elements

southoz edited this page Apr 11, 2026 · 2 revisions

Fixing the otg_switch-supply

What is otg_switch-supply?

otg_switch-supply is a Device Tree property that belongs inside the charger sub-node of the RK817 PMIC.

It tells the Linux kernel driver (rk817-charger) which regulator is responsible for controlling the USB OTG boost converter.

On these RK3326 handhelds, the RK817 PMIC has a built-in boost regulator (usually called boost) that can generate 5 V from the main 3.3 V / 3.8 V rail. This 5 V is needed when the device acts as a USB host (OTG mode) to power external devices (controllers, keyboards, etc.).

Why is this property required?

The rk817-charger driver always tries to enable/disable the OTG boost regulator at boot and during USB events.

  • If the driver cannot find the regulator via otg_switch-supply, it falls back to a dummy path.
  • It still calls regulator_disable() internally.
  • The kernel’s regulator core sees a disable without a matching enable → “unbalanced disables for otg_switch” warning.

This is exactly the warning you see in your dmesg:

rk817-charger rk817-charger: Looking up otg_switch-supply property ... failed
unbalanced disables for otg_switch
WARNING: at ... (regulator core)

Exact fix (using phandles from your darkosre DTB)

**Phandle are dependent on the BOOST node.

  • BOOST regulator → phandle <0x67>

Add this single line inside the charger node:

charger {
    compatible = "rk817,charger";
    ...
    dc_det_gpio = <0x68 0x05 0x00>;
    extcon = <0x69>;

    /* === ADD THIS LINE === */
    otg_switch-supply = <0x67>;     // points to the BOOST regulator in your DTB
};

Full corrected charger block (copy-paste ready):

charger {
    compatible = "rk817,charger";
    min_input_voltage = <0x1194>;
    max_input_current = <0x1f4>;
    max_chrg_current = <0x1f4>;
    max_chrg_voltage = <0x1068>;
    chrg_term_mode = <0x00>;
    chrg_finish_cur = <0x12c>;
    virtual_power = <0x00>;
    sample_res = <0x0a>;
    dc_det_gpio = <0x68 0x05 0x00>;
    extcon = <0x69>;
    otg_switch-supply = <0x67>;        // ← required for OTG/boost control
};

After adding the line, recompile the DTB and replace it:

dtc -I dts -O dtb -o fixed.dtb current.dts
cp fixed.dtb /boot/dtbs/rockchip/rk3326-r36s-linux.dtb
reboot

Home

Guides

Help

Arcade Systems

Console Systems

Handheld Systems

Ports and Recompilations

Advanced

In development

The guides below are for ArkOS-G80CA; once they are above this marker, they are relevant.

Clone this wiki locally