MTK 5G MT6885/MT6853/MT6873 如何配置长按关机

[DESCRIPTION]
5G平台上客户经常会问到禁用长按power key重启,以及调整长按时间等问题。
如果需要MTK相关的技术支持,可以点击这里,或者加微信19857127072**

[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的是不可调整的。

猜你喜欢

转载自blog.csdn.net/MTK_Engineer/article/details/108677608