ILITEK Mstar I2C TP ProgrammingGuide V1 0 - Eng
ILITEK Mstar I2C TP ProgrammingGuide V1 0 - Eng
ILITEK_Mstar TP IC
I2C Programming Guide
(For 10 Point Touch and Above)
Version: V1.0
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page ii of 45 Version: 2.0
2
ILI TP I C Programming Guide for 10 Point Touch and Above ILI TP
TABLE OF CONTENTS
REVISION HISTORY ........................................................................................................................................................ ii
TABLE OF CONTENTS ....................................................................................................................................................iii
1. Introduction ............................................................................................................................................................. 4
1.1. PURPOSE .............................................................................................................................................................................. 4
2. Function Statement ................................................................................................................................................ 5
2.1. ILITEK_DRV_COMMON.H ...................................................................................................................................................... 5
2.1.1 Compile Option ........................................................................................................................................................... 5
2.1.2 Constant Value .......................................................................................................................................................... 10
2.1.3 Enumeration Value .................................................................................................................................................... 18
2.2. ILITEK_DRV_UPDATE.C ...................................................................................................................................................... 21
2.3. ILITEK_DRV_MAIN.C .......................................................................................................................................................... 23
2.3.1 Function .................................................................................................................................................................... 23
2.4. ILITEK_DRV _MP_TEST.H & ILITEK_DRV _MP_TEST.C ......................................................................................................... 32
2.4.1 Constant Value .......................................................................................................................................................... 32
2.4.2 Function .................................................................................................................................................................... 33
2.5. MTK HOTKNOT ................................................................................................................................................................. 34
2.5.1 Hotknot Commands ................................................................................................................................................... 34
2.5.2 Hotknot Authentication Command ............................................................................................................................ 34
2.5.3 Hotknot Control/Transmitting command ................................................................................................................... 34
2.5.4 Hotknot Receiving command..................................................................................................................................... 35
2.5.5 Hotknot Shared library.............................................................................................................................................. 35
2.5.6 How to verify Hotknot procotol ................................................................................................................................. 35
2.5.7 Hotknot comprehensive verification .......................................................................................................................... 36
2.5.8 The stage of verification for Hotknot functions ......................................................................................................... 37
2.5.9 Pseudo Hotknot firmware.......................................................................................................................................... 37
2.6. ILITEK_DRV_SPRD.C ........................................................................................................................................................... 37
2.6.1 How to Register ILITEK/MStar Touch IC ................................................................................................................. 37
2.6.2 How to Compile ILITEK/MStar Touch Device Driver Code ..................................................................................... 38
2.7. ILITEK_DRV_QCOM.C ......................................................................................................................................................... 38
2.7.1 How to Register ILITEK/MStar Touch IC ................................................................................................................. 38
2.7.2 How to Compile ILITEK/MStar Touch Device Driver Code ..................................................................................... 38
2.8. ILITEK_DRV_MTK.C............................................................................................................................................................ 39
2.8.1 How to Register ILITEK/MStar Touch IC ................................................................................................................. 39
2.8.2 How to Compile ILITEK/MStar Touch Device Driver Code ..................................................................................... 39
3. Trouble Shooting .................................................................................................................................................. 40
3.1. THE LIMITATION FOR I2C READ/WRITE IN MTK PLATFORM ............................................................................................... 40
3.2. THE EFFICIENCY OF FINGER TOUCH REPORTS NOT WELL..................................................................................................... 40
3.3. TOUCH PANEL IS NOT WORKING ......................................................................................................................................... 40
3.3.1 Does Touch IC power on ? ........................................................................................................................................ 40
3.3.2 Check I2C Bus ID and I2C slave address all correct ................................................................................................ 42
3.3.3 Check INT Pin and Rest Ping all correct .................................................................................................................. 43
3.4. THE PROBLEM OF COMMUNICATION BETWEEN DRIVER AND TOUCH IC .............................................................................. 43
3.4.1 Does Touch IC power on ........................................................................................................................................... 43
3.4.2 The I2C Slave addres of DBBUS is correct ............................................................................................................... 45
3.5. THE PROBLEM OF BUILDING KERNEL IN MTK PLATFORM .................................................................................................. 45
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page iii of 45 Version: 2.0
2
ILI TP I C Programming Guide ILI TP
1. Introduction
1.1. Purpose
Since the Touch ICs made by ILITEK/Mstar have been widely used on the variety of developement
platforms (MTK/QCOM/SPRD), reduing the time for spending integrations and verifications of Touch
ICs is much more important for the FAE colleagues and customers. To do so, the device driver version
of v6.0.0.0 not only eases its complexity, but also expands its flexibilities. The latest version is able to
support ILITEK’s mutual-capacitance Touch ICs (ILI212x/ILI211xA), Mstar’s mutual-capacitance
Touch ICs (MSG26xxM/MSG28xx/MSG58xx) and self-capacitance Touch IC (MSG22xx) on the
main three various developing plaforms (MTK/QCOM/SPRD). This document explains definiations
of Touch Device Driver and discusses the use of its functions in details.
Note :
1. The document only focuses on the version of v6.0.0.0 upward, excluding older versions.
2. MTK, QCOM and SPRK stand for MediaTek Inc, Qualcoomm International, Inc and Spreadtrum
Communication Inc.
3. The FAE colleagues and customers who are porting or verifying the Touch Device Driver should
directly refer to the Capter 2.1. Additionally, based on the different development platforms, they may
also refer to the Capter 2.6, 2.7 and 2.8.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 4 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2. Function Statement
2.1. ilitek_drv_common.h
The entire code in Touch Device Dirver, shared Compile Option, function and constant values are all
defined in the head file named ilitek_drv_common.h, which includes ILITEK’s mutual-capacitance
Touch ICs (ILI212x/ILI211xA), Mstar’s mutual-capacitance Touch ICs
(MSG26xxM/MSG28xx/MSG58xx) and Mstar’s self-capacitance Touch ICs
(MSG21xxA/MSG22xx).
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 5 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.1.1.4. #define CONFIG_ENABLE_REGULATOR _POWER_ON
The compile option wraps a specific function called DrvTouchDeviceRegulatorPowerOn, which is
used to supply power to Touch IC for some specific BB chips, such as SC7715 (SPRD), MSM8610
(QCOM) and MT6582 (MTK). If there is a situation that the Touch IC can not get power while
integrating ILITES/Mstar’s Touch Device Driver, please check with customers to see if need to enable
the above compile option, or even modify the method of power supply in the function if required.
#ifdef CONFIG_USE_IRQ_INTERRUPT_FOR_MTK_PLATFORM
/* initialize the finger touch work queue */
INIT_WORK(&_gFingerTouchWork, _DrvFingerTouchDoWork);
#else
_gThread = kthread_run(_DrvFingerTouchHandler, 0, TPD_DEVICE);
if (IS_ERR(_gThread))
{
nRetVal = PTR_ERR(_gThread);
DBG(&g_I2cClient->dev, "Failed to create kernel thread: %d\n", nRetVal);
}
#endif //CONFIG_USE_IRQ_INTERRUPT_FOR_MTK_PLATFORM
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 6 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
TP firmware (or Touch IC). The DMA mode is used to resolve the I2C read/write 8 Byte limitation for
some specific MTK BB chips (MT6572/MT6582/MT6589). This compile option is disabled by
default.
Note that if you are wondering how uses the tools or gets related docuements and instructions, please
ask for a help to ILITEK/Mstart FAE members.
DCC provides two different versions of instruction of gesture wakeup for FAE memebers
(ilitek/mstar_ctp_手勢喚醒功能規格說明_internal.pdf) and customers (ilitek/mstar_ctp_手勢喚醒
功能規格說明_customer.pdf). Please apply for the doucments with them for more details if necessary.
DCC provides two different versions of instruction of MP Test for FAE memebers
(ilitek/mstar_ctp_phone_level_mp_test_user_guideline_internal.pdf) and customers
(ilitek/mstar_ctp_phone_level_mp_test_user_guideline_customer.pdf). Please apply for the documents
with them for more details if necessary.
DCC provides the instruction of SW ID operation only for MSG22xx and MSG28xx to FAE
memebers. Please apply for the document (ilitek/mstar_ctp_sw_id_user_guideline.pdf ) with them if
necessary.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 10 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
#define CHIP_TYPE_ILI2118A (0x2118) // EX. ILI2118A
#define CHIP_TYPE_ILI2121 (0x2121) // EX. ILI2121
#define CHIP_TYPE_ILI2120 (0x2120) // EX. ILI2120
The constant values define Chip ID in each ILITEK/MStar mutual-capactivie Touch IC. Touch Device
Drive gets a specific Chip ID by calling the function DrvGetChipType(). The different Chip IDs will
have different handling methods in Touch Device Driver. You are not expected to modify the constant
values.
The constant values define the width and height of a touch panel, which sould be modified depending
on the size of panel that customers use.
The constant value is used to set an authority of procfs used to communicate with APK from Touch
Device Driver. The default value of 0666 means that it has the authority to read/write the proc node.
#ifdef CONFIG_SUPPORT_64_TYPES_GESTURE_WAKEUP_MODE
#define GESTURE_WAKEUP_MODE_RESERVE4_FLAG 0x00010000 //0000 0000 0000 0001
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE5_FLAG 0x00020000 //0000 0000 0000 0010
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE6_FLAG 0x00040000 //0000 0000 0000 0100
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE7_FLAG 0x00080000 //0000 0000 0000 1000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE8_FLAG 0x00100000 //0000 0000 0001 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE9_FLAG 0x00200000 //0000 0000 0010 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE10_FLAG 0x00400000 //0000 0000 0100 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE11_FLAG 0x00800000 //0000 0000 1000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE12_FLAG 0x01000000 //0000 0001 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE13_FLAG 0x02000000 //0000 0010 0000 0000
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 12 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE14_FLAG 0x04000000 //0000 0100 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE15_FLAG 0x08000000 //0000 1000 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE16_FLAG 0x10000000 //0001 0000 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE17_FLAG 0x20000000 //0010 0000 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE18_FLAG 0x40000000 //0100 0000 0000 0000
0000 0000 0000 0000
#define GESTURE_WAKEUP_MODE_RESERVE19_FLAG 0x80000000 //1000 0000 0000 0000
0000 0000 0000 0000
At the beginning, there are13 types of gesture wakeup mode been defined for ILITEK/Mstar touch ICs
(double click, up direct, down direct, left direct, right direct, m~z character etc.). There also define 64
types of gesture wakeup mode if the compile option
CONFIG_SUPPORT_64_TYPES_GESTURE_WAKEUP_MODE is enabled. The constant value
named GESTURE_WAKEUP_PACKET_LENGTH at the last line is for MSG22xx and MSG28xx TP
firmware, which use the packet format of 0xA7 to report gesture information to Touch Device Driver.
The length of gesture wakeup packet is fixed as 6 Byte.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 15 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.1.2.5. Packet Type for 0xA7 Packet
#define PACKET_TYPE_TOOTH_PATTERN (0x20)
#define PACKET_TYPE_GESTURE_WAKEUP (0x50)
#define PACKET_TYPE_GESTURE_DEBUG (0x51)
#define PACKET_TYPE_GESTURE_INFORMATION (0x52)
#define PACKET_TYPE_ESD_CHECK_HW_RESET (0x60)
These constant values are packet types of 0xA7 packet used to report information to Touch Device
Driver from TP firmware. Given the returned packet type, Touch Device Driver can be able to
recognize of which one is sent by TP Firmware. Do not modify the constant values.
The constant value is to define how many numbers of register you can use for debugging. In this case,
there are 10 registers you can type with bank and address for reading a value of the register on Touch
IC through ADB commands.
The constant value is to define how much size of temp data buffer is used to update TP Firmware. The
size of buffer must be large enough to store different firmware size in the different need of Touch ICs.
Do not modify this constant value.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 16 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
#define BIT11 (1<<11) // 0x0800
#define BIT12 (1<<12) // 0x1000
#define BIT13 (1<<13) // 0x2000
#define BIT14 (1<<14) // 0x4000
#define BIT15 (1<<15) // 0x8000
The constant values define common values from Bit 0 to Bit 15. Do not modify these constant values.
The flag is used to enable a function outputting Kernel log while Touch Device Driver is running.
Usually it will be used to debug effectively at the stage of development, and close it when the stage
completes. This flat is enabled by default.
The constant value is to define how many numbers of fingers support on mutual-capacity Touch ICs at
the same time. Do not modify this value.
// for MSG28xx/MSG58xx/MSG58xxA/ILI211xA
#define MSG28XX_FIRMWARE_MAIN_BLOCK_SIZE (128) //128K
#define MSG28XX_FIRMWARE_INFO_BLOCK_SIZE (2) //2K
#define MSG28XX_FIRMWARE_WHOLE_SIZE
(MSG28XX_FIRMWARE_MAIN_BLOCK_SIZE+MSG28XX_FIRMWARE_INFO_BLOCK_SIZE) //130K
#define ILITEK_ILI21XX_FIRMWARE_SIZE (160) // 160KB. The xxx.hex file size of ILI212X shall be smaller
than 160KB.
The constant values define the size of TP firmware for ILITEK’s mutual-capacitive
(ILI212x/ILI211xA), Mstar’s mutual-capacitive (MSG28xx/MSG58xx/MSG58xxA) and
self-capacitive (MSG22xx). The size is fixed and unchanged so do not modify it.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 17 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.1.2.12. Firmware Mode
#define MSG22XX_FIRMWARE_MODE_DEMO_MODE (0x00)
#define MSG22XX_FIRMWARE_MODE_DEBUG_MODE (0x01)
#define MSG22XX_FIRMWARE_MODE_RAW_DATA_MODE (0x02)
The constant values define Firmware mode for ILITEK’s mutual-capacitive (ILI212x/ILI211xA),
Mstar’s mutual-capacitive (MSG28xx/MSG58xx/MSG58xxA) and self-capacitive (MSG22xx). Each
value is fixed and unchanged so do not modify it.
2.1.2.13. SW ID
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
#define UPDATE_FIRMWARE_RETRY_COUNT (2)
#endif //CONFIG_UPDATE_FIRMWARE_BY_SW_ID
The constant value is to define retry count while updating TP firmware via SW ID mechanism at
power on stage. Changing the value depends on customer’s requirement.
2.1.3.1. SW ID
* Note.
* The following is sw id enum definition for MSG22XX.
* 0x0000 and 0xFFFF are not allowed to be defined as SW ID.
* SW_ID_UNDEFINED is a reserved enum value, do not delete it or modify it.
* Please modify the SW ID of the below enum value depends on the TP vendor that you are using.
*/
typedef enum {
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 18 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
MSG22XX_SW_ID_XXXX = 0x0001,
MSG22XX_SW_ID_YYYY = 0x0002,
MSG22XX_SW_ID_UNDEFINED = 0xFFFF
} Msg22xxSwId_e;
/*
* Note.
* The following is sw id enum definition for MSG28XX/MSG58XX/MSG58XXA/ILI2117A/ILI2118A.
* 0x0000 and 0xFFFF are not allowed to be defined as SW ID.
* SW_ID_UNDEFINED is a reserved enum value, do not delete it or modify it.
* Please modify the SW ID of the below enum value depends on the TP vendor that you are using.
*/
typedef enum {
MSG28XX_SW_ID_XXXX = 0x0001,
MSG28XX_SW_ID_YYYY = 0x0002,
MSG28XX_SW_ID_UNDEFINED = 0xFFFF
} Msg28xxSwId_e;
#endif //CONFIG_UPDATE_FIRMWARE_BY_SW_ID
#ifdef CONFIG_TP_HAVE_KEY
#define TOUCH_KEY_MENU (139) //229
#define TOUCH_KEY_HOME (172) //102
#define TOUCH_KEY_BACK (158)
#define TOUCH_KEY_SEARCH (217)
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 19 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
#define MAX_KEY_NUM (4)
#endif //CONFIG_TP_HAVE_KEY
If customers use SPRD platforms to develop products, please confirme with their engineers to set the
GPIO of INT and REST correctly. However, some BB Chips on SPRD platforms require Pin Control
mechanism to get them so that you need to enable the compile option
CONFIG_ENABLE_TOUCH_PIN_CONTROL in the specific situation. In addition, you are expected
to modify the definition of virtual key in Touch Device Driver as it is different with SPRD platform
that customers use.
#ifdef CONFIG_TP_HAVE_KEY
#define TOUCH_KEY_MENU (139) //229
#define TOUCH_KEY_HOME (172) //102
#define TOUCH_KEY_BACK (158)
#define TOUCH_KEY_SEARCH (217)
If customers use QCOM platforms to develop products, please confirme with their engineers to set the
GPIO of INT and REST correctly. However, some BB Chips on QCOM platforms require Pin Control
mechanism to get them so that you need to enable the compile option
CONFIG_ENABLE_TOUCH_PIN_CONTROL in the specific situation. In addition, you are expected
to modify the definition of virtual key in Touch Device Driver as it is different with QCOM platform
that customers use.
#ifdef CONFIG_TP_HAVE_KEY
#define TOUCH_KEY_MENU KEY_MENU
#define TOUCH_KEY_HOME KEY_HOMEPAGE
#define TOUCH_KEY_BACK KEY_BACK
#define TOUCH_KEY_SEARCH KEY_SEARCH
If customers use MTK platforms with Android 5.x downward to develop products, the GPIO of INT
and RESET might not require to be modified as usual. However, if the system is Android 6.x upward
on, it is required to enable the compile option
CONFIG_PLATFORM_USE_ANDROID_SDK_6_UPWARD, Touch Device Driver will set up the
GPIOs somehow if the option is enabled. Also, the virtual keys in Touch Device Driver are not
necessary to modify if the platform is MTK.
2.2. Ilitek_drv_update.c
This section will explain all the functions used for upgrading Touch Firmware in ilitek_drv_update.c.
The functions are used to verify whether the CRC of TP firmware sent by an apk or SW ID
mechanism is correct or not.
The function is used to determine which format of IC report protocol is used by identifying the type of
Touch IC.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 21 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.2.1.3. Upgrade Firmware
static s32 _DrvMsg22xxUpdateFirmware(u8 szFwData[][1024], EmemType_e eEmemType);
static s32 _DrvMsg28xxUpdateFirmware(u8 szFwData[][1024], EmemType_e eEmemType);
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
static void _DrvUpdateFirmwareBySwIdDoWork(struct work_struct *pWork);
#ifdef CONFIG_ENABLE_CHIP_TYPE_MSG22XX
static void _DrvMsg22xxCheckFirmwareUpdateBySwId(void);
#endif //CONFIG_ENABLE_CHIP_TYPE_MSG22XX
#ifdef CONFIG_ENABLE_CHIP_TYPE_MSG28XX
static void _DrvMsg28xxCheckFirmwareUpdateBySwId(void);
#endif //CONFIG_ENABLE_CHIP_TYPE_MSG28XX
#ifdef CONFIG_ENABLE_CHIP_TYPE_ILI21XX
static void _DrvIliTekCheckFirmwareUpdateBySwId(void);
#endif CONFIG_ENABLE_CHIP_TYPE_ILI21XX
#endif CONFIG_UPDATE_FIRMWARE_BY_SW_ID
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 22 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.3. ilitek_drv_main.c
The transmission of data between ILITEK/Mstar’s APK and Touch Device Driver goes through Linux
proc virtual file system. The APK uses the file system to tell Touch Device Driver to update TP
firmware on Touch ICs or other operations. This section wil explain the functions used for that
propose in ilitek_drv_main.c for more details.
2.3.1 Function
The following only describes fundamental parts of the functions in ilitek_drv_main.c.
The functions are used for I2C read/write by either SMBUS with TP Firwamre or DBBUS with Touch
IC.
The function is used to transmite data between Touch Device Driver and the register of Touch IC by
DBBUS on I2C line.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 23 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
extern void DbBusIICUseBus(void);
extern void DbBusIICNotUseBus(void);
extern void DbBusIICReshape(void);
extern void DbBusStopMCU(void);
extern void DbBusNotStopMCU(void);
extern void DbBusResetSlave(void);
extern void DbBusWaitMCU(void);
Before transmitting data with Touch IC by DDBUS on I2C line, you must use the functions to swtich
I2C to use DDBUS, and swtching to not use DBBUS after transmission.
The functions are used to deal with the limitation of I2C read/write for some BB chips on MTK
platforms. DmaAlloc executes once while Touch Device Driver is calling the register function at the
running stage, while DmaFree is executed once while unregisering before the system turns off. All the
functions that deal with the limitation and handle DMA mode (see IicWriteData and IicReadData
functions) have been completed in the newest version of Touch Device Driver, just notice that calling
DMARest before doing I2C read/write.
The function is used to initialize Touch devices, such as creating a file node under the virtual file
system of proc, getting Chip Type from a Touch IC and so on.
The function is to deal with a request sent by an APK to check out the customer firmware version and
the platform firmware version via /proc.
#ifdef CONFIG_ENABLE_GESTURE_DEBUG_MODE
static ssize_t _DrvProcfsGestureDebugModeRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t
*pPos);
static ssize_t _DrvProcfsGestureDebugModeWrite(struct file *pFile, const char __user *pBuffer, size_t nCount,
loff_t *pPos);
static ssize_t _DrvKObjectGestureDebugShow(struct kobject *pKObj, struct kobj_attribute *pAttr, char *pBuf);
static ssize_t _DrvKObjectGestureDebugStore(struct kobject *pKObj, struct kobj_attribute *pAttr, const char
*pBuf, size_t nCount);
#endif //CONFIG_ENABLE_GESTURE_DEBUG_MODE
#ifdef CONFIG_ENABLE_GESTURE_INFORMATION_MODE
static ssize_t _DrvProcfsGestureInforModeRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t
*pPos);
static ssize_t _DrvProcfsGestureInforModeWrite(struct file *pFile, const char __user *pBuffer, size_t nCount,
loff_t *pPos);
#endif //CONFIG_ENABLE_GESTURE_INFORMATION_MODE
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
The above functions are used to verify whether the gesture wakeup works well. The APK will read
from and write to the node under proc for communicating with Touch Device Driver. Once the driver
retrieves the command, it will tell TP firmware to enable or disable the function of geusture wakeup.
Both of gesture debug mode and gesture information mode can also be set by the upper layer.
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
extern void DrvOpenGestureWakeup(u32 *pMode);
extern void DrvCloseGestureWakeup(void);
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 25 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
#ifdef CONFIG_ENABLE_GESTURE_DEBUG_MODE
extern void DrvOpenGestureDebugMode(u8 nGestureFlag);
extern void DrvCloseGestureDebugMode(void);
#endif //CONFIG_ENABLE_GESTURE_DEBUG_MODE
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
The above functions are used as a gate to enable or disable the gesture wakeup and gesture debug
mode.
2.3.1.8. MP Test
#ifdef CONFIG_ENABLE_ITO_MP_TEST
ssize_t DrvProcfsMpTestRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t *pPos);
ssize_t DrvProcfsMpTestWrite(struct file *pFile, const char __user *pBuffer, size_t nCount, loff_t *pPos);
ssize_t DrvProcfsMpTestLogRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t *pPos);
ssize_t DrvProcfsMpTestLogWrite(struct file *pFile, const char __user *pBuffer, size_t nCount, loff_t *pPos);
extern ssize_t DrvProcfsMpTestFailChannelRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t
*pPos);
extern ssize_t DrvProcfsMpTestFailChannelWrite(struct file *pFile, const char __user *pBuffer, size_t nCount,
loff_t *pPos);
extern ssize_t DrvProcfsMpTestScopeRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t *pPos);
extern ssize_t DrvProcfsMpTestScopeWrite(struct file *pFile, const char __user *pBuffer, size_t nCount, loff_t
*pPos);
#ifdef CONFIG_ENABLE_CHIP_TYPE_MSG28XX
extern ssize_t DrvProcfsMpTestLogAllRead(struct file *pFile, char __user *pBuffer, size_t nCount, loff_t *pPos);
extern ssize_t DrvProcfsMpTestLogAllWrite(struct file *pFile, const char __user *pBuffer, size_t nCount, loff_t
*pPos);
#endif //CONFIG_ENABLE_CHIP_TYPE_MSG28XX
#endif //CONFIG_ENABLE_ITO_MP_TEST
When the APK reads from or writes to the data for MP Test via /proc, these functions handle the event
and reture results to the APK.
When the APK reads from or writes to the data for switching firmware mode via /proc, these functions
handle the event and tell TP firmware switching to debug mode from demo mode. The Debug mode
outputs data log to a .csv file stored in T Card with a smart phone, and TP firmware colleagus can
analyze the file by MxViewer tool to find out firmware problems effectively.
These functions are used to handle commands from ADB tool. The event is to read the register of
Touch IC for debugging, you can also type register values that you are looking for. The maximum
number of register is 10 as default and you can expand the number as you want. It can also set values
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 27 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
on the register of Touch IC or send SmBus commands to TP firmware.
These functions handle the event that tells TP firmware switching to debug mode from demo mode.
The Debug mode outputs data log to a .csv file stored in T Card with a smart phone, and TP firmware
colleagus can analyze the file by MxViewer tool to find out firmware problems effectively.
When the APK reads from or writes to the file or path for updating TP firmware via /proc, these
functions will update TP firmware based on the path and filename that users send.
2.3.1.13. SW ID
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
static void DrvCheckFirmwareUpdateBySwId(void);
#endif //CONFIG_UPDATE_FIRMWARE_BY_SW_ID
The function is used to check whether TP firmware needs to be updated via SW ID mechanism at the
stage of power on.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 28 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.3.1.14. Optimize Current Consumption
extern void DrvOptimizeCurrentConsumption(void);
The function is to optimize curremnt cusomption of Touch IC in the power saving mode. This function
will only be called when the device is going to the sleep. Notice that the function is expected to
optimize some specific Touch ICs, such as mutual-capacitive (MSG28xx/MSG58xx/ILI211xA) and
self-capactive (MSG22xx).
The functions are used to open or close Leather Seath mode of TP firmware.
Given the difference of development platforms, the function will register a touch input device with
settings by the different compile option.
Given the difference of development platforms, the way to read finger touch packets is also slightly
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 29 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
different. The function is to handle the event by the different compile option.
Given the difference of development platforms, the way to power on or off Touch IC is also slightly
different. The function is to handle the event by the different compile option.
Given the difference of development platforms, the way to report finger touch information to Linux’s
input subsystem is also slightly different. The function is to handle the event by the different compile
option.
Given the difference of development platforms, the way to register interrupt hanlder for reading finger
touch packets is also slightly different. The function is to handle the event by the different compile
option.
Given the difference of development platforms, the way to request GPIO usage of INT pin and
RESET pin is also slightly different. The function is to handle the event by the different compile
option.
int g_TpVirtualKeyDimLocal[MAX_KEY_NUM][4] =
{{BUTTON_W/2*1,TOUCH_SCREEN_Y_MAX+BUTTON_H/2,BUTTON_W,BUTTON_H},{BUTTON_W/2*3,TO
UCH_SCREEN_Y_MAX+BUTTON_H/2,BUTTON_W,BUTTON_H},{BUTTON_W/2*5,TOUCH_SCREEN_Y_MA
X+BUTTON_H/2,BUTTON_W,BUTTON_H},{BUTTON_W/2*7,TOUCH_SCREEN_Y_MAX+BUTTON_H/2,BUT
TON_W,BUTTON_H}};
#endif // CONFIG_TOUCH_DRIVER_RUN_ON_MTK_PLATFORM
#endif //CONFIG_ENABLE_REPORT_KEY_WITH_COORDINATE
Since Touch Device Driver in MTK platforms reports coordinate instead of key codes to Linux’s input
subsystem, the coordinate of virtual key should be adjusted based on the size of touch panel in order
to get the correct position. You can modify the definitions in ilitek_drv_main.c.
The function is as an interface used for different development platforms to initialize Touch Device
Driver.
The function is as an interface used for different development platforms to handle suspend/resume
event. For instance, if the platform is QCOM or SPRD, the compile option
CONFIG_ENABLE_NOTIFIER_FB must be enabled as it uses the method of Notify Callback to
retrieve suspend/resume notification.
2.3.1.27. Others
static void DrvVariableInitialize(void);
static void DrvGetCustomerFirmwareVersion(u16 *pMajor, u16 *pMinor, u8 **ppVersion);
static void DrvGetPlatformFirmwareVersion(u8 **ppVersion);
static void DrvHandleFingerTouch(void);
static s32 DrvUpdateFirmware(u8 szFwData[][1024], EmemType_e eEmemType);
static s32 DrvUpdateFirmwareBySdCard(const char *pFilePath);
These functions include Get Chip Type, Get customer/Platform Firmware version, update firmware by
APK and finger touch handling.
The constant value is about the retry count for MP Test. You can modify it given the customer’s need.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 32 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.4.2 Function
This section will only explain fundermantal part of function as description. The rest of them please
refer to the ilitek_drv _mp_test.h and ilitek_drv _mp_test.c.
2.4.2.1. MP Test
extern void DrvMpTestCreateMpTestWorkQueue(void);
extern void DrvMpTestGetTestDataLog(ItoTestMode_e eItoTestMode, u8 *pDataLog, u32 *pLength);
extern void DrvMpTestGetTestFailChannel(ItoTestMode_e eItoTestMode, u8 *pFailChannel, u32
*pFailChannelCount);
extern s32 DrvMpTestGetTestResult(void);
#ifdef CONFIG_ENABLE_CHIP_TYPE_MSG28XX
extern void DrvMpTestGetTestScope(TestScopeInfo_t *pInfo);
extern void DrvMpTestGetTestLogAll(u8 *pDataLog, u32 *pLength);
#endif //CONFIG_ENABLE_CHIP_TYPE_MSG28XX
extern void DrvMpTestScheduleMpTestWork(ItoTestMode_e eItoTestMode);
When you plan to use the functions of MP Test, the above functions provide all you need. The
information includes the test result of open/short circuit, the data for testing short circuit etc., which
are all stored into a .csv file.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 33 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.5. MTK Hotknot
MTK Hotknot is a protocol of transmitting data in the short distance. You can enable this function by
compile option called CONFIG_ENABLE_HOTKNOT in ilitek_drv_common.h. The Hotknot is
sending commands (or data) via the native layer by ioctl, and the relevant are all defined in
ilitek_drv_hotknot.c and ilitek_drv_hotknot.h
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 34 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.5.4 Hotknot Receiving command
If your device is slave, it turns into the transfer mode and waits for Hotknot data from a master to
receive. Once the device driver at the slave site retrieved the Hotknot data from TP firmware with its
interrupt hanlder, it will create a queue to store the data coming from the host. The following lists
some main functions that deal with the event:
Note that the native layer will send a command to driver in a fixed time for checking if the Hotknot
data stores in a queue. The driver will return an error over the timeout.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 35 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
4. Run hotknot_test
(a) adb shell
(b) ./system/bin/hotknot_test
5. Test Hotknot Authentication
(a) select “2. Authentication Test
6. Test Hotknot sending (master)
(a) select “3. Send Test”
7. Test Hotknot receiving (slaver)
(a) select “4. Receive Test”
If you run the transmitting test, the distance between the two devices should be closed as much as
possible. A successful message will show up, otherwise it fails.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 36 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.5.8 The stage of verification for Hotknot functions
In general, the stage of verification for Hotknot functions can be divided into three stages:
1. Firmware without Hotknot: The purpose of this stage is to ensure that the shared libraries can be
called successfully, and can also test the timeout function (it must be called becase the driver can not
be able to get any repsonses from the firmware).
2. Firmware with Pseudo Hotknot: The stage is to ensure that the communication between the native
layer and firmware is clear. At the stage, the data the driver received is not acutal information from a
device, which is generated by firmware in default.
3. Firmware with all Hotknot functions: In this stage the driver receives real data from the firmware that
can be used to test all Hotknot functions.
1. The goal of Pseudo Hotknot is just for testing the functions of Hotknot only, not for touch finger
reports. It is better to finish the test of touch finger reports before updating Pseudo Hotknot to the
firmware.
2. If you realize that the touch is not working well after updated Pseudo Hotknot, you might need a
thrity party application ( ex: Android Screen Monitor) to control the screen.
2.6. ilitek_drv_sprd.c
If you are using a SPRO platform as your smart phone device, you can use the sample code on that
platform without any problems. However, there is a little bit modification for the compile and the use
of ILITD/Mstar Touch IC.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 37 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
{ I2C_BOARD_INFO("msg2xxx", (0x4C>>1)), }, //SLAVE_I2C_ID_DWI2C
};
obj-$(CONFIG_TOUCHSCREEN_MSG2238) += msg2238_ts.o
msg2238_ts-objs := ilitek_drv_sprd.o
msg2238_ts-objs += ilitek_drv_mp_test.o
msg2238_ts-objs += ilitek_drv_main.o
msg2238_ts-objs += ilitek_drv_update.o
msg2238_ts-objs += ilitek_drv_iliproc.o
2.7. ilitek_drv_qcom.c
If you are using a QCOM platform as your smart phone device, you can use the sample code on that
platform without any problems. However, there is a little bit modification for the compile and the use
of ILITK/Mstar Touch IC.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 38 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
2.8. ilitek_drv_mtk.c
If you are using a MTK platform as your smart phone device, you can use the sample code on that
platform without any problems. However, there is a little bit modification for the compile and the use
of ILITK/Mstar Touch IC.
If the platform is older (ex: MT6582/MT6589/..), you need to create a folder under the directory of
touch panel and put Touch Device Driver in there. Note that the name of the folder you created must
be the same as the name in that Makefile. In contrary, if the platform is newer (ex:
MT6735/MT6753/…), the way of compilation is similar to the way that SPRD and QCOM platforms
do.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 39 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
3. Trouble Shooting
../mediatek/platform/mt6582/kernel/driver/i2c/mt_i2c.h
#ifdef CONFIG_ENABLE_REGULATOR_POWER_ON
void DrvTouchDeviceRegulatorPowerOn(bool nFlag)
{
#if defined(CONFIG_TOUCH_DRIVER_RUN_ON_SPRD_PLATFORM) ||
defined(CONFIG_TOUCH_DRIVER_RUN_ON_QCOM_PLATFORM)
s32 nRetVal = 0;
if (nFlag == true)
{
nRetVal = regulator_enable(g_ReguVdd);
if (nRetVal)
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 40 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
nRetVal = regulator_enable(g_ReguVcc_i2c);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVcc_i2c) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
else
{
nRetVal = regulator_disable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
nRetVal = regulator_disable(g_ReguVcc_i2c);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVcc_i2c) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
#elif defined(CONFIG_TOUCH_DRIVER_RUN_ON_MTK_PLATFORM)
#ifdef CONFIG_PLATFORM_USE_ANDROID_SDK_6_UPWARD
s32 nRetVal = 0;
if (nFlag == true)
{
nRetVal = regulator_enable(g_ReguVdd);
if (nRetVal)
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 41 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
else
{
nRetVal = regulator_disable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
#else
DBG(&g_I2cClient->dev, "*** %s() ***\n", __func__);
3.3.2 Check I2C Bus ID and I2C slave address all correct
The one of root causes probably is the I2C not working so that you might check whether the I2C bus
and I2C Slave address are set properly.
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 42 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
3.3.3 Check INT Pin and Rest Ping all correct
The two pings are pretty much important for Touch ICs. If the Reset pin is not correct, the Touch IC
can not be powered on and TP firmware can not be initialized. If the INT Pin is not correct, TP
firmware can not be able to use an interrupt hanlder to notify Touch Device Driver to get its data.
Check the two setting value MS_TS_MSG_IC_GPIO_RST and MS_TS_MSG_IC_GPIO_INT are
correct in ilitek_drv_common.h
if (nFlag == true)
{
nRetVal = regulator_enable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
nRetVal = regulator_enable(g_ReguVcc_i2c);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVcc_i2c) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 43 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
}
else
{
nRetVal = regulator_disable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
nRetVal = regulator_disable(g_ReguVcc_i2c);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVcc_i2c) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
#elif defined(CONFIG_TOUCH_DRIVER_RUN_ON_MTK_PLATFORM)
#ifdef CONFIG_PLATFORM_USE_ANDROID_SDK_6_UPWARD
s32 nRetVal = 0;
if (nFlag == true)
{
nRetVal = regulator_enable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_enable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
}
mdelay(20);
}
else
{
nRetVal = regulator_disable(g_ReguVdd);
if (nRetVal)
{
DBG(&g_I2cClient->dev, "regulator_disable(g_ReguVdd) failed. nRetVal=%d\n", nRetVal);
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 44 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.
2
ILI TP I C Programming Guide ILI TP
}
mdelay(20);
}
#else
DBG(&g_I2cClient->dev, "*** %s() ***\n", __func__);
SLAVE_I2C_ID_DBBUS :
(0xB2>>1) //0x59 //for MSG22xx
(0xC4>>1) //0x62 //for MSG21xxA/MSG26xxM/MSG28xx/MSG58xx/ILI211xA
The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,
reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp.
Page 45 of 45 Version: 1.00
Copyright © 2017 ILI Technology Corp. All Rights Reserved.
ILI Confidential Disclosed Under NDA.