* [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components.
@ 2025-12-08 14:59 Erikas Bitovtas
2025-12-08 14:59 ` [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery Erikas Bitovtas
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Erikas Bitovtas @ 2025-12-08 14:59 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas,
Konrad Dybcio
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
Changes in v3:
- Added multiple temperature points for ocv-capacity-celsius
- Added capacity tables for every temperature point
- Link to v2: https://lore.kernel.org/r/20251121-battery-hall-v2-0-d29e0828f214@gmail.com
Changes in v2:
- Reworded the battery commit to include a link to the downstream code
on which it was based.
- Separated hall sensor pin configuration from gpio-keys.
- Link to v1: https://lore.kernel.org/r/20251115-battery-hall-v1-0-1586283d17c7@gmail.com
---
Erikas Bitovtas (2):
arm64: dts: qcom: msm8939-asus-z00t: add battery
arm64: dts: qcom: msm8939-asus-z00t: add hall sensor
arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 79 +++++++++++++++++++++++++-
1 file changed, 78 insertions(+), 1 deletion(-)
---
base-commit: 82bcd04d124a4d84580ea4a8ba6b120db5f512e7
change-id: 20251208-b4-battery-hall-c707ae0d8ad4
Best regards,
--
Erikas Bitovtas <xerikasxx@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery 2025-12-08 14:59 [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Erikas Bitovtas @ 2025-12-08 14:59 ` Erikas Bitovtas 2025-12-18 12:29 ` Konrad Dybcio 2025-12-08 14:59 ` [PATCH v3 2/2] arm64: dts: qcom: msm8939-asus-z00t: add hall sensor Erikas Bitovtas 2026-01-05 14:07 ` [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Bjorn Andersson 2 siblings, 1 reply; 5+ messages in thread From: Erikas Bitovtas @ 2025-12-08 14:59 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, ~postmarketos/upstreaming, phone-devel, Erikas Bitovtas This device tracks remaining battery capacity percentage using voltage mode BMS. This commit enables the pm8916_bms node and adds a battery node to track its capacity. Battery properties were taken from the information printed on the battery itself and downstream device tree for a battery named "nvt+atl_3000mah" [1] [1] https://github.com/Asus-MSM8916/android_kernel_asus_msm8916/blob/10.x/arch/arm/boot/dts/qcom/ASUS_ZE550KL_1936167_3000mAh_3p4COV_VBMS_Final.dtsi Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com> --- arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts index ebb548e62e02..d0f0f80dd326 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts @@ -20,6 +20,61 @@ aliases { serial0 = &blsp_uart2; }; + battery: battery { + compatible = "simple-battery"; + device-chemistry = "lithium-ion-polymer"; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4400000>; + energy-full-design-microwatt-hours = <11500000>; + charge-full-design-microamp-hours = <3000000>; + + ocv-capacity-celsius = <(-20) 0 25 40 60>; + ocv-capacity-table-0 = <4378000 100>, <4220000 95>, <4125000 90>, + <4071000 85>, <3977000 80>, <3916000 75>, <3866000 70>, + <3838000 65>, <3822000 60>, <3809000 55>, <3797000 50>, + <3784000 45>, <3771000 40>, <3757000 35>, <3743000 30>, + <3726000 25>, <3707000 20>, <3688000 16>, <3670000 13>, + <3655000 11>, <3648000 10>, <3636000 9>, <3624000 8>, + <3612000 7>, <3592000 6>, <3569000 5>, <3540000 4>, + <3494000 3>, <3418000 2>, <3289000 1>, <3000000 0>; + + ocv-capacity-table-1 = <4378000 100>, <4292000 95>, <4226000 90>, + <4166000 85>, <4109000 80>, <4064000 75>, <3992000 70>, + <3942000 65>, <3898000 60>, <3859000 55>, <3826000 50>, + <3802000 45>, <3788000 40>, <3779000 35>, <3768000 30>, + <3752000 25>, <3732000 20>, <3712000 16>, <3696000 13>, + <3688000 11>, <3684000 10>, <3680000 9>, <3675000 8>, + <3669000 7>, <3658000 6>, <3636000 5>, <3599000 4>, + <3544000 3>, <3466000 2>, <3341000 1>, <3000000 0>; + + ocv-capacity-table-2 = <4372000 100>, <4306000 95>, <4247000 90>, + <4190000 85>, <4134000 80>, <4081000 75>, <4030000 70>, + <3984000 65>, <3930000 60>, <3884000 55>, <3850000 50>, + <3826000 45>, <3804000 40>, <3786000 35>, <3770000 30>, + <3753000 25>, <3734000 20>, <3712000 16>, <3693000 13>, + <3686000 11>, <3684000 10>, <3682000 9>, <3680000 8>, + <3676000 7>, <3668000 6>, <3643000 5>, <3600000 4>, + <3542000 3>, <3462000 2>, <3340000 1>, <3000000 0>; + + ocv-capacity-table-3 = <4365000 100>, <4304000 95>, <4246000 90>, + <4189000 85>, <4133000 80>, <4080000 75>, <4030000 70>, + <3985000 65>, <3933000 60>, <3886000 55>, <3852000 50>, + <3827000 45>, <3806000 40>, <3789000 35>, <3769000 30>, + <3746000 25>, <3726000 20>, <3706000 16>, <3688000 13>, + <3681000 11>, <3678000 10>, <3676000 9>, <3676000 8>, + <3672000 7>, <3660000 6>, <3634000 5>, <3588000 4>, + <3528000 3>, <3448000 2>, <3322000 1>, <3000000 0>; + + ocv-capacity-table-4 = <4358000 100>, <4298000 95>, <4240000 90>, + <4183000 85>, <4128000 80>, <4076000 75>, <4027000 70>, + <3983000 65>, <3935000 60>, <3887000 55>, <3852000 50>, + <3827000 45>, <3806000 40>, <3789000 35>, <3764000 30>, + <3738000 25>, <3715000 20>, <3695000 16>, <3677000 13>, + <3672000 11>, <3669000 10>, <3667000 9>, <3666000 8>, + <3662000 7>, <3652000 6>, <3622000 5>, <3577000 4>, + <3518000 3>, <3440000 2>, <3321000 1>, <3000000 0>; + }; + chosen { stdout-path = "serial0"; }; @@ -135,6 +190,12 @@ &mpss_mem { reg = <0x0 0x86800000 0x0 0x5500000>; }; +&pm8916_bms { + monitored-battery = <&battery>; + + status = "okay"; +}; + &pm8916_codec { qcom,micbias-lvl = <2800>; qcom,mbhc-vthreshold-low = <75 150 237 450 500>; -- 2.52.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery 2025-12-08 14:59 ` [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery Erikas Bitovtas @ 2025-12-18 12:29 ` Konrad Dybcio 0 siblings, 0 replies; 5+ messages in thread From: Konrad Dybcio @ 2025-12-18 12:29 UTC (permalink / raw) To: Erikas Bitovtas, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, ~postmarketos/upstreaming, phone-devel On 12/8/25 3:59 PM, Erikas Bitovtas wrote: > This device tracks remaining battery capacity percentage using voltage > mode BMS. This commit enables the pm8916_bms node and adds a battery > node to track its capacity. Battery properties were taken from the > information printed on the battery itself and downstream device tree > for a battery named "nvt+atl_3000mah" [1] > > [1] https://github.com/Asus-MSM8916/android_kernel_asus_msm8916/blob/10.x/arch/arm/boot/dts/qcom/ASUS_ZE550KL_1936167_3000mAh_3p4COV_VBMS_Final.dtsi > > Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com> > --- Amazing, thanks I checked a couple values and don't see any immediate issues Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Konrad ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] arm64: dts: qcom: msm8939-asus-z00t: add hall sensor 2025-12-08 14:59 [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Erikas Bitovtas 2025-12-08 14:59 ` [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery Erikas Bitovtas @ 2025-12-08 14:59 ` Erikas Bitovtas 2026-01-05 14:07 ` [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Bjorn Andersson 2 siblings, 0 replies; 5+ messages in thread From: Erikas Bitovtas @ 2025-12-08 14:59 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, ~postmarketos/upstreaming, phone-devel, Erikas Bitovtas, Konrad Dybcio This device uses ANPEC APX9131 hall sensor. It is a basic GPIO hall sensor for which a generic "gpio-keys" device tree node configuration suffices. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com> --- arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts index d0f0f80dd326..ea90b00a2c8a 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts @@ -82,7 +82,7 @@ chosen { gpio-keys { compatible = "gpio-keys"; - pinctrl-0 = <&gpio_keys_default>; + pinctrl-0 = <&gpio_hall_sensor_default>, <&gpio_keys_default>; pinctrl-names = "default"; button-volume-up { @@ -98,6 +98,15 @@ button-volume-down { linux,code = <KEY_VOLUMEDOWN>; debounce-interval = <15>; }; + + event-hall-sensor { + label = "Hall Effect Sensor"; + gpios = <&tlmm 108 GPIO_ACTIVE_LOW>; + linux,input-type = <EV_SW>; + linux,code = <SW_LID>; + linux,can-disable; + debounce-interval = <150>; + }; }; reg_sd_vmmc: regulator-sdcard-vmmc { @@ -301,6 +310,13 @@ gpio_keys_default: gpio-keys-default-state { bias-pull-up; }; + gpio_hall_sensor_default: gpio-hall-sensor-default-state { + pins = "gpio108"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + usb_id_default: usb-id-default-state { pins = "gpio110"; function = "gpio"; -- 2.52.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components. 2025-12-08 14:59 [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Erikas Bitovtas 2025-12-08 14:59 ` [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery Erikas Bitovtas 2025-12-08 14:59 ` [PATCH v3 2/2] arm64: dts: qcom: msm8939-asus-z00t: add hall sensor Erikas Bitovtas @ 2026-01-05 14:07 ` Bjorn Andersson 2 siblings, 0 replies; 5+ messages in thread From: Bjorn Andersson @ 2026-01-05 14:07 UTC (permalink / raw) To: Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Erikas Bitovtas Cc: linux-arm-msm, devicetree, linux-kernel, ~postmarketos/upstreaming, phone-devel, Konrad Dybcio On Mon, 08 Dec 2025 16:59:19 +0200, Erikas Bitovtas wrote: > Applied, thanks! [1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery commit: 094a6bbe84d43f04485d565f8174af66d90eb6a7 [2/2] arm64: dts: qcom: msm8939-asus-z00t: add hall sensor commit: 931b763e63b317d65f2555ea396f39bacba35b7d Best regards, -- Bjorn Andersson <andersson@kernel.org> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-05 14:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-12-08 14:59 [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Erikas Bitovtas 2025-12-08 14:59 ` [PATCH v3 1/2] arm64: dts: qcom: msm8939-asus-z00t: add battery Erikas Bitovtas 2025-12-18 12:29 ` Konrad Dybcio 2025-12-08 14:59 ` [PATCH v3 2/2] arm64: dts: qcom: msm8939-asus-z00t: add hall sensor Erikas Bitovtas 2026-01-05 14:07 ` [PATCH v3 0/2] Asus ZenFone 2 Laser/Selfie includes a battery measured by voltage mode BMS and a simple GPIO hall effect sensor. The following commits include support for these components Bjorn Andersson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®