[MTK] 如何配置长按关机

文摘 Kernel MediaTek 2021-01-9 阅读:6156
  • [DESCRIPTION]

5G平台上客户经常会问到禁用长按power key重启,以及调整长按时间等问题。

  • [SOLUTION]

6359参考配置如下:

Preloader:

In <preloader_path>/platform/<chip_id>/default.mak
CFG_LPRST_SUPPORT :=1
(1): enable long press shutdown, (0): disable long press shutdown
ONEKEY_REBOOT_NORMAL_MODE_PL :=1
(1): Set "power key" to trigger long press shutdown, (0): Set "power key + home key(Volume up)" to trigger long press shutdown
KPD_PMIC_LPRST_TD :=0
(0): 8s, (1): 11s, (2): 14s, (3): 5s

Before kernel-4.14:

In <kernel_path>/arch/arm[64]/<project_config_file>
Disable LPSD:
移除CONFIG_ONEKEY_REBOOT_NORMAL_MODE 和 CONFIG_TWOKEY_REBOOT_NORMAL_MODE
Enable LPSD 并设定 "power key" 触发LPSD:
CONFIG_ONEKEY_REBOOT_NORMAL_MODE=y
Enable LPSD 并设定 "power key + home key(Volume up)" 触发LPSD:
CONFIG_TWOKEY_REBOOT_NORMAL_MODE=y
设定长按时间:
CONFIG_KPD_PMIC_LPRST_TD=0,(0): 8s, (1): 11s, (2): 14s, (3): 5s

After kernel-4.19:

(64bit) In <kernel_path>/arch/arm64/boot/dts/mediatek/<pmic_chip>.dtsi
(32bit) In <kernel_path>/arch/arm/boot/dts/<pmic_chip>.dtsi
mediatek,long-press-mode = <1>;
(0): disable LPSD,
(1): Set "power key" to trigger long press shutdown,
(2): Set "power key + home key(Volume up)" to trigger long press shutdown
power-off-time-sec = <0>;
(0): 8s, (1): 11s, (2): 14s, (3): 5s

6360禁用LPSD相对简单:

将0x2a寄存器的bit 7写1即可。如下:

cat /d/rt-regmap/mt6360_pmu.5-0034/reg0x2a
reg0x2a:0xc0         // 转成二进制,1100 0000,最高位bit 7为1

其他一些疑问:

MT6360的长按power键15s硬复位功能的时间是否可调?
=> 不行,这是硬件行为断开power path
在这个基础上可以更改复位时间和组合键吗?
=> 如果是指6360,无法改组合键和时间
目前打算长按power键和音量+键8s进行硬复位,是否可实现?
=> 如果是6359,可以使用组合键,时间也可以设定8s重启(不断power path)。6360的是不可调整的。

0条评论

© 2024 芯缘异码. Powered by Typecho