From cfb8df522c05caf10f19fa05e0314a7ec395015e Mon Sep 17 00:00:00 2001 From: Maccraft123 Date: Wed, 15 Mar 2023 19:56:33 +0100 Subject: [PATCH] hack2 --- .../dts/rockchip/rk3326-anbernic-rg351m.dts | 25 +++- drivers/power/supply/rk817_charger.c | 134 ++++++++++++------ 2 files changed, 116 insertions(+), 43 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts index 61b31688b469..c69cb7073390 100644 --- a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts +++ b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts @@ -12,6 +12,25 @@ / { model = "Anbernic RG351M"; compatible = "anbernic,rg351m", "rockchip,rk3326"; + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <3500000>; + charge-term-current-microamp = <350000>; + constant-charge-current-max-microamp = <2000000>; + constant-charge-voltage-max-microvolt = <4200000>; + factory-internal-resistance-micro-ohms = <180000>; + voltage-max-design-microvolt = <4100000>; + voltage-min-design-microvolt = <3500000>; + + ocv-capacity-celsius = <20>; + ocv-capacity-table-0 = <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>, + <3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>, + <3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>, + <3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>, + <3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>, + <3574170 0>; + }; + vibrator { compatible = "pwm-vibrator"; pwms = <&pwm0 0 1000000 0>; @@ -30,4 +49,8 @@ &pwm0 { status = "okay"; }; -/delete-node/ &rk817_charger; +&rk817_charger { + /* This device does not have a current sense resistor */ + rockchip,resistor-sense-micro-ohms = <0>; + monitored-battery = <&battery>; +};