diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 3fc199e..1d3976f 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -4,7 +4,7 @@ Geminux combines a custom-patched Linux `7.3.5` kernel, pure-Linux MTK flasher, ## 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. - **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. diff --git a/INSTALL.md b/INSTALL.md index a5e05f9..781cbe6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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`). - 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. - On first boot, the initramfs runs non-interactive `e2fsck -p` and `resize2fs -f` (` -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 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 open or when SW_LID=1 conflicts with raw GPIO66, preventing permanent BL_CORE_SUSPENDED blackout and input inhibit lockout. -2. mt6351-fuel-gauge: Track instantaneous reg_ua alongside integrated win_ua - and require 3 consecutive CV-taper windows on both before re-anchoring, cap - upward CV-taper steps to +2% of full per 5-minute interval, use conservative - 2x R during unlearned charging first-OCV readings, and permit up to 180 mV - (20%) discharge sag at boot before discarding PMIC start-up ADC21. +2. mt6351-fuel-gauge & bq25890: Detect USB VBUS charger presence at boot + (MT6351_RGS_CHRDET / charging boot current) and briefly pause charging via + POWER_SUPPLY_PROP_CALIBRATE (F_CHG_CFG=0, up to 15-25 s while VSYS runs from + VBUS) so initial SoC anchors at true relaxed zero-current OCV rather than + 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 @@ -179,16 +182,30 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu gpio_device_put(hall_gdev); --- a/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; int win_ua; bool win_ua_valid; + int reg_ua; + unsigned int taper_windows; ++ ktime_t probe_time; ++ bool boot_cal; /* The latest counter value, and since when the battery has rested. */ s64 car; ktime_t rest_start; -@@ -367,6 +369,13 @@ +@@ -367,6 +376,13 @@ dq_nah = mt6351_fg_car_nah(fg, car - fg->win_car); fg->win_ua = div_s64(dq_nah * 3600, ms); 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 -@@ -534,6 +543,7 @@ +@@ -534,6 +550,7 @@ /* A 16-bit sign-magnitude-like code: above 32767 is discharge. */ count = cur > 32767 ? -(s64)(65535 - cur) : (s64)cur; *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 -@@ -791,7 +801,11 @@ +@@ -791,7 +808,11 @@ goto counted; } /* 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); if (ret < 0) 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. */ - 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 && + 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->cv_valid || ktime_ms_delta(now, fg->cv_time) >= MT6351_FG_CV_MS) && !mt6351_fg_voltage(fg, &uv) && - uv >= fg->info->voltage_max_design_uv - MT6351_FG_CV_MARGIN_UV && -@@ -834,10 +850,18 @@ - 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 + -+ div_s64(mt6351_fg_car_nah(fg, fg->car - fg->anchor_car), 1000); -+ s64 target_uah, max_up; -+ - ret = clamp(ret, 0, 100); -+ target_uah = div_s64(full * ret, 100); -+ max_up = counted_uah + div_s64(full * 2, 100); -+ if (target_uah > max_up) -+ target_uah = max_up; - dev_dbg(fg->dev, "taper OCV reading: %d uV at %d uA, %d mC: %d %%\n", - uv, ua, mc, ret); +- uv >= fg->info->voltage_max_design_uv - MT6351_FG_CV_MARGIN_UV && +- !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) { +- 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_uah = target_uah; - fg->anchor_car = fg->car; - fg->anchor_time = now; - fg->anchor_trusted = false; -@@ -1023,9 +1047,11 @@ +- 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 + ++ div_s64(mt6351_fg_car_nah(fg, fg->car - fg->anchor_car), 1000); ++ s64 target_uah, max_up, max_cv; ++ ++ ret = clamp(ret, 0, 100); ++ target_uah = div_s64(full * ret, 100); ++ max_up = counted_uah + div_s64(full, 100); ++ max_cv = div_s64(mt6351_fg_usable(full) * 99, 100); ++ if (target_uah > max_up) ++ target_uah = max_up; ++ if (target_uah > max_cv) ++ target_uah = max_cv; ++ 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_car = fg->car; ++ fg->anchor_time = now; ++ fg->cv_time = now; ++ 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)) { 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); @@ -268,3 +395,100 @@ Subject: [PATCH 12/12] Input: gemini-lid / power: mt6351-fuel-gauge: prevent stu dev_info(fg->dev, "ignoring stale start-up OCV %d uV (%d %%) vs live %d uV (%d %%)\n", 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. */ diff --git a/prebuilt/kernel/boot/Image.gz b/prebuilt/kernel/boot/Image.gz index 5dfa4c2..6f12bcb 100644 Binary files a/prebuilt/kernel/boot/Image.gz and b/prebuilt/kernel/boot/Image.gz differ