]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
regulator: rk8xx: fix SWITCH enable on RK809
authorWilliam Wu <william.wu@rock-chips.com>
Thu, 14 Mar 2024 09:36:16 +0000 (10:36 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 10:19:44 +0000 (18:19 +0800)
On RK809 in PMIC_POWER_ENX registers, in order to set or clear a bit N,
the bit at offset N + 4 needs to be set otherwise nothing is done.

This fixes the inability to modify the SWITCH state on RK809.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: William Wu <william.wu@rock-chips.com>
[reworded commit log]
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
drivers/power/regulator/rk8xx.c

index 97d73ac95e08b708a546f4950af94d01e0a35e46..e905df3a800dcef15ad88f45949e4cd6ed52e0f5 100644 (file)
@@ -901,7 +901,7 @@ static int switch_set_enable(struct udevice *dev, bool enable)
        case RK809_ID:
                mask = (1 << (sw + 2)) | (1 << (sw + 6));
                ret = pmic_clrsetbits(dev->parent, RK817_POWER_EN(3), mask,
-                                     enable ? mask : 0);
+                                     enable ? mask : (1 << (sw + 6)));
                break;
        case RK818_ID:
                mask = 1 << 6;