高通平台配置开机后长按power key功能

开机后长按power key可实现系统重启、关机等功能,如下可配置长按时间以及长按功能:
在kernel中有的配置项将覆盖xbl中的配置,即只配置如下第1点即可

  • kernel/…/pmxxx.dtsi
  •  pmxxx_pon: qcom,power-on@800 {
     	compatible = "qcom,qpnp-power-on";
     	...
     	qcom,pon_1 {
     		qcom,pon-type = <0>;
     		qcom,support-reset = <1>;
     		qcom,pull-up = <1>;
     		qcom,s1-timer = <4480>;
     		qcom,s2-timer = <1000>;  //debounce time = s1+s2
     		qcom,s2-type = <4>; //4 shutdown, 7 hard reset
     		linux,code = <116>;
     	};
     };
    

The below mentioned properties are required only when
qcom,support-reset property is defined and is set to 1.

   qcom,s1-timer
   The debounce timer for the BARK interrupt for that reset source. Value is specified in ms. Supported values are: 0, 32, 56, 80,

128, 184, 272, 408, 608, 904, 1352, 2048, 3072, 4480, 6720, 10256
qcom,s2-timer
The debounce timer for the S2 reset specified in ms. On the expiry of this timer, the PMIC executes the reset sequence. Supported
values are: 0, 10, 50, 100, 250, 500, 1000, 2000
qcom,s2-type
The type of reset associated with this source. The supported resets are: SOFT(0), WARM(1), SHUTDOWN(4), HARD(7)

  1. boot_image/…/pm_sbl_boot_oem.c
> pm_device_post_init(void)  {  ...   /* PON KPDPWR configuration:
    > s1_timer=10256ms, S2_timer=2000ms, Hard Reset */    err_flag |=
    > pm_pon_reset_source_cfg(0, PM_PON_RESET_SOURCE_KPDPWR, 10256, 2000,  
    > PM_PON_RESET_CFG_HARD_RESET);    /* Disable Qcom original S2 reset
    > configuration */    err_flag |= pm_pon_reset_source_ctl(0,
    > PM_PON_RESET_SOURCE_KPDPWR, PM_ON);    err_flag |=
    > pm_pon_reset_source_ctl(0, PM_PON_RESET_SOURCE_RESIN_AND_KPDPWR,
    > PM_OFF);    err_flag |= pm_pon_reset_source_ctl(0,
    > PM_PON_RESET_SOURCE_RESIN, PM_OFF); 
    > 
    >   /* Set s3 reset configuration: time is 16 sec.*/    err_flag |=
    > pm_pon_stage3_reset_source_cfg(0, PM_PON_RESET_SOURCE_KPDPWR, 32);  }

另外,如下配置可实现系统在触发crash时自动进入dump模式

pm_err_flag_type pm_oem_pon_reset_cfg()
{
 ...
  //These configurations is only used for development phones and should be commented out for production phones
  err_flag |= pm_app_pon_pshold_cfg(PM_APP_PON_CFG_WARM_RESET);
  //err_flag |= pm_app_pon_reset_cfg( PM_APP_PON_RESET_SOURCE_KPDPWR, reset_type, 10256, 2000); //PON KPDPWR PON Reset configuration
  err_flag |= pm_pon_set_option_bit( 0, PM_PON_OPTION_KPDPWR_FEDGE_PON, TRUE); //Configure KPDPWR for edge trigger
  err_flag |= pm_app_pon_reset_cfg( PM_APP_PON_RESET_SOURCE_KPDPWR, PM_APP_PON_CFG_DVDD_SHUTDOWN, 10256, 2000); //PON KPDPWR PON Shutdown configuration
  err_flag |= pm_app_pon_reset_cfg( PM_APP_PON_RESET_SOURCE_RESIN_AND_KPDPWR, PM_APP_PON_CFG_DVDD_HARD_RESET, 10256, 2000); //PON RESIN_AND_KPDPWR PON Reset configuration
}

原文地址:https://blog.csdn.net/qq_17242955/article/details/103894966

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值