資源簡介
GT9XX系列驅動,適用于MTK Android 6.0及以上系統。 支持GT9系列TP
代碼片段和文件信息
/*?drivers/input/touchscreen/mediatek/gt9xx_mtk/goodix_tool.c
?*
?*?Copyright??(C)??2010?-?2016?Goodix.?Ltd.
?*
?*?This?program?is?free?software;?you?can?redistribute?it?and/or?modify
?*?it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*?the?Free?Software?Foundation;?either?version?2?of?the?License?or
?*?(at?your?option)?any?later?version.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?a?reference
?*?to?you?when?you?are?integrating?the?GOODiX‘s?CTP?IC?into?your?system
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.See?the?GNU
?*?General?Public?License?for?more?details.
?*
?*?Version:?V2.6.0.3
?*/
#include?“tpd.h“
#include?“include/tpd_gt9xx_common.h“
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include? /*proc?*/
#pragma?pack(1)
struct?st_cmd_head?{
u8?wr; /*?write?read?flag,0:R1:W2:PID?3:?*/
u8?flag; /*?0:no?need?flag/int?1:?need?flag2:need?int?*/
u8?flag_addr[2]; /*?flag?address?*/
u8?flag_val; /*?flag?val?*/
u8?flag_relation; /*?flag_val:flag?0:not?equal?1:equal?2:>?3:*/
u16?circle; /*?polling?cycle?*/
u8?times; /*?plling?times?*/
u8?retry; /*?I2C?retry?times?*/
u16?delay; /*?delay?before?read?or?after?write?*/
u16?data_len; /*?data?length?*/
u8?addr_len; /*?address?length?*/
u8?addr[2]; /*?address?*/
u8?res[3]; /*?reserved?*/
u8?*data; /*?data?pointer?*/
};
#pragma?pack()
static?struct?st_cmd_head?cmd_head?cmd_head2;
#define?DATA_LENGTH_UINT 512
#define?CMD_HEAD_LENGTH?(sizeof(struct?st_cmd_head)?-?sizeof(u8?*))
static?char?procname[20]?=?{?0?};
static?struct?i2c_client?*gt_client;
static?struct?proc_dir_entry?*goodix_proc_entry;
static?ssize_t?goodix_tool_write(struct?file?*?const?char?__user?*?size_t?loff_t?*);
static?ssize_t?goodix_tool_read(struct?file?*?char?__user?*?size_t?loff_t?*);
static?s32?(*tool_i2c_read)(u8*?u16);
static?s32?(*tool_i2c_write)(u8*?u16);
static?const?struct?file_operations?tool_ops?=?{
.owner?=?THIS_MODULE
.read?=?goodix_tool_read
.write?=?goodix_tool_write
};
static?int?hotknot_open(struct?inode?*node?struct?file?*flip);
static?int?hotknot_release(struct?inode?*node?struct?file?*flip);
static?ssize_t?hotknot_write(struct?file?*?const?char?__user?*?size_t?loff_t?*);
static?ssize_t?hotknot_read(struct?file?*?char?__user?*?size_t?loff_t?*);
static?s32?DATA_LENGTH?=?0;
static?s8?IC_TYPE[16]?=?“GT9XX“;
#ifdef?CONFIG_HOTKNOT_BLOCK_RW
DECLARE_WAIT_QUEUE_HEAD(bp_waiter);
u8?got_hotknot_state?=?0;
u8?got_hotknot_extra_state?=?0;
u8?wait_hotknot_state?=?0;
u8?force_wake_flag?=?0;
#endif
#define?HOTKNOTNAME?“hotknot“
u8?gtp_hotknot_enabled?=?0;
static?const?struct?file_operations?hotknot_fops?=?{
/*?.owner?=?THIS_MODULE?
評論
共有 條評論