Android5.1 修改距离感应的阈值

版权声明:版权所有,转载请注明出处,感谢阅读 https://blog.csdn.net/m0_37526672/article/details/80648218
在Android5.1 修改距离感应的阈值,主要修改两个参数:
.ps_threshold_high = 200,
.ps_threshold_low = 110,

程序中 ~/mt6735/kernel-3.10/drivers/misc/mediatek/alsps/em3071x/em3071x.c 会在 atomic_set(&obj->ps_thd_val_high, obj->hw->ps_threshold_high);函数中判断 ,当 ps_thd_val_high 值高于ps_threshold_high 打电话时黑屏;会在atomic_set(&obj->ps_thd_val_low, obj->hw->ps_threshold_low);函数中判断,当 ps_thd_val_low值低于ps_threshold_low 时,亮屏。

修改距离感应的阈值代码
文件:~/mt6735/kernel-3.10/drivers/misc/mediatek/alsps/em3071x/em3071x_cust_alsps.c

  1. static struct alsps_hw cust_alsps_hw = {

  2.     .i2c_num    = 2,

  3.     .polling_mode_ps =0,
  4.     .polling_mode_als =1,
  5.     .power_id   = MT65XX_POWER_NONE,    /*LDO is not used*/
  6.     .power_vol  = VOL_DEFAULT,          /*LDO is not used*/
  7.     //.i2c_addr   = {0x24, 0x00, 0x00, 0x00},   /*em3071x*/
  8.     .als_level  = {5,  9, 36, 59, 82, 132, 205, 273, 500, 845, 1136, 1545, 2364, 4655, 6982},   /* als_code */
  9.     .als_value  = {10, 60, 115, 200, 260, 380, 460, 580, 650, 930, 1250, 1700, 2600, 5120, 7680, 10240},    /* lux */
  10.     .ps_threshold_high = 200,
  11.     .ps_threshold_low = 110,

  12. };
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页