MT6571 alps 光感 stk3x1x(光感als+距离传感器ps)
来源:互联网 发布:国家甲醛检测标准 知乎 编辑:程序博客网 时间:2024/04/26 19:03
调试 stk3x1x(光感als+距离传感器ps)
Cust_alsps.h (custom\common\kernel\alsps\inc) //这个文件是公共的,如果有设备的这个结构体不一样,把他的设备的参数都添加到这个结构体上。
查设备挂在哪个总线上,就进入哪个总线上找,例如这个光感
root@android:/sys/devices/platform/mt-i2c.1/i2c-1 #cat 1-0048/name
stk3x1x
配置ProjectConfig.mk中
CUSTOM_KERNEL_ALSPS =stk3x1x
Cust_alsps.h (custom\common\kernel\alsps\inc) //这个文件是公共的,如果有设备的这个结构体不一样,把他的设备的参数都添加到这个结构体上。
#define C_CUST_I2C_ADDR_NUM 1 // 可以有多个,看设备能接收多少个地址//注意如果这里乱设置数量,可能会引起这个i2c上挂的别的设备挂载失败。 //比如:这个alps设备只能拉收一个地址,而改成为4个,导致了ft5260(Touchpanel)工作失败。//从uart 口抓log来看,MTK平台,先初始化accelerometer再,接着alps,接着是TouchPanel....struct alsps_hw { int i2c_num; //这是这个设备挂在主板的哪个i2c接口总线上,MT6571上有i2c0和i2c1 ,一般摄像头是使用i2c0,别的设备都共用i2c1,(挂那么多设备,i2c要有上拉电阻,2.2K左右驱动能力才够) /* the i2c bus used by ALS/PS */ int power_id; /*the VDD power id of the als chip */ int power_vol; /* the VDD power voltage of the als chip */int polling_mode; /* 1: polling mode ; 0:interrupt mode*/int polling_mode_ps; /* 1: polling mode ; 0:interrupt mode*/int polling_mode_als; /* 1: polling mode ; 0:interrupt mode*/ unsigned char i2c_addr[C_CUST_I2C_ADDR_NUM]; /*i2c address list, some chip will have multiple address */ //这个是设备的i2c地址,可能有多个,有这个设备能接收多个i2c地址,每个地址可能有相应的功能, 光感、距离、.... unsigned int als_level[C_CUST_ALS_LEVEL-1]; /* (C_CUST_ALS_LEVEL-1) levels divides all range into C_CUST_ALS_LEVEL levels*/ unsigned int als_value[C_CUST_ALS_LEVEL]; /* the value reported in each level */ unsigned int ps_threshold; /* the threshold of proximity sensor */}
增加的文件
alps\mediatek\custom\common\kernel\alsps\stk3x1x\stk3x1x.c stk3x1x.h
static struct platform_driver stk3x1x_alsps_driver = {.probe = stk3x1x_probe,.remove = stk3x1x_remove, .driver = {.name = "als_ps",#if (LINUX_VERSION_CODE<KERNEL_VERSION(3,0,0)).owner = THIS_MODULE,#endif}};/*----------------------------------------------------------------------------*/static int __init stk3x1x_init(void){#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3,0,0))struct alsps_hw *hw = get_cust_alsps_hw();APS_LOG("%s: i2c_number=%d\n", __func__,hw->i2c_num); i2c_register_board_info(hw->i2c_num, &i2c_stk3x1x, 1);#endifAPS_FUN();if(platform_driver_register(&stk3x1x_alsps_driver)){APS_ERR("failed to register driver");return -ENODEV;}return 0;}
alps\mediatek\custom\mt6571v1_phone_emmc\kernel\alsps\stk3x1x\cust_alsps.c
查设备挂在哪个总线上,就进入哪个总线上找,例如这个光感
root@android:/sys/devices/platform/mt-i2c.1/i2c-1 #cat 1-0048/name
stk3x1x
0 0
- MT6571 alps 光感 stk3x1x(光感als+距离传感器ps)
- 环境光传感器(ALS)背光控制解决方案
- 传感器-光感和指南针
- 光感传感器的使用demo
- mark----android光感距离感详解
- 光传感器和距离传感器TMD22713源代码执行过程分析
- 光传感器和距离传感器TMD22713源代码执行过程分析
- 光传感器和距离传感器TMD22713源代码执行过程分析
- 光传感器加速度传感器
- iOS 传感器之光感监测----微信扫一扫具有检测光感功能(一)
- iOS 传感器之光感监测----微信扫一扫具有检测光感功能(二)
- 基于NanoPi的光感传感器驱动开发
- 传感器---光传感
- Android 光传感器Light
- 光传感器~考虑因素
- ps光处理教程
- LTR558光感调试
- 光
- Java第十一课
- WIN7下vs2010滑轮滚动不正确的解决方法
- C#(或者说.NET/Mono)能做的那些事
- CRC校验
- 谈下一代企业和下一代技术
- MT6571 alps 光感 stk3x1x(光感als+距离传感器ps)
- 阿里云、腾讯云等云主机PK个人服务器应用dnspod、nat123网络辅助
- 转载:VC在一个工程中实现多语言版本
- spring3 mvc中 web.xml 加入 OpenSessionInView
- 海明码
- 第三方支付程序 点卡api支付程序 点卡消耗平台 支持多家接口源码
- C语言指向多维数组的指针
- 文件资源管理器及二进制
- js监听键盘动作之资源<二>