16. 传感器
MTK_SENSOR_SUPPORT= yes
CUSTOM_KERNEL_ACCELEROMETER= auto//重力加速度传感器
CUSTOM_KERNEL_MAGNETOMETER=akm8975//磁力感应器//
CUSTOM_KERNEL_ALSPS= tmd2771//光感距离传感器
CUSTOM_KERNEL_BAROMETER=//气压计
CUSTOM_KERNEL_GYROSCOPE=//陀螺仪
16.1 重力加速度传感器(G-sensor感应器)
CUSTOM_KERNEL_ACCELEROMETER= auto//传感器
#ifdefined(MTK_AUTO_DETECT_ACCELEROMETER)
\mediatek\source\kernel\drivers\hwmon\hwmsen\Hwmsen_dev.c
inthwmsen_gsensor_add(struct sensor_init_info* obj)
\mediatek\custom\common\kernel\accelerometer\auto\
重力传感方向设置:
\alps\mediatek\custom\\kernel\accelerometer\mc3210\cust_acc.c
static structacc_hw cust_acc_hw = {
.i2c_num = 2,
.direction = 5, // modify//重力传感方向
16.2 ALS\PS 光感距离传感器
CUSTOM_KERNEL_ALSPS= tmd2771
mediatek\custom\common\kernel\alsps\tmd2771\tmd2771.c
mediatek\custom\common\kernel\alsps\tmd2771\tmd2771.h
mediatek\custom\prj\kernel\alsps\tmd2771\cust_alsps.c
16.3 GYRO-sensormotion sensor 陀螺仪
CUSTOM_KERNEL_GYROSCOPE= l3g4200d
mediatek\custom\common\kernel\gyroscope\l3g4200d\l3g4200d.c
mediatek\custom\prj\kernel\gyroscope\l3g4200d\cust_gyro.c
16.4 BAROMETER-sensor气压计
CUSTOM_KERNEL_BAROMETER= ms5607
mediatek\custom\prj\kernel\barometer\ms5607\cust_baro.c
mediatek\custom\common\kernel\barometer\ms5607\ms5607.c
16.5 MAGNETOMETER 磁感应器
\alps\mediatek\custom\\kernel\magnetometer\yamaha532\cust_mag.c
磁感应方向设置:
static structmag_hw cust_mag_hw = {
.i2c_num = 2,
.direction = 3,//磁感应方向//参照规格书
.power_id = MT65XX_POWER_NONE, /*!< LDO is not used */
.power_vol= VOL_DEFAULT, /*!< LDO is not used */
};
16.6 compass 指南针
CUSTOM_KERNEL_MAGNETOMETER= akm8975
mediatek\custom\common\kernel\magnetometer\akm8975\akm8975.c
mediatek\custom\konka73_gb\kernel\magnetometer\akm8975\cust_mag.c
17. 震动马达
CUSTOM_KERNEL_VIBRATOR=vibrator
a.马达震动幅度(MT6582及其他最新平台):
..\mediatek\custom\\kernel\vibrator\cust_vibrator.c
static structvibrator_hw cust_vibrator_hw = {
.vib_timer = 80,//30, //振动时长
.vib_limit = 9,//振动??
.vib_vol = 0x5, //2.8V for vibr // :0x5//振动电压
};
b.马达震动幅度MT6577直接修改pmic驱动电压:
此文件可以修改各个gpio驱动电压:
\alps\mediatek\platform\mt6577\lk\mt_pmic.c
void PMIC_CUSTOM_SETTING_V1(void){}
ret=pmic_config_interface(BANK0_DIGLDO_CON33,0x3,
BANK_0_RG_VIBR_VOSEL_MASK,BANK_0_RG_VIBR_VOSEL_SHIFT);//0x4