Android:展锐T710平台长按power键关机功能

uboot15/include/configs/ud710_xxx.h
/*7S reset config*/
#define CONFIG_7S_RST_MODULE_EN        1    //0:disable module; 1:enable module

#ifdef DEBUG
#define CONFIG_7S_RST_SW_MODE    1    //0:hw reset,1:arm reset,power keep on    //soft for debug version
#else
#define CONFIG_7S_RST_SW_MODE    0    //0:hw reset,1:arm reset,power keep on    //hard for user version
#endif

#define CONFIG_7S_RST_SHORT_MODE    1    //0:long press then release key to trigger;1:press key some time to trigger
#define CONFIG_7S_RST_2KEY_MODE        0    //0:1Key--Normal mode; 1:2KEY
#define CONFIG_7S_RST_THRESHOLD        15    //7S, hold key down for this time to trigger


void pmic_misc_init(void)
{
    debugf("pmic_misc_init\n");

    pbint_7s_rst_cfg(CONFIG_7S_RST_MODULE_EN,
                CONFIG_7S_RST_SW_MODE,
                CONFIG_7S_RST_SHORT_MODE);

#ifdef CONFIG_SMPL_EN
    smpl_config();
#endif

#if defined CONFIG_ADIE_SC2723S || defined CONFIG_ADIE_SC2723
    sci_adi_set(ANA_REG_GLB_LDO_SHPT_PD2, BIT_LDO_VIBR_SHPT_PD);    //close vibr short protection
#endif

#if defined(CONFIG_ADIE_SC2731) || defined(CONFIG_ADIE_SC2721) \
    || defined(CONFIG_ADIE_SC2720) || defined(CONFIG_ADIE_SC2730)
    sci_adi_write(ANA_REG_GLB_OTP_CTRL, (BIT_OTP_EN|BITS_OTP_OP(0)), (BIT_OTP_EN|BITS_OTP_OP(3)));    //open otp and set 135C
#endif

#if defined(CONFIG_ADIE_SC2721) || defined(CONFIG_ADIE_SC2720) || defined(CONFIG_ADIE_SC2730)
    printf("last shutdown flag ANA_REG_GLB_POR_OFF_FLAG:0x%x\n",ANA_REG_GET(ANA_REG_GLB_POR_OFF_FLAG));
    sci_adi_set(ANA_REG_GLB_POR_OFF_FLAG, 0xffff);    //clear power off flag
    //add begin
    if(ANA_REG_GET(ANA_REG_GLB_POR_OFF_FLAG)&BIT(9) == 0x200){
        power_down_devices(0);
    }
    //add end
#endif
    regulator_pmic_init();
}

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

leezs0614

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值