build/patch/kernel/archive/sunxi-6.1/patches.megous/arm64-dts-pinephone-pro-Add-pinephone-keyboard-support.patch

187 lines
4.2 KiB
Diff

From 43fbe6486b6c423a7bc6d9d9d72f6366ae1225dc Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 9 Sep 2022 16:43:39 +0200
Subject: [PATCH 293/389] arm64: dts: pinephone-pro: Add pinephone keyboard
support
Keyboard can be connected over I2C.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/rockchip/rk3399-pinephone-pro.dts | 145 ++++++++++++++++++
1 file changed, 145 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index a10a361aa3c5..05e2276ac1a2 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -89,6 +89,122 @@ bat: battery {
<3400000 0>;
};
+ ppkb_battery: keyboard-battery {
+ compatible = "simple-battery";
+ voltage-min-design-microvolt = <3000000>;
+ voltage-max-design-microvolt = <4200000>;
+ energy-full-design-microwatt-hours = <21000000>;
+ charge-full-design-microamp-hours = <6000000>;
+ precharge-current-microamp = <100000>;
+ charge-term-current-microamp = <50000>;
+ constant-charge-current-max-microamp = <2000000>;
+ constant-charge-voltage-max-microvolt = <4200000>;
+ factory-internal-resistance-micro-ohms = <120000>;
+ ocv-capacity-celsius = <20>;
+ ocv-capacity-table-0 =
+ <4147328 100>,
+ <4132636 99>,
+ <4121720 98>,
+ <4110905 97>,
+ <4102063 96>,
+ <4092428 95>,
+ <4082371 94>,
+ <4074137 93>,
+ <4064172 92>,
+ <4056387 91>,
+ <4047198 90>,
+ <4038599 89>,
+ <4030933 88>,
+ <4021831 87>,
+ <4012613 86>,
+ <4003863 85>,
+ <3995132 84>,
+ <3986108 83>,
+ <3977434 82>,
+ <3967977 81>,
+ <3960286 80>,
+ <3951737 79>,
+ <3943518 78>,
+ <3935723 77>,
+ <3928692 76>,
+ <3920093 75>,
+ <3912676 74>,
+ <3905481 73>,
+ <3899881 72>,
+ <3892341 71>,
+ <3887140 70>,
+ <3880005 69>,
+ <3876060 68>,
+ <3869195 67>,
+ <3863234 66>,
+ <3857808 65>,
+ <3851464 64>,
+ <3846976 63>,
+ <3840724 62>,
+ <3835254 61>,
+ <3830946 60>,
+ <3826564 59>,
+ <3821275 58>,
+ <3817413 57>,
+ <3811941 56>,
+ <3808947 55>,
+ <3804959 54>,
+ <3800958 53>,
+ <3797447 52>,
+ <3794303 51>,
+ <3790341 50>,
+ <3787022 49>,
+ <3783436 48>,
+ <3779936 47>,
+ <3776176 46>,
+ <3772160 45>,
+ <3769348 44>,
+ <3766705 43>,
+ <3762481 42>,
+ <3760894 41>,
+ <3758396 40>,
+ <3755803 39>,
+ <3753543 38>,
+ <3749691 37>,
+ <3747026 36>,
+ <3743937 35>,
+ <3741872 34>,
+ <3738529 33>,
+ <3737528 32>,
+ <3734059 31>,
+ <3731586 30>,
+ <3728576 29>,
+ <3725939 28>,
+ <3721208 27>,
+ <3718239 26>,
+ <3713032 25>,
+ <3709785 24>,
+ <3704045 23>,
+ <3701203 22>,
+ <3695965 21>,
+ <3691074 20>,
+ <3684562 19>,
+ <3679140 18>,
+ <3670993 17>,
+ <3664243 16>,
+ <3655383 15>,
+ <3647666 14>,
+ <3642747 13>,
+ <3637775 12>,
+ <3632593 11>,
+ <3627120 10>,
+ <3620923 9>,
+ <3611465 8>,
+ <3597536 7>,
+ <3577366 6>,
+ <3545253 5>,
+ <3497377 4>,
+ <3430377 3>,
+ <3337780 2>,
+ <3183953 1>,
+ <3064061 0>;
+ };
+
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm0 0 1000000 0>;
@@ -373,6 +489,15 @@ sgm3140_flash: led {
flash-max-timeout-us = <250000>;
};
};
+
+ keyboard-power {
+ compatible = "megi,pinephone-keyboard-power-manager";
+ phone-battery = "rk818-battery";
+ phone-usb = "rk818-usb";
+ kb-battery = "ip5xxx-battery";
+ kb-boost = "ip5xxx-boost";
+ kb-usb = "ip5xxx-usb";
+ };
};
&cpu_l0 {
@@ -945,6 +1070,26 @@ &i2c5 {
i2c-scl-falling-time-ns = <15>;
pinctrl-0 = <&i2c5_xfer &pogo_int_pin>;
status = "okay";
+
+ ppkb: keyboard@15 {
+ compatible = "pine64,pinephone-keyboard";
+ reg = <0x15>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <RK_PA0 IRQ_TYPE_EDGE_FALLING>;
+ vbat-supply = <&vcc5v0_sys>;
+ wakeup-source;
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ charger@75 {
+ compatible = "injoinic,ip5209";
+ reg = <0x75>;
+ monitored-battery = <&ppkb_battery>;
+ };
+ };
+ };
};
&i2s0 {
--
2.35.3