Fix post-reflash charger-boot OCV calibration and CV taper in fuel gauge
This commit is contained in:
1 parent
e2981455ed
commit
f65dbb28a2
6 files changed
+255
-30
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ Geminux combines a custom-patched Linux `7.3.5` kernel, pure-Linux MTK flasher,
|
|||||||
|
|
||||||
## Kernel and MediaTek MT6797X support
|
## Kernel and MediaTek MT6797X support
|
||||||
|
|
||||||
- **Kernel tree**: Vanilla Linux `7.3.5` patched via [patches/kernel/](file:///home/lux/proj/geminux/patches/kernel) (`0001-ixoo-gemini-pda-mainline-7.3.5.patch`, `0002-mt6797-ccci-cldma-and-md1-domain.patch`, `0003-arm64-dts-mediatek-geminux-gemini-pda.patch`, `0004-gemini-ssd2092-display-and-touch.patch`, `0005-mt6797-consys-wifi-factory-firmware.patch`, `0006-mt6797-boot-cleanups.patch`, `0007-mt6797-wlan-peer-deauth-and-rekey.patch`, `0008-gemini-resume-wake-and-spm-standby.patch`, `0009-mt6797-wlan-drop-free-stability.patch`, `0010-mt6797-ccci-md1-boot-hs-v2-and-rpc.patch`, `0011-gemini-lid-sync-filter-and-debounce.patch` adding synchronous Hall GPIO66 lid-close keyboard/touch filtering, `1 ms` Hall EINT debounce, `10 ms` matrix keypad debounce, and touchscreen inhibit, and `0012-gemini-lid-wake-and-fg-taper-fix.patch` adding `gemini-lid` `PM_POST_SUSPEND`/raw-GPIO recheck reconciliation to prevent stuck `BL_CORE_SUSPENDED` / input inhibition alongside `mt6351-fuel-gauge` consecutive `win_ua`+`reg_ua` CV-taper validation, `+2%` step caps, conservative initial charging-OCV scaling, and `180 mV` boot-sag `ADC21` tolerance), with `CONFIG_XFRM_USER=y` and `esp4`, `esp6`, `af_key`, and `xfrm_interface` modules enabled for 3GPP IMS IPsec.
|
- **Kernel tree**: Vanilla Linux `7.3.5` patched via [patches/kernel/](file:///home/lux/proj/geminux/patches/kernel) (`0001-ixoo-gemini-pda-mainline-7.3.5.patch`, `0002-mt6797-ccci-cldma-and-md1-domain.patch`, `0003-arm64-dts-mediatek-geminux-gemini-pda.patch`, `0004-gemini-ssd2092-display-and-touch.patch`, `0005-mt6797-consys-wifi-factory-firmware.patch`, `0006-mt6797-boot-cleanups.patch`, `0007-mt6797-wlan-peer-deauth-and-rekey.patch`, `0008-gemini-resume-wake-and-spm-standby.patch`, `0009-mt6797-wlan-drop-free-stability.patch`, `0010-mt6797-ccci-md1-boot-hs-v2-and-rpc.patch`, `0011-gemini-lid-sync-filter-and-debounce.patch` adding synchronous Hall GPIO66 lid-close keyboard/touch filtering, `1 ms` Hall EINT debounce, `10 ms` matrix keypad debounce, and touchscreen inhibit, and `0012-gemini-lid-wake-and-fg-taper-fix.patch` adding `gemini-lid` `PM_POST_SUSPEND`/raw-GPIO recheck reconciliation to prevent stuck `BL_CORE_SUSPENDED` / input inhibition alongside `mt6351-fuel-gauge` + `bq25890` boot zero-current OCV calibration (`POWER_SUPPLY_PROP_CALIBRATE` / `MT6351_RGS_CHRDET`), consecutive `win_ua`+`reg_ua` CV-taper validation, `+1%` conservative step caps, and `180 mV` boot-sag `ADC21` tolerance), with `CONFIG_XFRM_USER=y` and `esp4`, `esp6`, `af_key`, and `xfrm_interface` modules enabled for 3GPP IMS IPsec.
|
||||||
- **Graphics & display**: MediaTek DRM (`mediatek-drm`), Solomon Systech `SSD2092` DSI FHD+ panel & touchscreen, early-boot `simpledrm` (`DRM_SIMPLEDRM=y` + rotated `TER16x32` console), Mali-T880 `panfrost` GPU driver, and `sii902x` Slimport/HDMI bridge.
|
- **Graphics & display**: MediaTek DRM (`mediatek-drm`), Solomon Systech `SSD2092` DSI FHD+ panel & touchscreen, early-boot `simpledrm` (`DRM_SIMPLEDRM=y` + rotated `TER16x32` console), Mali-T880 `panfrost` GPU driver, and `sii902x` Slimport/HDMI bridge.
|
||||||
- **Wi-Fi / Bluetooth CONSYS**: Staged `mt6797_wlan_core` and `btmt6797` drivers backed by NVRAM/factory firmware provisioning (`geminux-wifi-nvram` and `firmware-cache/mt6797/`), hardened by `0007` and `0009` for peer deauth, GTK rekey, and drop-free RX/TX buffer handling.
|
- **Wi-Fi / Bluetooth CONSYS**: Staged `mt6797_wlan_core` and `btmt6797` drivers backed by NVRAM/factory firmware provisioning (`geminux-wifi-nvram` and `firmware-cache/mt6797/`), hardened by `0007` and `0009` for peer deauth, GTK rekey, and drop-free RX/TX buffer handling.
|
||||||
- **Modem / Telephony / eSIM / IMS**: Staged `mt6797-ccci-cldma` driver exposing `/dev/ccci_md_ctl`, `/dev/ccci_fs`, `/dev/ccci_rpc`, `/dev/ttyC0..3`, and `ccmni*` network interfaces with the 16-byte `struct mt6797_ccci_header` UAPI ([mt6797_ccci.h](file:///home/lux/proj/geminux/prebuilt/kernel/include/linux/mt6797_ccci.h)). `geminux-ccci-daemon` ([geminux-ccci-fs.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-ccci-fs.c)) serves MD1 boot handshake v2, NVRAM/CCCI_FS file I/O, and RPC queries (`MD_STATE=READY`); `geminux-cellctl` ([geminux-cellctl.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-cellctl.c)) handles physical SIM vs. ST33 eUICC `AT+ESIMS` slot switching, `lpac` AT-`CSIM`/`CGLA` APDU bridging for eSIM provisioning, and `ccmni*` LTE PDN bring-up; `geminux-imsd` ([geminux-imsd.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-imsd.c)) provides 3GPP VoLTE over `ccmni*` and VoWiFi `SWu` IKEv2/IPsec via `strongswan`, ISIM/USIM MILENAGE AKA, kernel XFRM `ipsec-3gpp` with RFC 4303 userspace ESP fallback, SIP `REGISTER`/`INVITE`/`BYE`/`MESSAGE`, 3GPP `RP-DATA` SMS, and 20 ms `timerfd` AMR-NB/AMR-WB/G.711/DTMF RTP bridged to PipeWire/ALSA `VoiceCall` UCM2.
|
- **Modem / Telephony / eSIM / IMS**: Staged `mt6797-ccci-cldma` driver exposing `/dev/ccci_md_ctl`, `/dev/ccci_fs`, `/dev/ccci_rpc`, `/dev/ttyC0..3`, and `ccmni*` network interfaces with the 16-byte `struct mt6797_ccci_header` UAPI ([mt6797_ccci.h](file:///home/lux/proj/geminux/prebuilt/kernel/include/linux/mt6797_ccci.h)). `geminux-ccci-daemon` ([geminux-ccci-fs.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-ccci-fs.c)) serves MD1 boot handshake v2, NVRAM/CCCI_FS file I/O, and RPC queries (`MD_STATE=READY`); `geminux-cellctl` ([geminux-cellctl.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-cellctl.c)) handles physical SIM vs. ST33 eUICC `AT+ESIMS` slot switching, `lpac` AT-`CSIM`/`CGLA` APDU bridging for eSIM provisioning, and `ccmni*` LTE PDN bring-up; `geminux-imsd` ([geminux-imsd.c](file:///home/lux/proj/geminux/src/geminux-daemons/geminux-imsd.c)) provides 3GPP VoLTE over `ccmni*` and VoWiFi `SWu` IKEv2/IPsec via `strongswan`, ISIM/USIM MILENAGE AKA, kernel XFRM `ipsec-3gpp` with RFC 4303 userspace ESP fallback, SIP `REGISTER`/`INVITE`/`BYE`/`MESSAGE`, 3GPP `RP-DATA` SMS, and 20 ms `timerfd` AMR-NB/AMR-WB/G.711/DTMF RTP bridged to PipeWire/ALSA `VoiceCall` UCM2.
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ Additional flashing and offline image utilities:
|
|||||||
|
|
||||||
- Disconnecting/reflashing notes: eSIM profiles provisioned onto the hardware ST33 eUICC survive full eMMC rootfs reflashes (whereas flashing `linux` replaces `/` and `/home`).
|
- Disconnecting/reflashing notes: eSIM profiles provisioned onto the hardware ST33 eUICC survive full eMMC rootfs reflashes (whereas flashing `linux` replaces `/` and `/home`).
|
||||||
- Disconnect the USB-C cable and hold the **Esc** (power) button until the unit boots.
|
- Disconnect the USB-C cable and hold the **Esc** (power) button until the unit boots.
|
||||||
|
- If the unit boots while still attached to USB power (for example immediately after `--flash-full`), `bq25890` briefly holds charging disabled (`F_CHG_CFG=0`, ~15 s while `VSYS` stays powered from USB) so `mt6351-fuel-gauge` can anchor to the true zero-current battery OCV instead of the ~4.336 V flashing voltage.
|
||||||
- If flashed with `--encrypt`, the initramfs loads the standalone binary Gemini US keyboard map (`/etc/gemini-us.kmap`) on `tty1` and prompts for the LUKS2 passphrase before mounting `PARTLABEL=linux` via `cryptsetup open --allow-discards` as `/dev/mapper/geminux_root` (off-mode battery charging still runs before the unlock prompt). Because LUKS2 data segment 0 uses dynamic whole-device length, unlocking immediately maps the full `linux` partition.
|
- If flashed with `--encrypt`, the initramfs loads the standalone binary Gemini US keyboard map (`/etc/gemini-us.kmap`) on `tty1` and prompts for the LUKS2 passphrase before mounting `PARTLABEL=linux` via `cryptsetup open --allow-discards` as `/dev/mapper/geminux_root` (off-mode battery charging still runs before the unlock prompt). Because LUKS2 data segment 0 uses dynamic whole-device length, unlocking immediately maps the full `linux` partition.
|
||||||
- On first boot, the initramfs runs non-interactive `e2fsck -p` and `resize2fs -f` (`</dev/null`) to expand the ext4 filesystem across the full ~58 GiB `linux` partition, writes `/var/lib/geminux/.rootfs-resized` so future boots skip first-boot resizing, and pivots to OpenRC.
|
- On first boot, the initramfs runs non-interactive `e2fsck -p` and `resize2fs -f` (`</dev/null`) to expand the ext4 filesystem across the full ~58 GiB `linux` partition, writes `/var/lib/geminux/.rootfs-resized` so future boots skip first-boot resizing, and pivots to OpenRC.
|
||||||
- TinyDM automatically logs into XLibre + DWM as UID `10000` (either your provisioned `--username` or the default `user`; default password `geminux` unless set during flashing). SSH authorized key is installed from `keys/geminux_id_ed25519.pub` if generated. Change passwords at any time with `passwd`.
|
- TinyDM automatically logs into XLibre + DWM as UID `10000` (either your provisioned `--username` or the default `user`; default password `geminux` unless set during flashing). SSH authorized key is installed from `keys/geminux_id_ed25519.pub` if generated. Change passwords at any time with `passwd`.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Configured in [kernel/configs/geminux-mt6797x.config](file:///home/lux/proj/gemi
|
|||||||
|
|
||||||
- **`CONFIG_HZ_100=y`**: 100 Hz tick rate cuts periodic timer interrupt overhead compared to 250 Hz / 1000 Hz kernels while remaining responsive for interactive X11 workloads.
|
- **`CONFIG_HZ_100=y`**: 100 Hz tick rate cuts periodic timer interrupt overhead compared to 250 Hz / 1000 Hz kernels while remaining responsive for interactive X11 workloads.
|
||||||
- **`CONFIG_RCU_LAZY=y`**: Batches RCU callbacks during idle periods to extend CPU C-state residency.
|
- **`CONFIG_RCU_LAZY=y`**: Batches RCU callbacks during idle periods to extend CPU C-state residency.
|
||||||
- **`CONFIG_SUSPEND=y`**: Enables deep Suspend-to-RAM (`mem` / `deep`) via `mt6797-spm-sleep` (`sodi_idle=0 pmic_modes=0 timer_sec=600` in [etc/modprobe.d/geminux.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/modprobe.d/geminux.conf)) triggered on Gemini PDA lid close (`SW_LID`), battery idle timeout, or power button press. Keeping `pmic_modes=0` avoids asserting `MT6351` `VCORE` sleep voltage (`0.600 V`) while CPU0 remains powered in `WFI`, `spm_enter()` bounds silent PCM timer rollovers cleanly without `.suspend_again`, `mtk-eint` clears hardware debounce when switching wakeup pins such as `SW_LID` (`EINT5`) to edge-sensitive mode, `mtk-pmic-keys` reports `pm_wakeup_event()` on wakeup keypresses, `0011-gemini-lid-sync-filter-and-debounce.patch` tunes Hall EINT debounce to `1 ms` (keypad `10 ms`) while synchronously filtering spurious keystrokes/touches and inhibiting both matrix keypad and touchscreen whenever the lid magnet closes, and `0012-gemini-lid-wake-and-fg-taper-fix.patch` reconciles `gemini-lid` state on `PM_POST_SUSPEND` and raw-GPIO rechecks to prevent stuck `BL_CORE_SUSPENDED` / input lockouts alongside `mt6351-fuel-gauge` CV-taper (`win_ua`+`reg_ua`, `+2%` cap) and start-up `ADC21` sag tolerance hardening.
|
- **`CONFIG_SUSPEND=y`**: Enables deep Suspend-to-RAM (`mem` / `deep`) via `mt6797-spm-sleep` (`sodi_idle=0 pmic_modes=0 timer_sec=600` in [etc/modprobe.d/geminux.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/modprobe.d/geminux.conf)) triggered on Gemini PDA lid close (`SW_LID`), battery idle timeout, or power button press. Keeping `pmic_modes=0` avoids asserting `MT6351` `VCORE` sleep voltage (`0.600 V`) while CPU0 remains powered in `WFI`, `spm_enter()` bounds silent PCM timer rollovers cleanly without `.suspend_again`, `mtk-eint` clears hardware debounce when switching wakeup pins such as `SW_LID` (`EINT5`) to edge-sensitive mode, `mtk-pmic-keys` reports `pm_wakeup_event()` on wakeup keypresses, `0011-gemini-lid-sync-filter-and-debounce.patch` tunes Hall EINT debounce to `1 ms` (keypad `10 ms`) while synchronously filtering spurious keystrokes/touches and inhibiting both matrix keypad and touchscreen whenever the lid magnet closes, and `0012-gemini-lid-wake-and-fg-taper-fix.patch` reconciles `gemini-lid` state on `PM_POST_SUSPEND` and raw-GPIO rechecks to prevent stuck `BL_CORE_SUSPENDED` / input lockouts alongside `mt6351-fuel-gauge` + `bq25890` boot zero-current OCV calibration (`POWER_SUPPLY_PROP_CALIBRATE` / `MT6351_RGS_CHRDET`), CV-taper (`win_ua`+`reg_ua`, `+1%` cap), and start-up `ADC21` sag tolerance hardening.
|
||||||
- **`CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y`**: Uses scheduler utilization feedback (`schedutil`) across the MT6797X tri-cluster topology instead of static `performance` governors. [etc/init.d/geminux-hwinit](file:///home/lux/proj/geminux/overlay/rootfs/etc/init.d/geminux-hwinit) loads `clk-mt6797-mcusys` and `cpufreq-dt` by default (`GEMINUX_ENABLE_CPUFREQ="yes"` in [etc/conf.d/geminux-hwinit](file:///home/lux/proj/geminux/overlay/rootfs/etc/conf.d/geminux-hwinit)) independently of experimental Cortex-A72 bring-up (`GEMINUX_ENABLE_A72="no"`), enabling `policy0` (`221..897 MHz`) and `policy4` (`325..1209 MHz`) frequency scaling and `soc-thermal` cooling throttling.
|
- **`CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y`**: Uses scheduler utilization feedback (`schedutil`) across the MT6797X tri-cluster topology instead of static `performance` governors. [etc/init.d/geminux-hwinit](file:///home/lux/proj/geminux/overlay/rootfs/etc/init.d/geminux-hwinit) loads `clk-mt6797-mcusys` and `cpufreq-dt` by default (`GEMINUX_ENABLE_CPUFREQ="yes"` in [etc/conf.d/geminux-hwinit](file:///home/lux/proj/geminux/overlay/rootfs/etc/conf.d/geminux-hwinit)) independently of experimental Cortex-A72 bring-up (`GEMINUX_ENABLE_A72="no"`), enabling `policy0` (`221..897 MHz`) and `policy4` (`325..1209 MHz`) frequency scaling and `soc-thermal` cooling throttling.
|
||||||
- **`mt6797-gate-unused`**: Loaded at the end of `geminux-hwinit` (`GEMINUX_GATE_UNUSED_CLOCKS="yes"`) to gate ~25 unused bootloader peripheral leaf clocks (unused `SPI`, `UART`, `PWM`, `IRTX`, `ICUSB`, `ANC_MD32`, etc.) left enabled due to `clk_ignore_unused` while leaving active display/I2C clocks untouched.
|
- **`mt6797-gate-unused`**: Loaded at the end of `geminux-hwinit` (`GEMINUX_GATE_UNUSED_CLOCKS="yes"`) to gate ~25 unused bootloader peripheral leaf clocks (unused `SPI`, `UART`, `PWM`, `IRTX`, `ICUSB`, `ANC_MD32`, etc.) left enabled due to `clk_ignore_unused` while leaving active display/I2C clocks untouched.
|
||||||
- **Sensor IR LED gating**: `stk3310` is blacklisted in [etc/modprobe.d/geminux.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/modprobe.d/geminux.conf) (`GEMINUX_ENABLE_SENSORS="no"`) because its probe unconditionally enables continuous ALS and proximity IR LED polling with no userspace consumer.
|
- **Sensor IR LED gating**: `stk3310` is blacklisted in [etc/modprobe.d/geminux.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/modprobe.d/geminux.conf) (`GEMINUX_ENABLE_SENSORS="no"`) because its probe unconditionally enables continuous ALS and proximity IR LED polling with no userspace consumer.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Geminux is an Alpine Linux (`aarch64`, musl, OpenRC) distribution built specific
|
|||||||
|
|
||||||
| Subsystem | Implementation | Source / Script |
|
| Subsystem | Implementation | Source / Script |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Kernel & boot | Linux `7.3.5-geminux` + Gemini x27 patches (`SSD2092` DSI/touch, synchronous `gemini-lid` Hall filter, inhibit & `PM_POST_SUSPEND` lockout prevention `0011`/`0012`, `mt6351-fuel-gauge` CV-taper & start-up `ADC21` accuracy `0008`/`0012`, CONSYS Wi-Fi/BT + peer deauth/GTK rekey/drop-free stability `0007`/`0009`, S3 resume/SPM `0008`, CCCI/CLDMA + MD1 boot HS v2/RPC `0002`/`0010`, XFRM/ESP IPsec, `sii902x`, `dm-crypt` LUKS2 initramfs) | [scripts/build-kernel.sh](file:///home/lux/proj/geminux/scripts/build-kernel.sh) |
|
| Kernel & boot | Linux `7.3.5-geminux` + Gemini x27 patches (`SSD2092` DSI/touch, synchronous `gemini-lid` Hall filter, inhibit & `PM_POST_SUSPEND` lockout prevention `0011`/`0012`, `mt6351-fuel-gauge` + `bq25890` zero-current charger-boot OCV calibration, CV-taper & start-up `ADC21` accuracy `0008`/`0012`, CONSYS Wi-Fi/BT + peer deauth/GTK rekey/drop-free stability `0007`/`0009`, S3 resume/SPM `0008`, CCCI/CLDMA + MD1 boot HS v2/RPC `0002`/`0010`, XFRM/ESP IPsec, `sii902x`, `dm-crypt` LUKS2 initramfs) | [scripts/build-kernel.sh](file:///home/lux/proj/geminux/scripts/build-kernel.sh) |
|
||||||
| Flasher & GPT | Vendored GPLv3 `mtkclient` + MT6797 DA + GPT builder + offline credential & LUKS2 provisioning | [flash-mtk.sh](file:///home/lux/proj/geminux/flash-mtk.sh), [flash-mtk.py](file:///home/lux/proj/geminux/flash-mtk.py), [scripts/geminux_accounts.py](file:///home/lux/proj/geminux/scripts/geminux_accounts.py), [scripts/geminux_luks.py](file:///home/lux/proj/geminux/scripts/geminux_luks.py) |
|
| Flasher & GPT | Vendored GPLv3 `mtkclient` + MT6797 DA + GPT builder + offline credential & LUKS2 provisioning | [flash-mtk.sh](file:///home/lux/proj/geminux/flash-mtk.sh), [flash-mtk.py](file:///home/lux/proj/geminux/flash-mtk.py), [scripts/geminux_accounts.py](file:///home/lux/proj/geminux/scripts/geminux_accounts.py), [scripts/geminux_luks.py](file:///home/lux/proj/geminux/scripts/geminux_luks.py) |
|
||||||
| Display server | XLibre Xorg 25.x (`modesetting` `ShadowFB` + `TearFree` rotated 2D scanout alongside Panfrost Glamor/EGL 3D, `fbdev`, `libinput`) | [scripts/build-xlibre.sh](file:///home/lux/proj/geminux/scripts/build-xlibre.sh) |
|
| Display server | XLibre Xorg 25.x (`modesetting` `ShadowFB` + `TearFree` rotated 2D scanout alongside Panfrost Glamor/EGL 3D, `fbdev`, `libinput`) | [scripts/build-xlibre.sh](file:///home/lux/proj/geminux/scripts/build-xlibre.sh) |
|
||||||
| Window manager & terminal | Patched `dwm` (Pango, systray, `.Xresources`, `Mod4`, `Fn+F` Airplane Mode keybind, `SIGHUP` self-reexec), `st` (HarfBuzz ligatures, focus cursor sync & unfocused cursor-blink gating, wheel scrollback), full-height `dmenu` | [scripts/build-suckless.sh](file:///home/lux/proj/geminux/scripts/build-suckless.sh) |
|
| Window manager & terminal | Patched `dwm` (Pango, systray, `.Xresources`, `Mod4`, `Fn+F` Airplane Mode keybind, `SIGHUP` self-reexec), `st` (HarfBuzz ligatures, focus cursor sync & unfocused cursor-blink gating, wheel scrollback), full-height `dmenu` | [scripts/build-suckless.sh](file:///home/lux/proj/geminux/scripts/build-suckless.sh) |
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
From: Geminux <geminux@localhost>
|
From: Geminux <geminux@localhost>
|
||||||
Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stuck lid lockout and USB attach CV taper jump
|
Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge / bq25890: prevent stuck lid lockout and USB/boot OCV jumps
|
||||||
|
|
||||||
1. gemini-lid: Track SW_LID switch state, reconcile lid_closed with raw Hall
|
1. gemini-lid: Track SW_LID switch state, reconcile lid_closed with raw Hall
|
||||||
GPIO66 on PM_POST_SUSPEND/PM_POST_HIBERNATION, and schedule a finite 50 ms
|
GPIO66 on PM_POST_SUSPEND/PM_POST_HIBERNATION, and schedule a finite 50 ms
|
||||||
recheck whenever raw-GPIO filtering latches lid_closed while SW_LID is still
|
recheck whenever raw-GPIO filtering latches lid_closed while SW_LID is still
|
||||||
open or when SW_LID=1 conflicts with raw GPIO66, preventing permanent
|
open or when SW_LID=1 conflicts with raw GPIO66, preventing permanent
|
||||||
BL_CORE_SUSPENDED blackout and input inhibit lockout.
|
BL_CORE_SUSPENDED blackout and input inhibit lockout.
|
||||||
2. mt6351-fuel-gauge: Track instantaneous reg_ua alongside integrated win_ua
|
2. mt6351-fuel-gauge & bq25890: Detect USB VBUS charger presence at boot
|
||||||
and require 3 consecutive CV-taper windows on both before re-anchoring, cap
|
(MT6351_RGS_CHRDET / charging boot current) and briefly pause charging via
|
||||||
upward CV-taper steps to +2% of full per 5-minute interval, use conservative
|
POWER_SUPPLY_PROP_CALIBRATE (F_CHG_CFG=0, up to 15-25 s while VSYS runs from
|
||||||
2x R during unlearned charging first-OCV readings, and permit up to 180 mV
|
VBUS) so initial SoC anchors at true relaxed zero-current OCV rather than
|
||||||
(20%) discharge sag at boot before discarding PMIC start-up ADC21.
|
ADC21 or the charger-clamped 4.336 V float after USB reflashes; require 3
|
||||||
|
consecutive CV-taper windows on both win_ua and reg_ua, cap untrusted CV
|
||||||
|
adjustments to +1%/5m and <=99% until rest after termination, and tolerate
|
||||||
|
180 mV (20%) boot discharge sag when validating start-up ADC21.
|
||||||
|
|
||||||
---
|
---
|
||||||
--- a/drivers/input/misc/gemini-lid.c
|
--- a/drivers/input/misc/gemini-lid.c
|
||||||
@@ -179,16 +182,30 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu
|
|||||||
gpio_device_put(hall_gdev);
|
gpio_device_put(hall_gdev);
|
||||||
--- a/drivers/power/supply/mt6351-fuel-gauge.c
|
--- a/drivers/power/supply/mt6351-fuel-gauge.c
|
||||||
+++ b/drivers/power/supply/mt6351-fuel-gauge.c
|
+++ b/drivers/power/supply/mt6351-fuel-gauge.c
|
||||||
@@ -236,6 +236,8 @@
|
@@ -38,6 +38,11 @@
|
||||||
|
#define MT6351_PWRON_CODE GENMASK(14, 0)
|
||||||
|
#define MT6351_PWRON_MIN_UV 3000000
|
||||||
|
#define MT6351_PWRON_MAX_UV 4450000
|
||||||
|
+#define MT6351_CHR_CON0 0x0f78
|
||||||
|
+#define MT6351_RGS_CHRDET BIT(5)
|
||||||
|
+#define MT6351_FG_BOOT_CAL_SETTLE_MS (15 * MSEC_PER_SEC)
|
||||||
|
+#define MT6351_FG_BOOT_CAL_MAX_MS (25 * MSEC_PER_SEC)
|
||||||
|
+#define MT6351_FG_BOOT_CAL_MIN_UV 3650000
|
||||||
|
/* The software read controls in CON0's upper byte; the lower byte is left. */
|
||||||
|
#define MT6351_FG_CTRL_MASK GENMASK(15, 8)
|
||||||
|
#define MT6351_FG_SW_READ_PRE BIT(9)
|
||||||
|
@@ -236,6 +241,10 @@
|
||||||
bool win_first_done;
|
bool win_first_done;
|
||||||
int win_ua;
|
int win_ua;
|
||||||
bool win_ua_valid;
|
bool win_ua_valid;
|
||||||
+ int reg_ua;
|
+ int reg_ua;
|
||||||
+ unsigned int taper_windows;
|
+ unsigned int taper_windows;
|
||||||
|
+ ktime_t probe_time;
|
||||||
|
+ bool boot_cal;
|
||||||
/* The latest counter value, and since when the battery has rested. */
|
/* The latest counter value, and since when the battery has rested. */
|
||||||
s64 car;
|
s64 car;
|
||||||
ktime_t rest_start;
|
ktime_t rest_start;
|
||||||
@@ -367,6 +369,13 @@
|
@@ -367,6 +376,13 @@
|
||||||
dq_nah = mt6351_fg_car_nah(fg, car - fg->win_car);
|
dq_nah = mt6351_fg_car_nah(fg, car - fg->win_car);
|
||||||
fg->win_ua = div_s64(dq_nah * 3600, ms);
|
fg->win_ua = div_s64(dq_nah * 3600, ms);
|
||||||
fg->win_ua_valid = true;
|
fg->win_ua_valid = true;
|
||||||
@@ -202,7 +219,7 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The typical load follows the discharge; off battery it returns to the
|
* The typical load follows the discharge; off battery it returns to the
|
||||||
@@ -534,6 +543,7 @@
|
@@ -534,6 +550,7 @@
|
||||||
/* A 16-bit sign-magnitude-like code: above 32767 is discharge. */
|
/* A 16-bit sign-magnitude-like code: above 32767 is discharge. */
|
||||||
count = cur > 32767 ? -(s64)(65535 - cur) : (s64)cur;
|
count = cur > 32767 ? -(s64)(65535 - cur) : (s64)cur;
|
||||||
*current_ua = mt6351_fg_scale(fg, count, MT6351_FG_CURRENT_NA);
|
*current_ua = mt6351_fg_scale(fg, count, MT6351_FG_CURRENT_NA);
|
||||||
@@ -210,7 +227,7 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The whole 35-bit counter. The vendor keeps only bits 30:14, with
|
* The whole 35-bit counter. The vendor keeps only bits 30:14, with
|
||||||
@@ -791,7 +801,11 @@
|
@@ -791,7 +808,11 @@
|
||||||
goto counted;
|
goto counted;
|
||||||
}
|
}
|
||||||
/* The open-circuit voltage: charging current raises the terminal. */
|
/* The open-circuit voltage: charging current raises the terminal. */
|
||||||
@@ -223,38 +240,148 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu
|
|||||||
ret = power_supply_batinfo_ocv2cap(fg->info, uv, mc / 1000);
|
ret = power_supply_batinfo_ocv2cap(fg->info, uv, mc / 1000);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -826,7 +840,9 @@
|
@@ -800,6 +821,17 @@
|
||||||
|
mt6351_fg_report(fg, div_s64(full * ret, 100), capacity, charge_uah);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+ if (!fg->anchored && fg->boot_cal) {
|
||||||
|
+ s64 boot_ms = ktime_ms_delta(now, fg->probe_time);
|
||||||
|
+
|
||||||
|
+ if (boot_ms < MT6351_FG_BOOT_CAL_MAX_MS &&
|
||||||
|
+ (abs(ua) > MT6351_FG_IDLE_UA ||
|
||||||
|
+ boot_ms < MT6351_FG_BOOT_CAL_SETTLE_MS)) {
|
||||||
|
+ mt6351_fg_report(fg, div_s64(full * ret, 100),
|
||||||
|
+ capacity, charge_uah);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
dev_dbg(fg->dev, "%s OCV reading: %d uV at %d uA, %d mC: %d %%\n",
|
||||||
|
fg->anchored ? "rest" : "first", uv, ua, mc, ret);
|
||||||
|
if (settled && fg->taper_seen) {
|
||||||
|
@@ -815,7 +847,15 @@
|
||||||
|
}
|
||||||
|
fg->anchored = true;
|
||||||
|
fg->anchor_time = now;
|
||||||
|
- fg->anchor_trusted = settled;
|
||||||
|
+ if (fg->boot_cal) {
|
||||||
|
+ fg->boot_cal = false;
|
||||||
|
+ fg->anchor_trusted = settled || abs(ua) <= MT6351_FG_IDLE_UA;
|
||||||
|
+ *full_changed = true;
|
||||||
|
+ dev_info(fg->dev, "boot OCV %d uV at %d uA (%lld ms): %d %%\n",
|
||||||
|
+ uv, ua, ktime_ms_delta(now, fg->probe_time), ret);
|
||||||
|
+ } else {
|
||||||
|
+ fg->anchor_trusted = settled;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (rest_ms >= MT6351_FG_LEARN_REST_MS && !fg->rest_learned) {
|
||||||
|
fg->rest_learned = true;
|
||||||
|
@@ -826,24 +866,38 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In the charger's constant-voltage taper, the voltage gives the capacity. */
|
/* In the charger's constant-voltage taper, the voltage gives the capacity. */
|
||||||
- if (fg->anchored && ua > 0 && ua <= MT6351_FG_CV_MAX_UA &&
|
- if (fg->anchored && ua > 0 && ua <= MT6351_FG_CV_MAX_UA &&
|
||||||
|
- (!fg->cv_valid || ktime_ms_delta(now, fg->cv_time) >= MT6351_FG_CV_MS) &&
|
||||||
+ if (fg->anchored && fg->taper_windows >= 3 &&
|
+ if (fg->anchored && fg->taper_windows >= 3 &&
|
||||||
+ ua > MT6351_FG_IDLE_UA && ua <= MT6351_FG_CV_MAX_UA &&
|
+ ua > MT6351_FG_IDLE_UA && ua <= MT6351_FG_CV_MAX_UA &&
|
||||||
+ fg->reg_ua > MT6351_FG_IDLE_UA && fg->reg_ua <= MT6351_FG_CV_MAX_UA &&
|
+ fg->reg_ua > MT6351_FG_IDLE_UA && fg->reg_ua <= MT6351_FG_CV_MAX_UA &&
|
||||||
(!fg->cv_valid || ktime_ms_delta(now, fg->cv_time) >= MT6351_FG_CV_MS) &&
|
|
||||||
!mt6351_fg_voltage(fg, &uv) &&
|
!mt6351_fg_voltage(fg, &uv) &&
|
||||||
uv >= fg->info->voltage_max_design_uv - MT6351_FG_CV_MARGIN_UV &&
|
- uv >= fg->info->voltage_max_design_uv - MT6351_FG_CV_MARGIN_UV &&
|
||||||
@@ -834,10 +850,18 @@
|
- !thermal_zone_get_temp(fg->tz, &mc)) {
|
||||||
uv = mt6351_fg_ocv(fg, uv, ua, mc);
|
- uv = mt6351_fg_ocv(fg, uv, ua, mc);
|
||||||
ret = power_supply_batinfo_ocv2cap(fg->info, uv, mc / 1000);
|
- ret = power_supply_batinfo_ocv2cap(fg->info, uv, mc / 1000);
|
||||||
if (ret >= 0) {
|
- if (ret >= 0) {
|
||||||
|
- ret = clamp(ret, 0, 100);
|
||||||
|
- dev_dbg(fg->dev, "taper OCV reading: %d uV at %d uA, %d mC: %d %%\n",
|
||||||
|
- uv, ua, mc, ret);
|
||||||
|
- fg->anchor_uah = div_s64(full * ret, 100);
|
||||||
|
- fg->anchor_car = fg->car;
|
||||||
|
- fg->anchor_time = now;
|
||||||
|
- fg->anchor_trusted = false;
|
||||||
|
- fg->cv_time = now;
|
||||||
|
- fg->cv_valid = true;
|
||||||
|
- fg->taper_seen = true;
|
||||||
|
+ uv >= fg->info->voltage_max_design_uv - MT6351_FG_CV_MARGIN_UV) {
|
||||||
|
+ fg->taper_seen = true;
|
||||||
|
+ if (!fg->anchor_trusted && ua <= 220000 &&
|
||||||
|
+ (!fg->cv_valid || ktime_ms_delta(now, fg->cv_time) >= MT6351_FG_CV_MS) &&
|
||||||
|
+ !thermal_zone_get_temp(fg->tz, &mc)) {
|
||||||
|
+ uv = mt6351_fg_ocv(fg, uv, ua, mc);
|
||||||
|
+ ret = power_supply_batinfo_ocv2cap(fg->info, uv, mc / 1000);
|
||||||
|
+ if (ret >= 0) {
|
||||||
+ s64 counted_uah = fg->anchor_uah +
|
+ s64 counted_uah = fg->anchor_uah +
|
||||||
+ div_s64(mt6351_fg_car_nah(fg, fg->car - fg->anchor_car), 1000);
|
+ div_s64(mt6351_fg_car_nah(fg, fg->car - fg->anchor_car), 1000);
|
||||||
+ s64 target_uah, max_up;
|
+ s64 target_uah, max_up, max_cv;
|
||||||
+
|
+
|
||||||
ret = clamp(ret, 0, 100);
|
+ ret = clamp(ret, 0, 100);
|
||||||
+ target_uah = div_s64(full * ret, 100);
|
+ target_uah = div_s64(full * ret, 100);
|
||||||
+ max_up = counted_uah + div_s64(full * 2, 100);
|
+ max_up = counted_uah + div_s64(full, 100);
|
||||||
|
+ max_cv = div_s64(mt6351_fg_usable(full) * 99, 100);
|
||||||
+ if (target_uah > max_up)
|
+ if (target_uah > max_up)
|
||||||
+ target_uah = max_up;
|
+ target_uah = max_up;
|
||||||
dev_dbg(fg->dev, "taper OCV reading: %d uV at %d uA, %d mC: %d %%\n",
|
+ if (target_uah > max_cv)
|
||||||
uv, ua, mc, ret);
|
+ target_uah = max_cv;
|
||||||
- fg->anchor_uah = div_s64(full * ret, 100);
|
+ dev_dbg(fg->dev, "taper OCV reading: %d uV at %d uA, %d mC: %d %%\n",
|
||||||
|
+ uv, ua, mc, ret);
|
||||||
+ fg->anchor_uah = target_uah;
|
+ fg->anchor_uah = target_uah;
|
||||||
fg->anchor_car = fg->car;
|
+ fg->anchor_car = fg->car;
|
||||||
fg->anchor_time = now;
|
+ fg->anchor_time = now;
|
||||||
fg->anchor_trusted = false;
|
+ fg->cv_time = now;
|
||||||
@@ -1023,9 +1047,11 @@
|
+ fg->cv_valid = true;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -917,6 +971,16 @@
|
||||||
|
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
|
||||||
|
val->intval = fg->info->voltage_min_design_uv;
|
||||||
|
return 0;
|
||||||
|
+ case POWER_SUPPLY_PROP_CALIBRATE:
|
||||||
|
+ scoped_guard(mutex, &fg->lock) {
|
||||||
|
+ if (fg->boot_cal &&
|
||||||
|
+ (fg->anchored ||
|
||||||
|
+ ktime_ms_delta(ktime_get_boottime(), fg->probe_time) >=
|
||||||
|
+ MT6351_FG_BOOT_CAL_MAX_MS))
|
||||||
|
+ fg->boot_cal = false;
|
||||||
|
+ val->intval = fg->boot_cal ? 1 : 0;
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
case POWER_SUPPLY_PROP_SCOPE:
|
||||||
|
/* Asked of every supply when the core looks for one online. */
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -990,6 +1054,7 @@
|
||||||
|
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
|
||||||
|
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
|
||||||
|
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
|
||||||
|
+ POWER_SUPPLY_PROP_CALIBRATE,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -1001,8 +1066,23 @@
|
||||||
|
*/
|
||||||
|
static void mt6351_fg_pwron_anchor(struct mt6351_fg *fg, int init_ua)
|
||||||
|
{
|
||||||
|
- unsigned int val;
|
||||||
|
+ unsigned int val, chr = 0;
|
||||||
|
int uv, mc, pct, live_uv;
|
||||||
|
+ bool chrdet;
|
||||||
|
+
|
||||||
|
+ chrdet = !regmap_read(fg->regmap, MT6351_CHR_CON0, &chr) &&
|
||||||
|
+ (chr & MT6351_RGS_CHRDET);
|
||||||
|
+ if (chrdet || init_ua > MT6351_FG_IDLE_UA) {
|
||||||
|
+ if (!mt6351_fg_voltage(fg, &live_uv) &&
|
||||||
|
+ live_uv >= MT6351_FG_BOOT_CAL_MIN_UV) {
|
||||||
|
+ scoped_guard(mutex, &fg->lock)
|
||||||
|
+ fg->boot_cal = true;
|
||||||
|
+ dev_info(fg->dev,
|
||||||
|
+ "charger present at boot (%d uV); pausing charge for zero-current OCV anchor\n",
|
||||||
|
+ live_uv);
|
||||||
|
+ }
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (regmap_read(fg->regmap, MT6351_AUXADC_ADC21, &val) ||
|
||||||
|
!(val & MT6351_PWRON_RDY) || thermal_zone_get_temp(fg->tz, &mc))
|
||||||
|
@@ -1023,9 +1103,11 @@
|
||||||
if (!mt6351_fg_voltage(fg, &live_uv)) {
|
if (!mt6351_fg_voltage(fg, &live_uv)) {
|
||||||
int live_ocv = mt6351_fg_ocv(fg, live_uv, init_ua, mc);
|
int live_ocv = mt6351_fg_ocv(fg, live_uv, init_ua, mc);
|
||||||
int live_pct = power_supply_batinfo_ocv2cap(fg->info, live_ocv, mc / 1000);
|
int live_pct = power_supply_batinfo_ocv2cap(fg->info, live_ocv, mc / 1000);
|
||||||
@@ -268,3 +395,100 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu
|
|||||||
dev_info(fg->dev,
|
dev_info(fg->dev,
|
||||||
"ignoring stale start-up OCV %d uV (%d %%) vs live %d uV (%d %%)\n",
|
"ignoring stale start-up OCV %d uV (%d %%) vs live %d uV (%d %%)\n",
|
||||||
uv, pct, live_ocv, live_pct);
|
uv, pct, live_ocv, live_pct);
|
||||||
|
@@ -1121,6 +1203,8 @@
|
||||||
|
fg->full_uah = info->charge_full_design_uah;
|
||||||
|
WRITE_ONCE(fg->info, info);
|
||||||
|
|
||||||
|
+ fg->probe_time = ktime_get_boottime();
|
||||||
|
+
|
||||||
|
/* Open the first current window now, so the current is known 5 s on. */
|
||||||
|
{
|
||||||
|
int init_ua = 0, init_uah = 0;
|
||||||
|
@@ -1177,10 +1261,15 @@
|
||||||
|
return -ENODATA;
|
||||||
|
|
||||||
|
scoped_guard(mutex, &fg->lock) {
|
||||||
|
+ bool changed = (fg->r25_uohm != r);
|
||||||
|
+
|
||||||
|
fg->r25_uohm = r;
|
||||||
|
- fg->empty_valid = false;
|
||||||
|
- if (!fg->anchor_trusted)
|
||||||
|
- fg->anchored = false;
|
||||||
|
+ if (changed) {
|
||||||
|
+ fg->empty_valid = false;
|
||||||
|
+ if (!fg->anchor_trusted &&
|
||||||
|
+ (!fg->win_ua_valid || fg->win_ua <= MT6351_FG_IDLE_UA))
|
||||||
|
+ fg->anchored = false;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
power_supply_changed(fg->psy);
|
||||||
|
|
||||||
|
--- a/drivers/power/supply/bq25890_charger.c
|
||||||
|
+++ b/drivers/power/supply/bq25890_charger.c
|
||||||
|
@@ -193,6 +193,7 @@
|
||||||
|
bool guard_vreg_high;
|
||||||
|
bool guard_temp;
|
||||||
|
bool guard_full;
|
||||||
|
+ bool guard_cal;
|
||||||
|
unsigned int guard_unread;
|
||||||
|
|
||||||
|
struct mutex lock; /* protect state data */
|
||||||
|
@@ -1276,6 +1277,15 @@
|
||||||
|
return bq->guard_full;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool bq25890_guard_calibrating(struct power_supply *batt)
|
||||||
|
+{
|
||||||
|
+ union power_supply_propval val;
|
||||||
|
+
|
||||||
|
+ if (!batt || power_supply_get_property(batt, POWER_SUPPLY_PROP_CALIBRATE, &val))
|
||||||
|
+ return false;
|
||||||
|
+ return val.intval != 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static const enum power_supply_property bq25890_guard_ext_props[] = {
|
||||||
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD,
|
||||||
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD,
|
||||||
|
@@ -1519,6 +1529,7 @@
|
||||||
|
int end = READ_ONCE(bq->guard_end);
|
||||||
|
int start = READ_ONCE(bq->guard_start);
|
||||||
|
bool was_temp = bq->guard_temp, was_full = bq->guard_full;
|
||||||
|
+ bool was_cal = bq->guard_cal;
|
||||||
|
bool was_vreg_high = bq->guard_vreg_high;
|
||||||
|
bool was_raised = bq->guard_wall && bq->guard_board < 2;
|
||||||
|
int was_board = bq->guard_board, board_mc;
|
||||||
|
@@ -1529,7 +1540,8 @@
|
||||||
|
|
||||||
|
bq->guard_temp = bq25890_guard_temp(bq, batt, &temp);
|
||||||
|
bq->guard_full = bq25890_guard_full(bq, batt, start, end, &capacity);
|
||||||
|
- stop = bq->guard_temp || bq->guard_full;
|
||||||
|
+ bq->guard_cal = bq25890_guard_calibrating(batt);
|
||||||
|
+ stop = bq->guard_temp || bq->guard_full || bq->guard_cal;
|
||||||
|
batt = bq25890_guard_offer(bq, batt);
|
||||||
|
if (batt)
|
||||||
|
power_supply_put(batt);
|
||||||
|
@@ -1568,10 +1580,12 @@
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
dev_crit_ratelimited(bq->dev, "guard cannot reach the charger: %d\n", ret);
|
||||||
|
- else if (bq->guard_temp != was_temp || bq->guard_full != was_full || chg == stop)
|
||||||
|
- dev_info(bq->dev, "guard: charging %s: temp=%d capacity=%d limit=%d%s%s\n",
|
||||||
|
+ else if (bq->guard_temp != was_temp || bq->guard_full != was_full ||
|
||||||
|
+ bq->guard_cal != was_cal || chg == stop)
|
||||||
|
+ dev_info(bq->dev, "guard: charging %s: temp=%d capacity=%d limit=%d%s%s%s\n",
|
||||||
|
stop ? "stopped" : "allowed", temp, capacity, end,
|
||||||
|
- bq->guard_temp ? " temperature" : "", bq->guard_full ? " full" : "");
|
||||||
|
+ bq->guard_temp ? " temperature" : "", bq->guard_full ? " full" : "",
|
||||||
|
+ bq->guard_cal ? " calibrating" : "");
|
||||||
|
raised = bq->guard_wall && bq->guard_board < 2;
|
||||||
|
if (!ret && raised && (!was_raised || bq->guard_board != was_board)) {
|
||||||
|
bq25890_guard_raised(bq->guard_board, &iinlim_ua, &ichg_ua);
|
||||||
|
@@ -1587,7 +1601,7 @@
|
||||||
|
TBL_VREG) / 1000, temp);
|
||||||
|
|
||||||
|
queue_delayed_work(system_power_efficient_wq, &bq->guard_work,
|
||||||
|
- BQ25890_GUARD_PERIOD);
|
||||||
|
+ bq->guard_cal ? msecs_to_jiffies(2000) : BQ25890_GUARD_PERIOD);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Before the power supply goes: the work and its sysfs attribute both use it. */
|
||||||
Binary file not shown.
Reference in new issue
Block a user