From bab613c7d7dddc117a8cc6f60ef494e1bf826589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Fri, 21 Jan 2022 23:28:48 +0100 Subject: [PATCH 108/464] arm64: dts: sun50i-a64-pinephone: Add support for Pinephone keyboard Pinephone keyboard can be used with Pinephone. Describe it in the device tree. Signed-off-by: Ondrej Jirman --- .../dts/allwinner/sun50i-a64-pinephone.dtsi | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index dd7b27a6597c..c1896206ace7 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -178,6 +178,122 @@ bat: battery { <0xdf 98>; }; + 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>; + }; + bt_sco_codec: bt-sco-codec { #sound-dai-cells = <1>; compatible = "linux,bt-sco"; @@ -540,6 +656,26 @@ accelerometer@68 { /* Connected to pogo pins (external spring based pinheader for user addons) */ &i2c2 { status = "okay"; + + ppkb: keyboard@15 { + compatible = "pine64,pinephone-keyboard"; + reg = <0x15>; + interrupt-parent = <&r_pio>; + interrupts = <0 12 IRQ_TYPE_EDGE_FALLING>; /* PL12 */ + vbat-supply = <®_usb_5v>; + wakeup-source; + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@75 { + compatible = "injoinic,ip5209"; + reg = <0x75>; + monitored-battery = <&ppkb_battery>; + }; + }; + }; }; &i2s2 { -- 2.34.1