在网络上看到的一篇资料,分享给大家参考,
MT6577 Android驱动设置:
- LCD
1.1怎样新建一个LCD驱动
LCD模组主要包括LCD显示屏和驱动IC。比如LF040DNYB16a模组的驱动IC型号为NT35510。要在MT6577平台上新建这个lcd的驱动,步骤如下:
A. 新建文件夹nt35510:
\mediatek\custom\common\kernel\lcm\nt35510
\mediatek\custom\common\lk\lcm\nt35510 //\mediatek\custom\common\uboot\lcm\nt35510
B.修改\mediatek\custom\common\kernel\lcm\mt65xxlcmlist.c, 在lcmdriverlist [ lcmcount ] 中增加nt35510lcm_drv。
C.打开mediatek\config\ginwave73_gb\ProjectConfig.mk:
BUILDLK=yes //BUILDUBOOT=yes
BOOT_LOGO=wsvganl
CUSTOMKERNELLCM = nt35510
CUSTOMLKLCM= nt35510 // CUSTOMUBOOTLCM =nt35510
LCM_WIDTH=600
LCM_HEIGHT=1024
驱动文件移植原则:
根据具体平台,填充对应的函数,不能直接复制整个文件,避免不必要编译和接口错误。
1.3 LCD显示旋转(横竖屏旋转,关联到很多界面,需要统一修改)
方式一:横竖屏分辨率修改(还需要修改TP驱动):
LCM_WIDTH=1024
LCM_HEIGHT=600
方式二:lcm显示旋转,只需要修改:(还需要旋转camera驱动)
MTKLCMPHYSICAL_ROTATION=90
MTKTOUCHPHYSICALROTATIONRELATIVETOLCM=90
camera 旋转
Z:\jb2_131217\alps\mediatek\custom\hal\imgsensor\src\cfgsettingimgsensor.cpp
static SensorOrientation_T const inst = {
u4Degree_0 : 180,//90, // main sensor in degree (0, 90,180, 270)
u4Degree_1 : 0,//90, // sub sensor in degree (0, 90, 180, 270)
1.4 lcm参数修改
\mediatek\custom\common\kernel\lcm\rgb_mt8193
staticvoid lcmgetparams(LCM_PARAMS *params){}
lcd rgb频率:
//params->dpi.mipipllclk_ref =536870912;
params->dpi.mipipllclk_ref= (33.3(167772168*2))/26; //33.3MHz
//params->dpi.mipipllclk_ref= 536870912; //52.0MHz
colorformat 修改
params->dpi.format = LCMDPIFORMATRGB888; // format is 24 bit//LCMDPIFORMATRGB666
1.5 修改显示分辨率:
1.5.1配置修改:
打开mediatek\config\ginwave73_gb\ProjectConfig.mk:
LCM_WIDTH=600
LCM_HEIGHT=1024
Lk_logo= wsvganl 及相关logo文件修改
15.2 lcm驱动分辨率修改,可自行手动修改(注意横竖数值对应)
对应的lcm :\mediatek\custom\common\kernel\lcm\rgb_mt8193
defineFRAME_WIDTH (1024)
defineFRAME_HEIGHT (600)
15.3 tpsensor driver修改,对应分辨率驱动(fae sensor提供驱动代码)。
\alps\mediatek\custom\prj\kernel\touchpanel\GSLx680\GSLx680.h
defineSCREENMAXX 480
defineSCREENMAXY 800
- leds 配置
CUSTOMKERNELLEDS= mt65xx
mediatek\custom\prj\kernel\leds\mt65xx\cust_leds.c
mediatek\custom\prj\lk\cust_leds.c
static structcustmt65xxled custledlist[MT65XXLEDTYPE_TOTAL] = {
{"red",MT65XXLEDMODE_NONE, -1,{0}},
{"green",MT65XXLEDMODE_NONE, -1,{0}},
{"blue",MT65XXLEDMODE_NONE, -1,{0}},
{"jogball-backlight",MT65XXLEDMODE_NONE, -1,{0}},
{"keyboard-backlight",MT65XXLEDMODE_NONE,-1,{0}},
{"button-backlight", MT65XXLEDMODE_NONE, -1,{0}}, // modify
{"lcd-backlight",MT65XXLEDMODEPWM,PWM1,{PWMCLKNEWMODEBLOCK,CLKDIV128,4,4}}, //modify
//{"lcd-backlight",MT65XXLEDMODECUST,(int)DISPSetBacklight,{0}},
};
..\mediatek\platform\mt6582\kernel\drivers\leds\leds.c
mt65xxflashlighton(){}
mt65xxflashlightoff(){}
2.1 LED背光亮度修改:
mediatek\source\kernel\drivers\leds\leds.c
验证方式:adb shell查看:
shell@android:/sys/class/leds/lcd-backlight$ cat max_brightness
备注:MMI层最亮、最暗背光调节代码:
./config.xml:
20
\alps\frameworks\base\core\java\android\os\PowerManager.java:
private staticfinal int MAXIMUMBACKLIGHT = android.os.PowerManager.BRIGHTNESSON;
- Flash配置:
3.1 型号配置:
3.1.1 CUSTOMMEMORYHDR(需要确认是否是MTK认证的flash ic)
mediatek\custom\$(PROJECT)\preloader\inc\custom_MemoryDevice.h
defineBOARDID MT6577EVB
defineCSPARTNUMBER[0] H9TP32A4GDMCPR_KDM
defineCSPARTNUMBER[1] KMKUS000VM_B410
备注:新增flash ic添加到此处,flash可以做到兼容;不能兼容相同IC Id的memeory ic.
3.2 特定项目不同类型分区定义信息(是否定义、顺序):
mediatek\custom\kernel\core\src\partition.c
structpartnamemap gpartnamemap[PARTMAX_COUNT] = {
{"preloader", PART_PRELOADER, "rawdata", 0, 0, 0},
{"dsp_bl", PART_DSP_DL, "rawdata", 1, 0, 0},
{"mbr", PART_MBR, "raw data", 2, 1, 1},
{"ebr1", PART_EBR1, "raw data", 3, 1, 1},
{"pmt", PART_PMT, "raw data", 4, 0, 0},
{"nvram", PART_NVRAM, "rawdata", 5, 0, 0},
{"seccfg", PART_SECURE, "raw data", 6, 0, 0},
{"uboot", PART_UBOOT, "raw data", 7, 1, 1},
{"boot", PART_BOOTIMG, "raw data", 8, 1, 1},
{"recovery", PART_RECOVERY, "rawdata", 9, 1, 1},
{"sec_ro", PART_SECSTATIC, "ext4", 10, 0, 0},
{"misc", PART_MISC, "raw data", 11, 0, 0},
{"logo", PART_LOGO, "raw data", 12, 1, 1},
{"expdb", PART_APANIC, "raw data", 13, 0, 0},
{"system", PART_ANDSYSIMG, "ext4", 14, 1, 1},
{"cache", PART_CACHE, "ext4", 15, 1, 1},
{"userdata", PART_USER, "ext4", 16, 1, 1},
{"fat", PART_FAT, "fat", 17, 0, 0},
};
3.3 emmc scat 分区大小设置(emmc) :
可对emmc进行分区,修改preloader\systemimage\userdata\FAT等各个分区。
\alps\mediatek\build\tools\ptgen\MT6577\partitiontableMT6577.xls
备注:Cache分区需要保持在512mb左右,否则系统会比较慢,响应迟缓。
3.4 FLASH参数配置文件位置(MemoryDeviceList_MT6577.xls):
MEMORYDEVICEXLS =
mediatek\build\tools\emigen\$(MTKPLATFORM)\MemoryDeviceList$(MTK_PLATFORM).xls
.xls文件含三个页面:
MT6577(page one):配置Flash Vendor Id 对应的硬件参数。
NAND(page two):
emmc_region(pagethree)
3.5 Flash驱动电压修改,读写速度方式修改:
mediatek\custom\konka73_gb\kernel\core\src\board.c
struct msdc_hw msdc0_hw = {
.clk_src = 1,
.cmd_edge =MSDC_SMPL_FALLING,
.data_edge =MSDC_SMPL_FALLING,
.clk_drv = 5, //: 0 //memory驱动电压
.cmd_drv = 5, //: 0
.dat_drv = 5, // : 0
ifdefMTKEMMCSUPPORT
.data_pins = 8,
else
.data_pins = 4,
endif
.data_offset = 0,
ifdefMTKEMMCSUPPORT
.flags = MSDC_SYS_SUSPEND | MSDC_HIGHSPEED,//memory读写速度
// .flags = MSDC_SYS_SUSPEND | MSDC_HIGHSPEED |MSDC_UHS1 | MSDC_DDR,
//.flags = MSDC_SYS_SUSPEND,
else
.flags =MSDC_SDCARD_FLAG,
endif
3.6 emmc FAT分区划分:
emmc型号、emmc软件分区都会影响FAT分区的大小。
验证FAT Size需要对应emmc型号机器下载对应emmc软件分区的软件,不能预先下载FAT部分(影响实际FAT分区大小):
adb shell
cat /proc/emmc
cat /proc/partition获取大小。
4.GPIO/EINT/ADC/KEYPAD/PMIC 配置(根据原理图设计,可有原理硬件工程师指导填写即可):
4.1工具及dws文件位置:
mediatek\source\dct\DrvGen
mediatek\custom\$(PROJECT)\kernel\dct\dct\codegen.dws
4.2 dws配置文件位置:
.\mediatek\build\makemtk.mk
4.3 gpio设置方法:
mtsetgpiomode(GPIOCTPENPIN,GPIOCTPENPINM_GPIO);
mtsetgpiodir(GPIOCTPENPIN,GPIODIROUT); //GPIODIRIN);
mtsetgpioout(GPIOCTPENPIN,GPIOOUTZERO); // GPIOOUTONE);
5.keypad
5.1按键配置(根据原理图):DCT(Driver Customization Tool):
..\mediatek\custom\prj\kernel\dct\dct\codegen.dws
.. \mediatek\source\dct\DrvGen.exe
客制化:按键定义表、de-bounce time 、Power key Eint Gpio、DownLoadKey、|Mode Key、Factory Key、Recovery Key
5.2factory mode工厂模式按键定义
..\mediatek\custom\factory\inc\cust_keys.h
//工厂按键测试映射表,在.dws中配置按键映射表后自动生成
\alps\mediatek\custom\prj\kernel\dct\dct\cust_kpd.h
defineKEYSPWRKEYMAP { KEY_POWER,"Power" }
defineDEFINEKEYSKEYMAP(x) \
struct key x[] = { \
KEYS_PWRKEY_MAP, \
{ KEY_HOME, "Home" }, \
{ KEY_MENU, "Menu" }, \
{ KEY_HOMEPAGE, "HomePage" }, \
}
//工厂模式按键定义
define CUSTKEYUP KEY_UP
defineCUSTKEYVOLUP KEYPAGEUP // KEYVOLUMEUP
defineCUSTKEYDOWN KEY_DOWN
defineCUSTKEYVOLDOWN KEYVOLUMEDOWN // KEYVOLUMEDOWN
defineCUSTKEYLEFT KEY_MENU
defineCUSTKEYCENTER KEY_HOMEPAGE
define CUSTKEYRIGHT KEY_BACK
defineCUSTKEYCONFIRM KEYVOLUMEUP // KEYHOME
defineCUSTKEYBACK KEY_POWER
5.3 recoverymode恢复模式按键定义
\mediatek\custom\prj\recovery\inc\cust_keys.h
defineRECOVERYKEYDOWN KEY_VOLUMEDOWN
defineRECOVERYKEYUP KEY_VOLUMEDOWN
defineRECOVERYKEYENTER KEY_VOLUMEUP
defineRECOVERYKEYMENU KEY_POWER
5.4 home键配置(直接引出的,不需要在.dws中定义按键映射)
\alps\mediatek\custom\prj\kernel\kpd\kpd\mtk_kpd.h
defineKPDPMICRSTKEYMAP KEYHOME
home键添加唤醒功能
\alps\mediatek\config\prj\mtk-kpd.kl
key 102 HOME WAKE
6.PM 充电
6.1 配置文件位置:
CUSTOMKERNELBATTERY= battery
mediatek\custom\kernel\battery\battery\cust_battery.h
mediatek\custom\kernel\battery\battery\customfuelgauge.h
6.2充电常用参数修改:
..\mediatek\custom\kernel\battery\battery\cust_battery.h
6.2.1充电电流修改:
defineUSBCHARGERCURRENT CustCC550MA // :CustCC450MA
define ACCHARGERCURRENT CustCC800MA // : CustCC650MA
6.2.2.充电电阻设定(根据硬件的bom):
defineRCURRENTSENSE 2 //0.2 Ohm// 0.2欧姆
6.2.3 充电温度检测设定
defineBATTEMPPROTECT_ENABLE 1 //
// #defineBATNTCTSM_1
NTC修改为10K电阻或者47K电阻(NTC 为电池温度保护NegativeTemperature Coefficient)
define BATNTC101 //#define BATNTC47 0
其他:
defineVCHARGERMIN 4400 //modify //4400 // 4.4 V
defineVCHARGERENABLE 1 //1:ON , 0:OFF //
6.7充电界面显示修改:
\mediatek\custom\lk\include\target\cust_display.h//坐标
\mediatek\platform\mt6577\lk\mt_logo.c//显示
6.8 电池容量、电池曲线修改:
电池容量修改:
mediatek\custom\kernel\battery\battery\customfuelgauge.h
define QMAXPOS_50 ((2168* 1316) / 1307)
define QMAXPOS_25 2168
define QMAXPOS_0 ((2168 * 1220) / 1307)
define QMAXNEG_10 ((2168 * 1162) / 1307)
define QMAXPOS50H_CURRENT ((2168 * 1295) / 1307)
define QMAXPOS25H_CURRENT ((2168 * 1270) / 1307)
define QMAXPOS0H_CURRENT ((2168 * 1102) / 1307)
define QMAXNEG10H_CURRENT ((2168 * 599) / 1307)
电池曲线集成方式:(电压-百分比对应表需要电池厂商提供)
mediatek\custom\kernel\battery\battery\custfuelgauge.h
BATTERYPROFILESTRUCbatteryprofilet1[] =// T1 0C
BATTERYPROFILESTRUCbatteryprofilet2[] =// T2 25C
7.camera
7.1 相关代码位置:
mediatek\config\XXXX(红色字为具体的项目名)
文件:ProjectConfig.mk
CUSTOMKERNELIMGSENSOR = …… gc2235_raw
CUSTOMKERNELMAINIMGSENSOR = …… gc2235raw
CUSTOMHALIMGSENSOR = …… gc2235_raw
CUSTOMHALMAINIMGSENSOR = …… gc2235raw
kernel:
\mediatek\custom\common\kernel\imgsensor\gc2235_raw
mediatek\custom\common\kernel\imgsensor\src
文件:kd_sensorlist.h
添加内容:
UINT32 GC2235SensorInit(PSENSORFUNCTIONSTRUCT *pfFunc);
ACDKKDSENSORINITFUNCTION_STRUCT
kdSensorList[MAXNUMOFSUPPORTSENSOR+1] =
{
if defined(GC2235_RAW)
{GC2235_SENSOR_ID, SENSOR_DRVNAME_GC2235_RAW, GC2235SensorInit},
endif
};
mediatek\custom\common\kernel\imgsensor\inc
文件:kd_imgsensor.h
添加内容:
define GC2235SENSORID 0x2235
define SENSORDRVNAMEGC2235_RAW "gc2235"
hal
\mediatek\custom\common\hal\imgsensor\gc2235_raw
mediatek\custom\common\hal\imgsensor\src
文件:sensorlist.cpp
添加内容:
MSDKSENSORINITFUNCTIONSTRUCT SensorList[] =
{
…………
if defined(GC2235_RAW)
RAWINFO(GC2235SENSORID, SENSORDRVNAMEGC2235RAW, NULL),
endif
…………
};
注意:在 kdSensorList 和 SensorList里面添加驱动的时候要注意,Sensor添加的位置要一样。否则驱动会跑乱,轻则 ISP参数不对,重则 Sensor 无法启动。
7.2 拍照图片尺寸设置:
..\mediatek\custom\hal\camera\camera\cfgftbl$prj$rawmain.h
//Capture Size
CONFIGFEATURE(FIDCAP_SIZE,
BY_DEFAULT(CAPTURE_SIZE_1600_1200),
CAPTURE_SIZE_640_480,
CAPTURE_SIZE_1280_960,CAPTURE_SIZE_1600_1200,
)
7.3 Camera物理角度旋转
90度:
\alps\mediatek\custom\$prj$\hal\imgsensor\src\cfgsettingimgsensor.cpp
static SensorOrientation_T const inst = {
u4Degree_0 : 180,//90, // main sensor in degree (0, 90,180, 270)
u4Degree_1 : 0,//90, // sub sensor in degree (0, 90, 180, 270)
180度:
Sensor FAE提供修改方法。
7.4Camera 相同sensor id兼容方式(前后sensor id一致):
//配置区分:
CUSTOMKERNELIMGSENSOR = gc0308yuv# gc0308sub_yuv
CUSTOMKERNELMAINIMGSENSOR =gc0308yuv # gc0308subyuv
CUSTOMHALIMGSENSOR = gc0308yuv# gc0308sub_yuv
CUSTOMHALMAINIMGSENSOR = gc0308yuv# gc0308subyuv
//kernel:函数名也要区分
\alps\mediatek\custom\common\kernel\imgsensor\gc0308subyuv
\alps\mediatek\custom\common\kernel\imgsensor\gc0308_yuv
//hal: 函数名也要区分
\alps\mediatek\custom\common\hal\imgsensor\gc0308subyuv
\alps\mediatek\custom\common\hal\imgsensor\gc0308_yuv
//kdSensorList 和 SensorList里面添加驱动也要区分,sensor id不要区分,写成一致,根据前后摄像头开关代码区分。
define GC0328SENSORID 0x009D
defineGC0328SUBSENSOR_ID 0x9D9D
\alps\mediatek\custom\common\kernel\imgsensor\gc0328frontyuv_Sensor.c
GC0328_FRONTGetSensorID(){
if (sensorid == GC0328SENSOR_ID) {
sensorid = GC0328FRONTSENSORID; //---lcz
break;
}
if(sensorid != GC0328FRONTSENSORID) //---lcz
{
return ERROR_SENSOR_CONNECT_FAIL;
}
}
GC0328_FRONTOpen(){
if (sensorid == GC0328SENSOR_ID) {
sensorid = GC0328FRONTSENSORID; //---lcz
break;
}
if(sensorid != GC0328FRONTSENSORID) {
return ERROR_SENSOR_CONNECT_FAIL;
}
}
- Voice coil motor摄像头上的自动调焦音圈马达
CUSTOMHALLENS =dummylens dummylens
CUSTOMKERNELLENS= dummylens dummylens
CUSTOMHALMAINLENS= dummylens
CUSTOMHALMAINBACKUPLENS=
CUSTOMHALSUBLENS= dummylens
CUSTOMHALSUBBACKUPLENS=
CUSTOMKERNELMAINLENS= dummylens
CUSTOMKERNELMAINBACKUPLENS=
CUSTOMKERNELSUBLENS= dummylens
CUSTOMKERNELSUBBACKUPLENS=
mediatek\custom\common\kernel\lens\dummylens\dummylens.c
- TouchPanel
10.1配置
CUSTOMKERNELTOUCHPANEL= gt818b
..\mediatek\custom\common\kernel\touchpanel\src\mtk_tpd.c
..\mediatek\custom\common\kernel\touchpanel\gt818b
moduleinit(tpddriver_init);
moduleexit(tpddriver_exit);
tpddriveradd(&tpddevicedriver);
tpddriverremove(&tpddevicedriver);
10.2 TP原点由IC商现场调试后释放方案设计公司。
10.3 引脚定义
复位脚、中断、I2C
10.4 物理概念
T+G 双层玻璃
P+G 单层玻璃
10.5 TP实现距离感应功能宏开关:
mediatek\custom\common\kernel\touchpanel\gslX680\ gslX680_driver.c
//#defineTPDPSSUPPORT
11 震动马达
CUSTOMKERNELVIBRATOR=vibrator
a.马达震动幅度(MT6582及其他最新平台):
..\mediatek\custom\kernel\vibrator\cust_vibrator.c
static structvibratorhw custvibrator_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
voidPMICCUSTOMSETTING_V1(void) {}
ret=pmicconfiginterface(BANK0DIGLDOCON33,0x3,
BANK0RGVIBRVOSELMASK,BANK0RGVIBRVOSELSHIFT);//0x4
- RTC
12.1配置文件位置:
CUSTOMKERNELRTC =rtc
mediatek\custom\konka73_gb\kernel\rtc\rtc\rtc-mt6573.h
mediatek\platform\mt6573\kernel\drivers\rtc\mtk_rtc.c
12.2. RTC默认日期
\alps\mediatek\custom[project]\preloader\inc\cust_rtc.h
\alps\mediatek\custom[project]\kernel\rtc\rtc\rtc-mt65XX.h
defineRTCDEFAULTYEA 2013//2010//cbk..default.date.2013.07.12
defineRTCDEFAULTMTH 7// 1ff
- wifi
CUSTOMKERNELWIFI=
MTKSCREENOFFWIFIOFF= no
MTKWIFIP2P_SUPPORT= yes
MTKWIFIHOTSPOT_SUPPORT= yes
mediatek\custom\common\kernel\wifi\mt592x\dummy.c
14.. HEADSET
CUSTOMKERNELHEADSET= accdet
MTKHEADSETICON_SUPPORT= yes
mediatek\custom\konka73gb\kernel\headset\accdet\accdetcustom.h
14 SIM
14.1双卡、单卡版本切换:
Double SIM
GEMINI = yes
MTKGEMINIENHANCEMENT= yes
MTKSHAREMODEM_SUPPORT= 2
MTKSHAREMODEM_CURRENT= 2
Single SIM
GEMINI = no
MTKGEMINIENHANCEMENT= no
MTKSHAREMODEM_SUPPORT= 2
MTKSHAREMODEM_CURRENT= 1
14.2 simcard热插拔功能
MTKSIMHOT_SWAP=yes
MTKSIMHOTSWAPCOMMON_SLOT=yes
.dws配置方法(由原理图设计填写):
- 传感器
MTKSENSORSUPPORT= yes
CUSTOMKERNELACCELEROMETER= auto//重力加速度传感器
CUSTOMKERNELMAGNETOMETER=akm8975//磁力感应器//
CUSTOMKERNELALSPS= tmd2771//光感距离传感器
CUSTOMKERNELBAROMETER=//气压计
CUSTOMKERNELGYROSCOPE=//陀螺仪
16.1 重力加速度传感器(G-sensor感应器)
CUSTOMKERNELACCELEROMETER= auto//传感器
ifdefined(MTKAUTODETECT_ACCELEROMETER)
\mediatek\source\kernel\drivers\hwmon\hwmsen\Hwmsen_dev.c
inthwmsengsensoradd(struct sensorinitinfo* obj)
\mediatek\custom\common\kernel\accelerometer\auto\
重力传感方向设置:
\alps\mediatek\custom\kernel\accelerometer\mc3210\cust_acc.c
static structacchw custacc_hw = {
.i2c_num = 2,
.direction = 5, // modify//重力传感方向
16.2 ALS\PS 光感距离传感器
CUSTOMKERNELALSPS= 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 陀螺仪
CUSTOMKERNELGYROSCOPE= l3g4200d
mediatek\custom\common\kernel\gyroscope\l3g4200d\l3g4200d.c
mediatek\custom\prj\kernel\gyroscope\l3g4200d\cust_gyro.c
16.4BAROMETER-sensor 气压计
CUSTOMKERNELBAROMETER= 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 structmaghw custmag_hw = {
.i2c_num = 2,
.direction = 3,//磁感应方向//参照规格书
.power_id = MT65XX_POWER_NONE,
.power_vol= VOL_DEFAULT,
};
16.6 compass 指南针
CUSTOMKERNELMAGNETOMETER= akm8975
mediatek\custom\common\kernel\magnetometer\akm8975\akm8975.c
mediatek\custom\konka73gb\kernel\magnetometer\akm8975\custmag.c
- flashlight
CUSTOMHALFLASHLIGHT= dummy_flashlight
CUSTOMKERNELFLASHLIGHT= dummy_flashlight
闪光灯类型:
constant_flashlight 补光灯(camera闪光灯)
peak_flashlight
torch_flashlight 手电筒
dummy_flashlight
备注:camera闪光灯与camera驱动无关,只需要打开开关,这是由MTK开发的独立功能。
mediatek\custom\common\kernel\flashlight\dummyflashlight\dummyflashlight.c
mediatek\custom\common\kernel\flashlight\src\kd_flashlightlist.c
mediatek\custom\common\kernel\flashlight\
17.1 LED闪光灯配置为手电筒模式:???
- jogball 轨迹球
CUSTOMKERNELJOGBALL=
mediatek\custom\common\kernel\jogball\
- atv
CUSTOMHALMATV =
CUSTOMKERNELMATV=
HAVEMATVFEATURE=yes#no #Armin
MTKATVCHIP=MTK_MT5193 # Armin
MTKMATVANALOG_SUPPORT=yes#no//模拟通道、数字通道切换功能开关
mediatek\custom\common\kernel\matv\mt5193\matv.c
- sound
MTKSOUNDRECORDERAPP= yes
CUSTOMKERNELSOUND= speaker
mediatek\custom\common\kernel\sound\inc\yusuandroidspeaker.h
mediatek\custom\konka73gb\kernel\sound\speaker\yusuandroid_speaker.c
- USB
CUSTOMKERNELUSB =mt6577
mediatek\custom\common\kernel\usb\src\Makefile
mediatek\custom\mt6573\kernel\usb\src\mtkusbcustom.c
mediatek\custom\mt6573\kernel\usb\src\mtkusbcustom.h
mediatek\custom\mt6573\uboot\inc\cust_sdc.h
mediatek\platform\mt6573\kernel\drivers\usb-gadget\
mediatek\platform\mt6573\kernel\drivers\power\
20.1 USB OTG功能(终端连接外接U盘)
alps/mediatek/config/{project}/autoconfig/kconfig/project中打开
CONFIGUSBMTK_OTG=y
CONFIGUSBMTKHDRCHCD= y
20.2 MTP(MediaTransfer Protocol)
USB连接设备,可选存储方式介绍:
USB存储设备、MTP(媒体设备)、PTP(相机)、只充电、内置光盘。
- BT
MTKWLANCHIP =MT6620 # candidate settings: MT6620
MTKBTCHIP =MTKMT6620 # candidate settings:MTKMT6611\MTKMT6612\MTKMT6616\MTK_MT6620
MTKWLANSUPPORT =yes
MTKBTSUPPORT = yes
MTKWLANSUPPORT =yes
MTKWLANBTSINGLEANT= no
MTKBT30HSSUPPORT= yes
config BTfeature
please do notmodify these options
MTKBT21_SUPPORT =yes
MTKBT30_SUPPORT =yes
MTKBT40_SUPPORT =yes
MTKBTFMOVERBTVIACONTROLLER= yes
MTKBTPROFILE_OPP= yes
MTKBTPROFILE_SIMAP= yes
MTKBTPROFILE_PRXM= yes//蓝牙距离感应装置
MTKBTPROFILE_PRXR= yes//蓝牙距离感应装置
MTKBTPROFILE_HIDH= yes//无线输入设备
MTKBTPROFILE_FTP= yes
MTKBTPROFILE_PBAP= yes
MTKBTPROFILE_MANAGER= yes
MTKBTPROFILE_BPP= yes
MTKBTPROFILE_BIP= yes
MTKBTPROFILE_DUN= yes
MTKBTPROFILE_PAN= yes
MTKBTPROFILE_HFP= yes
MTKBTPROFILE_A2DP= yes
MTKBTPROFILE_AVRCP= yes
MTKBTPROFILE_AVRCP14= yes
MTKBTPROFILE_TIMEC= no
MTKBTPROFILE_TIMES= no
MTKBTPROFILE_MAPS= no
MTKBTPROFILE_MAPC= no
MTKBTPROFILE_SPP= yes
config BTfeature end
mediatek\custom\common\kernel\btwlanem\btwlanem\btwlanem.c
- FM
MTKFMCHIP =MT6620_FM
MTKFMSUPPORT =yes
MTKFMTX_SUPPORT =yes
MTKFMAUDIO =FMANALOGINPUT
FMDIGITALINPUT
mediatek\custom\common\kernel\fm\mt6620\dummy.c
- OFN 光学手指鼠标
CUSTOMKERNELOFN =ofn1090
mediatek\custom\common\kernel\ofn\inc
mediatek\custom\konka73gb\kernel\ofn\ofn1090\custofn.c
26.modem
3g: \modem\make\PRJ_HSPA.mak
2g: \modem\make\PRJ_GPRS.mak
26.1modem模块位置及组成
配置文件位置:\prj\modem\make\PRJ_HSPA.mak
工程名称配置:BOARDVER = PRJBB
26.2 modem源码工程编译(../prj/modem)
./make.shPRJ_HSPA.mak new
26.3 modem文件修改:
RF模块名配置:(安装项目区分定义文件夹名称)
\prj\modem\make\PRJ_HSPA.mak
GSM射频模块:RFMODULE = MT6162CUSTOM
3G射频模块:UMTSRFMODULE = CUSTOM_MT6162
射频参数配置:
GSM射频参数:
\prj\modem\custom\l1rf\MT6162CUSTOM\m12193.c
\prj\modem\custom\l1rf\MT6162CUSTOM\l1dcustomrf.h
\prj\modem\custom\l1rf\MT6162CUSTOM\l1dcustomrf_.h
\prj\modem\custom\l1rf\MT6162CUSTOM\l1dcustomrf_.h
3G射频参数:
\prj\modem\custom\ul1rf\CUSTOMMT6162\u12193.c
\prj\modem\custom\ul1rf\CUSTOMMT6162\ul1dcustomrf.h
\prj\modem\custom\ul1rf\CUSTOMMT6162\ul1dcustomrf_.h
\prj\modem\custom\ul1rf\CUSTOMMT6162\ul1dcustomrf_.h
26.4 编译好文件修改名称并拷贝:
\modem\build_PRJ\DEFAULT\bin:
DbgInfoWR8.W1315.MD.WG.MPPRJMOLYWR8W1315MDWGMPV15201312101150PRJ.mak
PRJPCB01MT6582_S00.elf
PRJPCB01MT6582S00.MOLYWR8W1315MDWGMP_V15.bin
\modem\build_PRJ\DEFAULT\tst\database
BPLGUInfoCustomAppSrcPMT6582S00MOLYWR8W1315MDWGMP_V15
catcher_filter.bin
修改名称,分别修改为:
DbgInfoWR8.W1315.MD.WG.MPPRJMOLYWR8W1315MDWGMPV152013121011501wgn
modem1wg_n.mak
PRJPCB01MT6582S001wgn.elf
modem1wg_n.img
BPLGUInfoCustomAppSrcPMT6582S00MOLYWR8W1315MDWGMPV151wgn
catcherfilter1wgn.bin
26.5 modem库替换编译(..prj/alps/mediate/custom/common/modem)
CUSTOMMODEM=YOURMODEM
此编译表示:已将在modem源码工程中编译好的镜像放入MTKAndroid 工程中后,存放位置:
./mediatek/custom/common/modem/YOUR_MODEM
执行如下编译命令:./mk update-modem,这个命令会依次做如下步骤:
- custgen 2. check modem 3. sign modem 4.update modem
gmodemband2 band7调换:
\modem\custom\modem\ul1rf_PCBV1P1PAAIRB1258\ul1dcustom_rf.h
define PDATABAND2PR1 0x0007
define PDATABAND2PR2 0x0007
define PDATABAND2PR2B 0x0007
define PDATABAND2PR3 0x0000
define PDATABAND2PT1 0x0007
define PDATABAND2PT2 0x0107
define PDATABAND2PT2B 0x0107
define PDATABAND2PT3 0x0000
define PDATABAND5PR1 0x0002
define PDATABAND5PR2 0x0002
define PDATABAND5PR2B 0x0002
define PDATABAND5PR3 0x0000
define PDATABAND5PT1 0x0002
define PDATABAND5PT2 0x0202
define PDATABAND5PT2B 0x0202
射频频段
2G:850/900/1800/1900
3G:
Band1 –2100???(其他)
Band2 --
Band5 --
Band8 --
WCDMA B1+B8:主要是欧洲
Wcdma B1+B2+B5:南美
Wcdma B2+B4+B5:北美
29.SD卡
27.1热插拔功能
1,sd卡热插拔机制的实现需要软件和硬件同时配合才能实现。
2,在电路上,需要一根单独的检测pin脚,通过检测pin脚的高低电平来检测sd卡的插拔动作,并在dws中将其配置成上拉或下拉
3,软件上的配置主要就是在\mediatek\custom\kernel\core\src\board.c中,msdc1hw 结构体中的 flags 的 MSDCCDPINEN 和MSDC_REMOVABLE,这两个flag是热插拔的flag,如果不需要热插拔,请把这两个flag移除。
4,如果是低电平触发,将msdc1hw中的.cdlevel 设置成 MSDCCDLOW,否则设置成MSDCCDHIGH
备注:
(1),从hardware的角度,sd 卡槽中的CD 引脚与chip的EINT的某个脚连在一起,且chip内部会有上拉电阻。
(2),dct的配置如下:
注:EINT16使用的哪个GPIO,可以参考硬件hw_config.xls文档
30.module(四合一芯片:FM/BT/WIFI/GPS)MT6628、MT6620
CUSTOMHALCOMBO=mt6628
CUSTOMKERNELFM=mt6628
MTKBTCHIP=MTK_MT6628
MTKFMCHIP=MT6628_FM
MTKWLANCHIP=MT6628
MTKCOMBOCHIP=MT6628
MTKGPSCHIP=MTKGPSMT6628
31.音频参数集成(全部参数由硬件提供,直接合成)
参照:[FAQ09151][Audio Drv]各个音频参数的功能说明
30.1 ring/key/mic/fmr/speech/sidetone/media/matv分别normal/headset/handfree三个模式的不同音量等级修改:
\mediatek\custom\cgen\inc\audiovolumecustom_default.h//8个等级
\mediatek\custom\cgen\inc\audiover1volumecustomdefault.h//16个等级
30.2 med/speech音频参数修改:
\mediatek\custom\cgen\inc\medaudiodefault.h
\mediatek\custom\cgen\inc\sphcoeffdefault.h
30.3 voip音频参数修改:
\mediatek\custom\cgen\inc\audiovoipcustom.h