PD#158974: touchscreen: goodix GT1X driver support

Change-Id: I45b6e97a2fdba801c681e1858a155e2df7f050fd
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
This commit is contained in:
Sunny Luo
2018-01-18 21:27:27 +08:00
committed by Jianxin Pan
parent ef927a5be3
commit ebd2ef4e30
15 changed files with 7344 additions and 3 deletions

View File

@@ -13,11 +13,11 @@ Example:
i2c1: i2c@1e000 {
/* ... */
focaltech_ts@0x38 {
focaltech_ts@38 {
compatible = "focaltech,fts";
status = "okay";
reg = <0x38>;
reset-gpio = <&gpio GPIOZ_2 0x00>;
reset-gpio = <&gpio GPIOZ_6 0x00>;
irq-gpio = <&gpio GPIOZ_3 0x00>;
x_max = <600>;
y_max = <1024>;
@@ -26,3 +26,27 @@ Example:
/* ... */
};
* Goodix GT1X series touchscreen controller
Required properties:
- compatible: Should be "goodix,gt1x"
- reg: I2C address of the chip. Should be 0x5d or 0x14
- irq-gpio: GPIO pin used for IRQ
- reset-gpio: GPIO pin used for reset
Example:
i2c1: i2c@1e000 {
/* ... */
goodix_ts@5d {
compatible = "goodix,gt1x";
status = "okay";
reg = <0x5d>;
reset-gpio = <&gpio GPIOZ_6 0x00>;
irq-gpio = <&gpio GPIOZ_3 0x00>;
};
/* ... */
};

View File

@@ -14253,6 +14253,7 @@ F: drivers/amlogic/ledring/aml-pca9557.c
AMLOGIC TOUCHSCREEN DRIVER
M: Sunny Luo <sunny.luo@amlogic.com>
F: Documentation/devicetree/bindings/input/touchscreen/amlogic-ts.txt
F: Documentation/devicetree/bindings/amlogic/input/amlogic-ts.txt
F: drivers/amlogic/input/touchscreen/*
F: drivers/amlogic/input/touchscreen/focaltech_touch/*
F: drivers/amlogic/input/touchscreen/goodix_gt1x/*

View File

@@ -236,6 +236,7 @@ CONFIG_AMLOGIC_REMOTE=y
CONFIG_AMLOGIC_MESON_REMOTE=y
CONFIG_AMLOGIC_TOUCHSCREEN=y
CONFIG_AMLOGIC_TOUCHSCREEN_FTS=y
CONFIG_AMLOGIC_TOUCHSCREEN_GT1X=y
CONFIG_AMLOGIC_EFUSE=y
CONFIG_AMLOGIC_REBOOT=y
CONFIG_AMLOGIC_GX_REBOOT=y

6
drivers/amlogic/input/touchscreen/Kconfig Executable file → Normal file
View File

@@ -18,5 +18,11 @@ config AMLOGIC_TOUCHSCREEN_FTS
help
Say Y here if you want to use facaltech FT_xx.
config AMLOGIC_TOUCHSCREEN_GT1X
tristate "goodix gt1x touch driver support"
depends on I2C
default n
help
Say Y here if you want to use goodix gt1x.
endif

1
drivers/amlogic/input/touchscreen/Makefile Executable file → Normal file
View File

@@ -5,3 +5,4 @@
# Each configuration option enables a list of files.
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_FTS) += focaltech_touch/
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += goodix_gt1x/

View File

@@ -0,0 +1,11 @@
#
# Goodix Touchscreen driver configuration
#
config AMLOGIC_TOUCHSCREEN_GT1X
bool "Goodix GT1X Touchscreen"
depends on I2C
default n
help
Say Y here if you have Goodix GT1X touch panel.
If unsure, say N.

View File

@@ -0,0 +1,9 @@
#
# Makefile for the goodix touchscreen drivers.
#
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += gt1x_extents.o
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += gt1x_generic.o
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += gt1x_tools.o
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += gt1x.o
obj-$(CONFIG_AMLOGIC_TOUCHSCREEN_GT1X) += gt1x_update.o

View File

@@ -0,0 +1,789 @@
/* drivers/input/touchscreen/gt1x.c
*
* 2010 - 2014 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#include <linux/irq.h>
#include "gt1x.h"
#if GTP_ICS_SLOT_REPORT
#include <linux/input/mt.h>
#endif
static struct work_struct gt1x_work;
static struct input_dev *input_dev;
static struct workqueue_struct *gt1x_wq;
static const char *gt1x_ts_name = "goodix-ts";
static const char *input_dev_phys = "input/ts";
#ifdef GTP_CONFIG_OF
int gt1x_rst_gpio;
int gt1x_int_gpio;
#endif
bool init_ok = 0;
static int gt1x_register_powermanger(void);
static int gt1x_unregister_powermanger(void);
/**
* gt1x_i2c_write - i2c write.
* @addr: register address.
* @buffer: data buffer.
* @len: the bytes of data to write.
*Return: 0: success, otherwise: failed
*/
s32 gt1x_i2c_write(u16 addr, u8 * buffer, s32 len)
{
struct i2c_msg msg = {
.flags = 0,
.addr = gt1x_i2c_client->addr,
};
return _do_i2c_write(&msg, addr, buffer, len);
}
/**
* gt1x_i2c_read - i2c read.
* @addr: register address.
* @buffer: data buffer.
* @len: the bytes of data to write.
*Return: 0: success, otherwise: failed
*/
s32 gt1x_i2c_read(u16 addr, u8 * buffer, s32 len)
{
u8 addr_buf[GTP_ADDR_LENGTH] = { (addr >> 8) & 0xFF, addr & 0xFF };
struct i2c_msg msgs[2] = {
{
.addr = gt1x_i2c_client->addr,
.flags = 0,
.buf = addr_buf,
.len = GTP_ADDR_LENGTH},
{
.addr = gt1x_i2c_client->addr,
.flags = I2C_M_RD}
};
return _do_i2c_read(msgs, addr, buffer, len);
}
static spinlock_t irq_lock;
static s32 irq_is_disable = 0;
/**
* gt1x_irq_enable - enable irq function.
*
*/
void gt1x_irq_enable(void)
{
unsigned long irqflags = 0;
GTP_DEBUG_FUNC();
spin_lock_irqsave(&irq_lock, irqflags);
if (irq_is_disable) {
enable_irq(gt1x_i2c_client->irq);
irq_is_disable = 0;
}
spin_unlock_irqrestore(&irq_lock, irqflags);
}
/**
* gt1x_irq_enable - disable irq function.
*
*/
void gt1x_irq_disable(void)
{
unsigned long irqflags;
GTP_DEBUG_FUNC();
spin_lock_irqsave(&irq_lock, irqflags);
if (!irq_is_disable) {
irq_is_disable = 1;
disable_irq_nosync(gt1x_i2c_client->irq);
}
spin_unlock_irqrestore(&irq_lock, irqflags);
}
int gt1x_debug_proc(u8 * buf, int count)
{
return -1;
}
#if GTP_CHARGER_SWITCH
u32 gt1x_get_charger_status(void)
{
#error Need to get charger status of your platform.
}
#endif
/**
* gt1x_ts_irq_handler - External interrupt service routine for interrupt mode.
* @irq: interrupt number.
* @dev_id: private data pointer.
* Return: Handle Result.
* IRQ_HANDLED: interrupt handled successfully
*/
static irqreturn_t gt1x_ts_irq_handler(int irq, void *dev_id)
{
static int irq_counter = 0;
GTP_DEBUG_FUNC();
if (init_ok) {
gt1x_irq_disable();
queue_work(gt1x_wq, &gt1x_work);
}
pr_info("irq_cnt = %d, init_ok = %d\n", ++irq_counter, init_ok);
return IRQ_HANDLED;
}
/**
* gt1x_touch_down - Report touch point event .
* @id: trackId
* @x: input x coordinate
* @y: input y coordinate
* @w: input pressure
* Return: none.
*/
void gt1x_touch_down(s32 x, s32 y, s32 size, s32 id)
{
#if GTP_CHANGE_X2Y
GTP_SWAP(x, y);
#endif
#if GTP_ICS_SLOT_REPORT
input_mt_slot(input_dev, id);
input_report_abs(input_dev, ABS_MT_PRESSURE, size);
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, size);
input_report_abs(input_dev, ABS_MT_TRACKING_ID, id);
input_report_abs(input_dev, ABS_MT_POSITION_X, x);
input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
#else
input_report_key(input_dev, BTN_TOUCH, 1);
if ((!size) && (!id)) {
/* for virtual button */
input_report_abs(input_dev, ABS_MT_PRESSURE, 100);
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, 100);
} else {
input_report_abs(input_dev, ABS_MT_PRESSURE, size);
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, size);
input_report_abs(input_dev, ABS_MT_TRACKING_ID, id);
}
input_report_abs(input_dev, ABS_MT_POSITION_X, x);
input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
input_mt_sync(input_dev);
#endif
}
/**
* gt1x_touch_up - Report touch release event.
* @id: trackId
* Return: none.
*/
void gt1x_touch_up(s32 id)
{
#if GTP_ICS_SLOT_REPORT
input_mt_slot(input_dev, id);
input_report_abs(input_dev, ABS_MT_TRACKING_ID, -1);
#else
input_report_key(input_dev, BTN_TOUCH, 0);
input_mt_sync(input_dev);
#endif
}
/**
* gt1x_ts_work_func - Goodix touchscreen work function.
* @iwork: work struct of gt1x_workqueue.
* Return: none.
*/
static void gt1x_ts_work_func(struct work_struct *work)
{
u8 end_cmd = 0;
u8 finger = 0;
s32 ret = 0;
u8 point_data[11] = { 0 };
if (update_info.status) {
GTP_DEBUG("Ignore interrupts during fw update.");
return;
}
#if GTP_GESTURE_WAKEUP
ret = gesture_event_handler(input_dev);
if (ret >= 0) {
goto exit_work_func;
}
#endif
if (gt1x_halt) {
GTP_DEBUG("Ignore interrupts after suspend...");
return;
}
ret = gt1x_i2c_read(GTP_READ_COOR_ADDR, point_data, sizeof(point_data));
if (ret < 0) {
GTP_ERROR("I2C transfer error!");
#if !GTP_ESD_PROTECT
gt1x_power_reset();
#endif
goto exit_work_func;
}
finger = point_data[0];
if (finger == 0x00) {
gt1x_request_event_handler();
}
if ((finger & 0x80) == 0) {
#if HOTKNOT_BLOCK_RW
if (!hotknot_paired_flag)
#endif
{
//GTP_ERROR("buffer not ready:0x%02x", finger);
goto exit_eint;
}
}
#if HOTKNOT_BLOCK_RW
ret = hotknot_event_handler(point_data);
if (!ret) {
goto exit_work_func;
}
#endif
#if GTP_PROXIMITY
ret = gt1x_prox_event_handler(point_data);
if (ret > 0) {
goto exit_work_func;
}
#endif
#if GTP_WITH_STYLUS
ret = gt1x_touch_event_handler(point_data, input_dev, pen_dev);
#else
ret = gt1x_touch_event_handler(point_data, input_dev, NULL);
#endif
exit_work_func:
if (!gt1x_rawdiff_mode && (ret >= 0 || ret == ERROR_VALUE)) {
ret = gt1x_i2c_write(GTP_READ_COOR_ADDR, &end_cmd, 1);
if (ret < 0) {
GTP_ERROR("I2C write end_cmd error!");
}
}
exit_eint:
gt1x_irq_enable();
}
#ifdef CONFIG_GT1X_POWER_CTRL
static struct regulator *vdd_ana;
static struct regulator *vcc_i2c;
#endif
#ifdef GTP_CONFIG_OF
/**
* gt1x_parse_dt - parse platform infomation form devices tree.
*/
static int gt1x_parse_dt(struct device *dev)
{
struct device_node *np;
int ret = 0;
if (!dev)
return -ENODEV;
np = dev->of_node;
gt1x_int_gpio = of_get_named_gpio(np, "irq-gpio", 0);
gt1x_rst_gpio = of_get_named_gpio(np, "reset-gpio", 0);
if (!gpio_is_valid(gt1x_int_gpio) || !gpio_is_valid(gt1x_rst_gpio)) {
GTP_ERROR("Invalid GPIO, irq-gpio:%d, rst-gpio:%d",
gt1x_int_gpio, gt1x_rst_gpio);
return -EINVAL;
}
#ifdef CONFIG_GT1X_POWER_CTRL
vdd_ana = regulator_get(dev, "vdd_ana");
if (IS_ERR(vdd_ana)) {
GTP_ERROR("regulator get of vdd_ana failed");
ret = PTR_ERR(vdd_ana);
vdd_ana = NULL;
return ret;
}
vcc_i2c = regulator_get(dev, "vcc_i2c");
if (IS_ERR(vcc_i2c)) {
GTP_ERROR("regulator get of vcc_i2c failed");
ret = PTR_ERR(vcc_i2c);
vcc_i2c = NULL;
goto ERR_GET_VCC;
}
return 0;
ERR_GET_VCC:
regulator_put(vdd_ana);
vdd_ana = NULL;
#endif // end of CONFIG_GT1X_POWER_CTRL
return ret;
}
#endif
/**
* gt1x_power_switch - power switch .
* @on: 1-switch on, 0-switch off.
* return: 0-succeed, -1-faileds
*/
int gt1x_power_switch(int on)
{
int ret = 0;
#ifdef CONFIG_GT1X_POWER_CTRL
struct i2c_client *client = gt1x_i2c_client;
if (!client || !vdd_ana || !vcc_i2c)
return -1;
if (on) {
GTP_DEBUG("GTP power on.");
ret = regulator_enable(vdd_ana);
udelay(2);
ret = regulator_enable(vcc_i2c);
} else {
GTP_DEBUG("GTP power off.");
ret = regulator_disable(vcc_i2c);
udelay(2);
ret = regulator_disable(vdd_ana);
}
#endif // end of CONFIG_GT1X_POWER_CTRL
return ret;
}
static void gt1x_remove_gpio_and_power(void)
{
if (gpio_is_valid(gt1x_int_gpio))
gpio_free(gt1x_int_gpio);
if (gpio_is_valid(gt1x_rst_gpio))
gpio_free(gt1x_rst_gpio);
#ifdef CONFIG_GT1X_POWER_CTRL
if (vcc_i2c)
regulator_put(vcc_i2c);
if (vdd_ana)
regulator_put(vdd_ana);
#endif // end of CONFIG_GT1X_POWER_CTRL
if (gt1x_i2c_client && gt1x_i2c_client->irq)
free_irq(gt1x_i2c_client->irq, gt1x_i2c_client);
}
/**
* gt1x_request_io_port - Request gpio(INT & RST) ports.
*/
static s32 gt1x_request_io_port(void)
{
s32 ret = 0;
GTP_DEBUG_FUNC();
ret = gpio_request(GTP_INT_PORT, "GTP_INT_IRQ");
if (ret < 0) {
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_INT_PORT, ret);
ret = -ENODEV;
} else {
GTP_GPIO_AS_INT(GTP_INT_PORT);
gt1x_i2c_client->irq = GTP_INT_IRQ;
}
ret = gpio_request(GTP_RST_PORT, "GTP_RST_PORT");
if (ret < 0) {
GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_RST_PORT, ret);
ret = -ENODEV;
}
GTP_GPIO_AS_INPUT(GTP_RST_PORT);
if (ret < 0) {
gpio_free(GTP_RST_PORT);
gpio_free(GTP_INT_PORT);
}
return ret;
}
/**
* gt1x_request_irq - Request interrupt.
* Return
* 0: succeed, -1: failed.
*/
static s32 gt1x_request_irq(void)
{
s32 ret = -1;
const u8 irq_table[] = GTP_IRQ_TAB;
GTP_DEBUG_FUNC();
GTP_DEBUG("INT trigger type:%x", gt1x_int_type);
ret = request_irq(gt1x_i2c_client->irq, gt1x_ts_irq_handler, irq_table[gt1x_int_type], gt1x_i2c_client->name, gt1x_i2c_client);
if (ret) {
GTP_ERROR("Request IRQ failed!ERRNO:%d.", ret);
GTP_GPIO_AS_INPUT(GTP_INT_PORT);
gpio_free(GTP_INT_PORT);
return -1;
} else {
gt1x_irq_disable();
return 0;
}
}
/**
* gt1x_request_input_dev - Request input device Function.
* Return
* 0: succeed, -1: failed.
*/
static s8 gt1x_request_input_dev(void)
{
s8 ret = -1;
#if GTP_HAVE_TOUCH_KEY
u8 index = 0;
#endif
GTP_DEBUG_FUNC();
input_dev = input_allocate_device();
if (input_dev == NULL) {
GTP_ERROR("Failed to allocate input device.");
return -ENOMEM;
}
input_dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
#if GTP_ICS_SLOT_REPORT
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0))
input_mt_init_slots(input_dev, 16, INPUT_MT_DIRECT);
#else
input_mt_init_slots(input_dev, 16);
#endif
#else
input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
#endif
set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
#if GTP_HAVE_TOUCH_KEY
for (index = 0; index < GTP_MAX_KEY_NUM; index++) {
input_set_capability(input_dev, EV_KEY, gt1x_touch_key_array[index]);
}
#endif
#if GTP_GESTURE_WAKEUP
input_set_capability(input_dev, EV_KEY, KEY_GES_REGULAR);
input_set_capability(input_dev, EV_KEY, KEY_GES_CUSTOM);
#endif
#if GTP_CHANGE_X2Y
input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, gt1x_abs_y_max, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, gt1x_abs_x_max, 0, 0);
#else
input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, gt1x_abs_x_max, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, gt1x_abs_y_max, 0, 0);
#endif
input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0, 255, 0, 0);
input_dev->name = gt1x_ts_name;
input_dev->phys = input_dev_phys;
input_dev->id.bustype = BUS_I2C;
input_dev->id.vendor = 0xDEAD;
input_dev->id.product = 0xBEEF;
input_dev->id.version = 10427;
ret = input_register_device(input_dev);
if (ret) {
GTP_ERROR("Register %s input device failed", input_dev->name);
return -ENODEV;
}
return 0;
}
/**
* gt1x_ts_probe - I2c probe.
* @client: i2c device struct.
* @id: device id.
* Return 0: succeed, -1: failed.
*/
static int gt1x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
s32 ret = -1;
#if GTP_AUTO_UPDATE
struct task_struct *thread = NULL;
#endif
//do NOT remove these logs
GTP_INFO("GTP Driver Version: %s", GTP_DRIVER_VERSION);
GTP_INFO("GTP I2C Address: 0x%02x", client->addr);
gt1x_i2c_client = client;
spin_lock_init(&irq_lock);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
GTP_ERROR("I2C check functionality failed.");
return -ENODEV;
}
#ifdef GTP_CONFIG_OF /* device tree support */
if (client->dev.of_node) {
gt1x_parse_dt(&client->dev);
}
#endif
ret = gt1x_request_io_port();
if (ret < 0) {
GTP_ERROR("GTP request IO port failed.");
return ret;
}
gt1x_init();
INIT_WORK(&gt1x_work, gt1x_ts_work_func);
ret = gt1x_request_input_dev();
if (ret < 0) {
GTP_ERROR("GTP request input dev failed");
}
ret = gt1x_request_irq();
if (ret < 0) {
GTP_INFO("GTP works in polling mode.");
} else {
GTP_INFO("GTP works in interrupt mode.");
}
#if GTP_GESTURE_WAKEUP
enable_irq_wake(client->irq);
#endif
gt1x_irq_enable();
init_ok = 1;
#if GTP_ESD_PROTECT
// must before auto update
gt1x_init_esd_protect();
gt1x_esd_switch(SWITCH_ON);
#endif
#if GTP_AUTO_UPDATE
thread = kthread_run(gt1x_auto_update_proc, (void *)NULL, "gt1x_auto_update");
if (IS_ERR(thread)) {
ret = PTR_ERR(thread);
GTP_ERROR("Failed to create auto-update thread: %d.", ret);
}
#endif
gt1x_register_powermanger();
return 0;
}
/**
* gt1x_ts_remove - Goodix touchscreen driver release function.
* @client: i2c device struct.
* Return 0: succeed, -1: failed.
*/
static int gt1x_ts_remove(struct i2c_client *client)
{
GTP_DEBUG_FUNC();
GTP_INFO("GTP driver removing...");
gt1x_unregister_powermanger();
#if GTP_GESTURE_WAKEUP
disable_irq_wake(client->irq);
#endif
gt1x_deinit();
input_unregister_device(input_dev);
gt1x_remove_gpio_and_power();
return 0;
}
#if defined(CONFIG_FB)
/* frame buffer notifier block control the suspend/resume procedure */
static struct notifier_block gt1x_fb_notifier;
static int gtp_fb_notifier_callback(struct notifier_block *noti, unsigned long event, void *data)
{
struct fb_event *ev_data = data;
int *blank;
#if GTP_INCELL_PANEL
#ifndef FB_EARLY_EVENT_BLANK
#error Need add FB_EARLY_EVENT_BLANK to fbmem.c
#endif
if (ev_data && ev_data->data && event == FB_EARLY_EVENT_BLANK) {
blank = ev_data->data;
if (*blank == FB_BLANK_UNBLANK) {
GTP_DEBUG("Resume by fb notifier.");
gt1x_resume();
}
}
#else
if (ev_data && ev_data->data && event == FB_EVENT_BLANK) {
blank = ev_data->data;
if (*blank == FB_BLANK_UNBLANK) {
GTP_DEBUG("Resume by fb notifier.");
gt1x_resume();
}
}
#endif
if (ev_data && ev_data->data && event == FB_EVENT_BLANK) {
blank = ev_data->data;
if (*blank == FB_BLANK_POWERDOWN) {
GTP_DEBUG("Suspend by fb notifier.");
gt1x_suspend();
}
}
return 0;
}
#elif defined(CONFIG_PM)
/**
* gt1x_ts_suspend - i2c suspend callback function.
* @dev: i2c device.
* Return 0: succeed, -1: failed.
*/
static int gt1x_pm_suspend(struct device *dev)
{
return gt1x_suspend();
}
/**
* gt1x_ts_resume - i2c resume callback function.
* @dev: i2c device.
* Return 0: succeed, -1: failed.
*/
static int gt1x_pm_resume(struct device *dev)
{
return gt1x_resume();
}
/* bus control the suspend/resume procedure */
static const struct dev_pm_ops gt1x_ts_pm_ops = {
.suspend = gt1x_pm_suspend,
.resume = gt1x_pm_resume,
};
#elif defined(CONFIG_HAS_EARLYSUSPEND)
/* earlysuspend module the suspend/resume procedure */
static void gt1x_ts_early_suspend(struct early_suspend *h)
{
gt1x_suspend();
}
static void gt1x_ts_late_resume(struct early_suspend *h)
{
gt1x_resume();
}
static struct early_suspend gt1x_early_suspend = {
.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1,
.suspend = gt1x_ts_early_suspend,
.resume = gt1x_ts_late_resume,
};
#endif
static int gt1x_register_powermanger(void)
{
#if defined(CONFIG_FB)
gt1x_fb_notifier.notifier_call = gtp_fb_notifier_callback;
fb_register_client(&gt1x_fb_notifier);
#elif defined(CONFIG_HAS_EARLYSUSPEND)
register_early_suspend(&gt1x_early_suspend);
#endif
return 0;
}
static int gt1x_unregister_powermanger(void)
{
#if defined(CONFIG_FB)
fb_unregister_client(&gt1x_fb_notifier);
#elif defined(CONFIG_HAS_EARLYSUSPEND)
unregister_early_suspend(&gt1x_early_suspend);
#endif
return 0;
}
#ifdef GTP_CONFIG_OF
static const struct of_device_id gt1x_match_table[] = {
{.compatible = "goodix,gt1x",},
{ },
};
#endif
static const struct i2c_device_id gt1x_ts_id[] = {
{GTP_I2C_NAME, 0},
{}
};
static struct i2c_driver gt1x_ts_driver = {
.probe = gt1x_ts_probe,
.remove = gt1x_ts_remove,
.id_table = gt1x_ts_id,
.driver = {
.name = GTP_I2C_NAME,
.owner = THIS_MODULE,
#ifdef GTP_CONFIG_OF
.of_match_table = gt1x_match_table,
#endif
#if !defined(CONFIG_FB) && defined(CONFIG_PM)
.pm = &gt1x_ts_pm_ops,
#endif
},
};
/**
* gt1x_ts_init - Driver Install function.
* Return 0---succeed.
*/
static int __init gt1x_ts_init(void)
{
GTP_DEBUG_FUNC();
GTP_INFO("GTP driver installing...");
gt1x_wq = create_singlethread_workqueue("gt1x_wq");
if (!gt1x_wq) {
GTP_ERROR("Creat workqueue failed.");
return -ENOMEM;
}
return i2c_add_driver(&gt1x_ts_driver);
}
/**
* gt1x_ts_exit - Driver uninstall function.
* Return 0---succeed.
*/
static void __exit gt1x_ts_exit(void)
{
GTP_DEBUG_FUNC();
GTP_INFO("GTP driver exited.");
i2c_del_driver(&gt1x_ts_driver);
if (gt1x_wq) {
destroy_workqueue(gt1x_wq);
}
}
module_init(gt1x_ts_init);
module_exit(gt1x_ts_exit);
MODULE_DESCRIPTION("GTP Series Driver");
MODULE_LICENSE("GPL");

View File

@@ -0,0 +1,62 @@
/* drivers/input/touchscreen/gt1x.h
*
* 2010 - 2013 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#ifndef _GOODIX_GT1X_H_
#define _GOODIX_GT1X_H_
#include "gt1x_generic.h"
#include <linux/gpio.h>
#ifdef GTP_CONFIG_OF
#include <linux/of_gpio.h>
#include <linux/regulator/consumer.h>
#endif
#ifdef CONFIG_FB
#include <linux/notifier.h>
#include <linux/fb.h>
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
#endif
#define IIC_MAX_TRANSFER_SIZE 250
/* Customize your I/O ports & I/O operations */
#ifdef GTP_CONFIG_OF
extern int gt1x_rst_gpio;
extern int gt1x_int_gpio;
#define GTP_RST_PORT gt1x_rst_gpio
#define GTP_INT_PORT gt1x_int_gpio
#else
#define GTP_RST_PORT 102 //S5PV210_GPJ3(6)
#define GTP_INT_PORT 52 //S5PV210_GPH1(3)
#endif
#define GTP_INT_IRQ gpio_to_irq(GTP_INT_PORT)
//#define GTP_INT_CFG S3C_GPIO_SFN(0xF)
#define GTP_GPIO_AS_INPUT(pin) do{\
gpio_direction_input(pin);\
}while(0)
#define GTP_GPIO_AS_INT(pin) do{\
GTP_GPIO_AS_INPUT(pin);\
}while(0)
#define GTP_GPIO_GET_VALUE(pin) gpio_get_value(pin)
#define GTP_GPIO_OUTPUT(pin,level) gpio_direction_output(pin,level)
#define GTP_IRQ_TAB {IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH}
#endif /* _GOODIX_GT1X_H_ */

View File

@@ -0,0 +1,930 @@
/* drivers/input/touchscreen/gt1x_extents.c
*
* 2010 - 2014 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#include <linux/input.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h> /*proc */
#include <asm/ioctl.h>
#include "gt1x_generic.h"
#if GTP_GESTURE_WAKEUP
#define GESTURE_NODE "goodix_gesture"
#define GESTURE_MAX_POINT_COUNT 64
#pragma pack(1)
typedef struct {
u8 ic_msg[6]; /*from the first byte */
u8 gestures[4];
u8 data[3 + GESTURE_MAX_POINT_COUNT * 4 + 80]; /*80 bytes for extra data */
} st_gesture_data;
#pragma pack()
#define SETBIT(longlong, bit) (longlong[bit/8] |= (1 << bit%8))
#define CLEARBIT(longlong, bit) (longlong[bit/8] &=(~(1 << bit%8)))
#define QUERYBIT(longlong, bit) (!!(longlong[bit/8] & (1 << bit%8)))
#define CHKBITS_32 32
#define CHKBITS_16 16
#define CHKBITS_8 8
int gesture_enabled = 0; /* module switch */
DOZE_T gesture_doze_status = DOZE_DISABLED; /* doze status */
static u8 gestures_flag[32]; /* gesture flag, every bit stands for a gesture */
static st_gesture_data gesture_data; /* gesture data buffer */
static struct mutex gesture_data_mutex; /* lock for gesture data */
static ssize_t gt1x_gesture_data_read(struct file *file, char __user * page, size_t size, loff_t * ppos)
{
s32 ret = -1;
GTP_DEBUG("visit gt1x_gesture_data_read. ppos:%d", (int)*ppos);
if (*ppos) {
return 0;
}
if (size == 4) {
ret = copy_to_user(((u8 __user *) page), "GT1X", 4);
return 4;
}
ret = simple_read_from_buffer(page, size, ppos, &gesture_data, sizeof(gesture_data));
GTP_DEBUG("Got the gesture data.");
return ret;
}
static ssize_t gt1x_gesture_data_write(struct file *filp, const char __user * buff, size_t len, loff_t * off)
{
s32 ret = 0;
GTP_DEBUG_FUNC();
ret = copy_from_user(&gesture_enabled, buff, 1);
if (ret) {
GTP_ERROR("copy_from_user failed.");
return -EPERM;
}
GTP_DEBUG("gesture enabled:%x, ret:%d", gesture_enabled, ret);
return len;
}
/**
* calc_checksum - Calc checksum.
* @buf: data to be calc
* @len: length of buf.
* @bits: checkbits
* Return true-pass, false:not pass.
*/
static bool calc_checksum(u8 *buf, int len, int bits)
{
int i;
if (bits == CHKBITS_16) {
u16 chksum, *b = (u16 *)buf;
if (len % 2) {
return false;
}
len /= 2;
for (i = 0, chksum = 0; i < len; i++) {
if (i == len - 1)
chksum += le16_to_cpu(b[i]);
else
chksum += be16_to_cpu(b[i]);
}
return chksum == 0 ? true : false;
} else if (bits == CHKBITS_8) {
u8 chksum;
for (i = 0, chksum =0; i < len; i++) {
chksum += buf[i];
}
return chksum == 0 ? true : false;
}
return false;
}
int gesture_enter_doze(void)
{
int retry = 0;
GTP_DEBUG_FUNC();
GTP_DEBUG("Entering doze mode...");
while (retry++ < 5) {
if (!gt1x_send_cmd(0x08, 0)) {
gesture_doze_status = DOZE_ENABLED;
GTP_DEBUG("Working in doze mode!");
return 0;
}
msleep(10);
}
GTP_ERROR("Send doze cmd failed.");
return -1;
}
s32 gesture_event_handler(struct input_dev * dev)
{
u8 doze_buf[4] = { 0 }, ges_type;
static int err_flag1 = 0, err_flag2 = 0;
int len, extra_len, need_chk;
unsigned int key_code;
s32 ret = 0;
if (DOZE_ENABLED != gesture_doze_status) {
return -1;
}
/** package: -head 4B + track points + extra info-
* - head -
* doze_buf[0]: gesture type,
* doze_buf[1]: number of gesture points ,
* doze_buf[2]: protocol type,
* doze_buf[3]: gesture extra data length.
*/
ret = gt1x_i2c_read(GTP_REG_WAKEUP_GESTURE, doze_buf, 4);
if (ret < 0) {
return 0;
}
ges_type = doze_buf[0];
len = doze_buf[1];
need_chk = doze_buf[2] & 0x80;
extra_len = doze_buf[3];
GTP_DEBUG("0x%x = 0x%02X,0x%02X,0x%02X,0x%02X", GTP_REG_WAKEUP_GESTURE,
doze_buf[0], doze_buf[1], doze_buf[2], doze_buf[3]);
if (len > GESTURE_MAX_POINT_COUNT) {
GTP_ERROR("Gesture contain too many points!(%d)", len);
len = GESTURE_MAX_POINT_COUNT;
}
if (extra_len > 32) {
GTP_ERROR("Gesture contain too many extra data!(%d)", extra_len);
extra_len = 32;
}
/* get gesture extra info */
if (extra_len >= 0) {
u8 ges_data[extra_len + 1];
/* head 4 + extra data * 4 + chksum 1 */
ret = gt1x_i2c_read(GTP_REG_WAKEUP_GESTURE + 4,
ges_data, extra_len + 1);
if (ret < 0) {
GTP_ERROR("Read extra gesture data failed.");
return 0;
}
if (likely(need_chk)) { /* calc checksum */
bool val;
ges_data[extra_len] += doze_buf[0] + doze_buf[1]
+ doze_buf[2] + doze_buf[3];
val = calc_checksum(ges_data, extra_len + 1, CHKBITS_8);
if (unlikely(!val)) { /* check failed */
GTP_ERROR("Gesture checksum error.");
if (err_flag1) {
err_flag1 = 0;
ret = 0;
goto clear_reg;
} else {
/* just return 0 without clear reg,
this will receive another int, we
check the data in the next frame */
err_flag1 = 1;
return 0;
}
}
err_flag1 = 0;
}
mutex_lock(&gesture_data_mutex);
memcpy(&gesture_data.data[4 + len * 4], ges_data, extra_len);
mutex_unlock(&gesture_data_mutex);
}
/* check gesture type (if available?) */
if (ges_type == 0 || !QUERYBIT(gestures_flag, ges_type)) {
GTP_INFO("Gesture[0x%02X] has been disabled.", doze_buf[0]);
doze_buf[0] = 0x00;
gt1x_i2c_write(GTP_REG_WAKEUP_GESTURE, doze_buf, 1);
gesture_enter_doze();
return 0;
}
/* get gesture point data */
if (len > 0) { /* coor num * 4 + chksum 2*/
u8 ges_data[len * 4 + 2];
ret = gt1x_i2c_read(GES_BUFFER_ADDR, ges_data, len * 4);
if (ret < 0) {
GTP_ERROR("Read gesture data failed.");
return 0;
}
/* checksum reg for gesture point data */
ret = gt1x_i2c_read(0x819F, &ges_data[len * 4], 2);
if (ret < 0) {
GTP_ERROR("Read gesture data failed.");
return 0;
}
if (likely(need_chk)) {
bool val = calc_checksum(ges_data,
len * 4 + 2, CHKBITS_16);
if (unlikely(!val)) { /* check failed */
GTP_ERROR("Gesture checksum error.");
if (err_flag2) {
err_flag2 = 0;
ret = 0;
goto clear_reg;
} else {
err_flag2 = 1;
return 0;
}
}
err_flag2 = 0;
}
mutex_lock(&gesture_data_mutex);
memcpy(&gesture_data.data[4], ges_data, len * 4);
mutex_unlock(&gesture_data_mutex);
}
mutex_lock(&gesture_data_mutex);
gesture_data.data[0] = ges_type; // gesture type
gesture_data.data[1] = len; // gesture points number
gesture_data.data[2] = doze_buf[2] & 0x7F; // protocol type
gesture_data.data[3] = extra_len; // gesture date length
mutex_unlock(&gesture_data_mutex);
/* get key code */
key_code = ges_type < 16? KEY_GES_CUSTOM : KEY_GES_REGULAR;
GTP_DEBUG("Gesture: 0x%02X, points: %d", doze_buf[0], doze_buf[1]);
input_report_key(dev, key_code, 1);
input_sync(dev);
input_report_key(dev, key_code, 0);
input_sync(dev);
clear_reg:
doze_buf[0] = 0; // clear ges flag
gt1x_i2c_write(GTP_REG_WAKEUP_GESTURE, doze_buf, 1);
return ret;
}
void gesture_clear_wakeup_data(void)
{
mutex_lock(&gesture_data_mutex);
memset(gesture_data.data, 0, 4);
mutex_unlock(&gesture_data_mutex);
}
void gt1x_gesture_debug(int on)
{
if (on) {
gesture_enabled = 1;
memset(gestures_flag, 0xFF, sizeof(gestures_flag));
} else {
gesture_enabled = 0;
memset(gestures_flag, 0x00, sizeof(gestures_flag));
gesture_doze_status = DOZE_DISABLED;
}
GTP_DEBUG("Gesture debug %s", on ? "on":"off");
}
#endif // GTP_GESTURE_WAKEUP
//HotKnot module
#if GTP_HOTKNOT
#define HOTKNOT_NODE "hotknot"
#define HOTKNOT_VERSION "GOODIX,GT1X"
u8 hotknot_enabled = 0;
u8 hotknot_transfer_mode = 0;
static int hotknot_open(struct inode *node, struct file *flip)
{
GTP_DEBUG("Hotknot is enabled.");
hotknot_enabled = 1;
return 0;
}
static int hotknot_release(struct inode *node, struct file *filp)
{
GTP_DEBUG("Hotknot is disabled.");
hotknot_enabled = 0;
return 0;
}
static s32 hotknot_enter_transfer_mode(void)
{
int ret = 0;
u8 buffer[5] = { 0 };
hotknot_transfer_mode = 1;
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_OFF);
#endif
gt1x_irq_disable();
gt1x_send_cmd(GTP_CMD_HN_TRANSFER, 0);
msleep(100);
gt1x_irq_enable();
ret = gt1x_i2c_read(0x8140, buffer, sizeof(buffer));
if (ret) {
hotknot_transfer_mode = 0;
return ret;
}
buffer[4] = 0;
GTP_DEBUG("enter transfer mode: %s ", buffer);
if (strcmp(buffer, "GHot")) {
hotknot_transfer_mode = 0;
return ERROR_HN_VER;
}
return 0;
}
static s32 hotknot_load_hotknot_subsystem(void)
{
return hotknot_enter_transfer_mode();
}
static s32 hotknot_load_authentication_subsystem(void)
{
s32 ret = 0;
u8 buffer[5] = { 0 };
ret = gt1x_hold_ss51_dsp_no_reset();
if (ret < 0) {
GTP_ERROR("Hold ss51 fail!");
return ERROR;
}
if (gt1x_chip_type == CHIP_TYPE_GT1X) {
GTP_INFO("hotknot load jump code.");
ret = gt1x_load_patch(gt1x_patch_jump_fw, 4096, 0, 1024 * 8);
if (ret < 0) {
GTP_ERROR("Load jump code fail!");
return ret;
}
GTP_INFO("hotknot load auth code.");
ret = gt1x_load_patch(hotknot_auth_fw, 4096, 4096, 1024 * 8);
if (ret < 0) {
GTP_ERROR("Load auth system fail!");
return ret;
}
} else { /* GT2X */
GTP_INFO("hotknot load auth code.");
ret = gt1x_load_patch(hotknot_auth_fw, 4096, 0, 1024 * 6);
if (ret < 0) {
GTP_ERROR("load auth system fail!");
return ret;
}
}
ret = gt1x_startup_patch();
if (ret < 0) {
GTP_ERROR("Startup auth system fail!");
return ret;
}
ret = gt1x_i2c_read(GTP_REG_VERSION, buffer, 4);
if (ret < 0) {
GTP_ERROR("i2c read error!");
return ERROR_IIC;
}
buffer[4] = 0;
GTP_INFO("Current System version: %s", buffer);
return 0;
}
static s32 hotknot_recovery_main_system(void)
{
gt1x_irq_disable();
gt1x_reset_guitar();
gt1x_irq_enable();
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_ON);
#endif
hotknot_transfer_mode = 0;
return 0;
}
#if HOTKNOT_BLOCK_RW
DECLARE_WAIT_QUEUE_HEAD(bp_waiter);
static u8 got_hotknot_state = 0;
static u8 got_hotknot_extra_state = 0;
static u8 wait_hotknot_state = 0;
static u8 force_wake_flag = 0;
static u8 block_enable = 0;
s32 hotknot_paired_flag = 0;
static s32 hotknot_block_rw(u8 rqst_hotknot_state, s32 wait_hotknot_timeout)
{
s32 ret = 0;
wait_hotknot_state |= rqst_hotknot_state;
GTP_DEBUG("Goodix tool received wait polling state:0x%x,timeout:%d, all wait state:0x%x", rqst_hotknot_state, wait_hotknot_timeout, wait_hotknot_state);
got_hotknot_state &= (~rqst_hotknot_state);
set_current_state(TASK_INTERRUPTIBLE);
if (wait_hotknot_timeout <= 0) {
wait_event_interruptible(bp_waiter, force_wake_flag || rqst_hotknot_state == (got_hotknot_state & rqst_hotknot_state));
} else {
wait_event_interruptible_timeout(bp_waiter, force_wake_flag || rqst_hotknot_state == (got_hotknot_state & rqst_hotknot_state), wait_hotknot_timeout);
}
wait_hotknot_state &= (~rqst_hotknot_state);
if (rqst_hotknot_state != (got_hotknot_state & rqst_hotknot_state)) {
GTP_ERROR("Wait 0x%x block polling waiter failed.", rqst_hotknot_state);
ret = -1;
}
force_wake_flag = 0;
return ret;
}
static void hotknot_wakeup_block(void)
{
GTP_DEBUG("Manual wakeup all block polling waiter!");
got_hotknot_state = 0;
wait_hotknot_state = 0;
force_wake_flag = 1;
wake_up_interruptible(&bp_waiter);
}
s32 hotknot_event_handler(u8 * data)
{
u8 hn_pxy_state = 0;
u8 hn_pxy_state_bak = 0;
static u8 hn_paired_cnt = 0;
u8 hn_state_buf[10] = { 0 };
u8 finger = data[0];
u8 id = 0;
if (block_enable && !hotknot_paired_flag && (finger & 0x0F)) {
id = data[1];
hn_pxy_state = data[2] & 0x80;
hn_pxy_state_bak = data[3] & 0x80;
if ((32 == id) && (0x80 == hn_pxy_state) && (0x80 == hn_pxy_state_bak)) {
#ifdef HN_DBLCFM_PAIRED
if (hn_paired_cnt++ < 2) {
return 0;
}
#endif
GTP_DEBUG("HotKnot paired!");
if (wait_hotknot_state & HN_DEVICE_PAIRED) {
GTP_DEBUG("INT wakeup HN_DEVICE_PAIRED block polling waiter");
got_hotknot_state |= HN_DEVICE_PAIRED;
wake_up_interruptible(&bp_waiter);
}
block_enable = 0;
hotknot_paired_flag = 1;
return 0;
} else {
got_hotknot_state &= (~HN_DEVICE_PAIRED);
hn_paired_cnt = 0;
}
}
if (hotknot_paired_flag) {
s32 ret = -1;
ret = gt1x_i2c_read(GTP_REG_HN_STATE, hn_state_buf, 6);
if (ret < 0) {
GTP_ERROR("I2C transfer error. errno:%d\n ", ret);
return 0;
}
got_hotknot_state = 0;
GTP_DEBUG("wait_hotknot_state:%x", wait_hotknot_state);
GTP_DEBUG("[0x8800~0x8803]=0x%x,0x%x,0x%x,0x%x", hn_state_buf[0], hn_state_buf[1], hn_state_buf[2], hn_state_buf[3]);
if (wait_hotknot_state & HN_MASTER_SEND) {
if ((0x03 == hn_state_buf[0]) || (0x04 == hn_state_buf[0])
|| (0x07 == hn_state_buf[0])) {
GTP_DEBUG("Wakeup HN_MASTER_SEND block polling waiter");
got_hotknot_state |= HN_MASTER_SEND;
got_hotknot_extra_state = hn_state_buf[0];
wake_up_interruptible(&bp_waiter);
}
} else if (wait_hotknot_state & HN_SLAVE_RECEIVED) {
if ((0x03 == hn_state_buf[1]) || (0x04 == hn_state_buf[1])
|| (0x07 == hn_state_buf[1])) {
GTP_DEBUG("Wakeup HN_SLAVE_RECEIVED block polling waiter:0x%x", hn_state_buf[1]);
got_hotknot_state |= HN_SLAVE_RECEIVED;
got_hotknot_extra_state = hn_state_buf[1];
wake_up_interruptible(&bp_waiter);
}
} else if (wait_hotknot_state & HN_MASTER_DEPARTED) {
if (0x07 == hn_state_buf[0]) {
GTP_DEBUG("Wakeup HN_MASTER_DEPARTED block polling waiter");
got_hotknot_state |= HN_MASTER_DEPARTED;
wake_up_interruptible(&bp_waiter);
}
} else if (wait_hotknot_state & HN_SLAVE_DEPARTED) {
if (0x07 == hn_state_buf[1]) {
GTP_DEBUG("Wakeup HN_SLAVE_DEPARTED block polling waiter");
got_hotknot_state |= HN_SLAVE_DEPARTED;
wake_up_interruptible(&bp_waiter);
}
}
return 0;
}
return -1;
}
#endif //HOTKNOT_BLOCK_RW
#endif //GTP_HOTKNOT
#define GOODIX_MAGIC_NUMBER 'G'
#define NEGLECT_SIZE_MASK (~(_IOC_SIZEMASK << _IOC_SIZESHIFT))
#define GESTURE_ENABLE _IO(GOODIX_MAGIC_NUMBER, 1) // 1
#define GESTURE_DISABLE _IO(GOODIX_MAGIC_NUMBER, 2)
#define GESTURE_FLAG_SET _IO(GOODIX_MAGIC_NUMBER, 3)
#define GESTURE_FLAG_CLEAR _IO(GOODIX_MAGIC_NUMBER, 4)
//#define SET_ENABLED_GESTURE (_IOW(GOODIX_MAGIC_NUMBER, 5, u8) & NEGLECT_SIZE_MASK)
#define GESTURE_DATA_OBTAIN (_IOR(GOODIX_MAGIC_NUMBER, 6, u8) & NEGLECT_SIZE_MASK)
#define GESTURE_DATA_ERASE _IO(GOODIX_MAGIC_NUMBER, 7)
//#define HOTKNOT_LOAD_SUBSYSTEM (_IOW(GOODIX_MAGIC_NUMBER, 6, u8) & NEGLECT_SIZE_MASK)
#define HOTKNOT_LOAD_HOTKNOT _IO(GOODIX_MAGIC_NUMBER, 20)
#define HOTKNOT_LOAD_AUTHENTICATION _IO(GOODIX_MAGIC_NUMBER, 21)
#define HOTKNOT_RECOVERY_MAIN _IO(GOODIX_MAGIC_NUMBER, 22)
//#define HOTKNOT_BLOCK_RW (_IOW(GOODIX_MAGIC_NUMBER, 6, u8) & NEGLECT_SIZE_MASK)
#define HOTKNOT_DEVICES_PAIRED _IO(GOODIX_MAGIC_NUMBER, 23)
#define HOTKNOT_MASTER_SEND _IO(GOODIX_MAGIC_NUMBER, 24)
#define HOTKNOT_SLAVE_RECEIVE _IO(GOODIX_MAGIC_NUMBER, 25)
//#define HOTKNOT_DEVICES_COMMUNICATION
#define HOTKNOT_MASTER_DEPARTED _IO(GOODIX_MAGIC_NUMBER, 26)
#define HOTKNOT_SLAVE_DEPARTED _IO(GOODIX_MAGIC_NUMBER, 27)
#define HOTKNOT_VENDOR_VERSION (_IOR(GOODIX_MAGIC_NUMBER, 28, u8) & NEGLECT_SIZE_MASK)
#define HOTKNOT_WAKEUP_BLOCK _IO(GOODIX_MAGIC_NUMBER, 29)
#define IO_IIC_READ (_IOR(GOODIX_MAGIC_NUMBER, 100, u8) & NEGLECT_SIZE_MASK)
#define IO_IIC_WRITE (_IOW(GOODIX_MAGIC_NUMBER, 101, u8) & NEGLECT_SIZE_MASK)
#define IO_RESET_GUITAR _IO(GOODIX_MAGIC_NUMBER, 102)
#define IO_DISABLE_IRQ _IO(GOODIX_MAGIC_NUMBER, 103)
#define IO_ENABLE_IRQ _IO(GOODIX_MAGIC_NUMBER, 104)
#define IO_GET_VERISON (_IOR(GOODIX_MAGIC_NUMBER, 110, u8) & NEGLECT_SIZE_MASK)
#define IO_PRINT (_IOW(GOODIX_MAGIC_NUMBER, 111, u8) & NEGLECT_SIZE_MASK)
#define IO_VERSION "V1.3-20150420"
#define CMD_HEAD_LENGTH 20
static s32 io_iic_read(u8 * data, void __user * arg)
{
s32 err = ERROR;
s32 data_length = 0;
u16 addr = 0;
err = copy_from_user(data, arg, CMD_HEAD_LENGTH);
if (err) {
GTP_ERROR("Can't access the memory.");
return ERROR_MEM;
}
addr = data[0] << 8 | data[1];
data_length = data[2] << 8 | data[3];
err = gt1x_i2c_read(addr, &data[CMD_HEAD_LENGTH], data_length);
if (!err) {
err = copy_to_user(&((u8 __user *) arg)[CMD_HEAD_LENGTH], &data[CMD_HEAD_LENGTH], data_length);
if (err) {
GTP_ERROR("ERROR when copy to user.[addr: %04x], [read length:%d]", addr, data_length);
return ERROR_MEM;
}
err = CMD_HEAD_LENGTH + data_length;
}
//GTP_DEBUG("IIC_READ.addr:0x%4x, length:%d, ret:%d", addr, data_length, err);
//GTP_DEBUG_ARRAY((&data[CMD_HEAD_LENGTH]), data_length);
return err;
}
static s32 io_iic_write(u8 * data)
{
s32 err = ERROR;
s32 data_length = 0;
u16 addr = 0;
addr = data[0] << 8 | data[1];
data_length = data[2] << 8 | data[3];
err = gt1x_i2c_write(addr, &data[CMD_HEAD_LENGTH], data_length);
if (!err) {
err = CMD_HEAD_LENGTH + data_length;
}
//GTP_DEBUG("IIC_WRITE.addr:0x%4x, length:%d, ret:%d", addr, data_length, err);
//GTP_DEBUG_ARRAY((&data[CMD_HEAD_LENGTH]), data_length);
return err;
}
//@return, 0:operate successfully
// > 0: the length of memory size ioctl has accessed,
// error otherwise.
static long gt1x_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
u32 value = 0;
s32 ret = 0; //the initial value must be 0
u8 *data = NULL;
int cnt = 30;
/* Blocking when firmwaer updating */
while (cnt-- && update_info.status) {
ssleep(1);
}
//GTP_DEBUG("IOCTL CMD:%x", cmd);
/* GTP_DEBUG("command:%d, length:%d, rw:%s",
_IOC_NR(cmd),
_IOC_SIZE(cmd),
(_IOC_DIR(cmd) & _IOC_READ) ? "read" : (_IOC_DIR(cmd) & _IOC_WRITE) ? "write" : "-");
*/
if (_IOC_DIR(cmd)) {
s32 err = -1;
s32 data_length = _IOC_SIZE(cmd);
data = (u8 *) kzalloc(data_length, GFP_KERNEL);
memset(data, 0, data_length);
if (_IOC_DIR(cmd) & _IOC_WRITE) {
err = copy_from_user(data, (void __user *)arg, data_length);
if (err) {
GTP_ERROR("Can't access the memory.");
kfree(data);
return -1;
}
}
} else {
value = (u32) arg;
}
switch (cmd & NEGLECT_SIZE_MASK) {
case IO_GET_VERISON:
if ((u8 __user *) arg) {
ret = copy_to_user(((u8 __user *) arg), IO_VERSION, sizeof(IO_VERSION));
if (!ret) {
ret = sizeof(IO_VERSION);
}
GTP_INFO("%s", IO_VERSION);
}
break;
case IO_IIC_READ:
ret = io_iic_read(data, (void __user *)arg);
break;
case IO_IIC_WRITE:
ret = io_iic_write(data);
break;
case IO_RESET_GUITAR:
gt1x_irq_disable();
gt1x_reset_guitar();
gt1x_irq_enable();
break;
case IO_DISABLE_IRQ:
gt1x_irq_disable();
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_OFF);
#endif
break;
case IO_ENABLE_IRQ:
gt1x_irq_enable();
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_ON);
#endif
break;
//print a string to syc log messages between application and kernel.
case IO_PRINT:
if (data)
GTP_INFO("%s", (char *)data);
break;
#if GTP_GESTURE_WAKEUP
case GESTURE_ENABLE:
GTP_DEBUG("Gesture switch ON.");
gesture_enabled = 1;
break;
case GESTURE_DISABLE:
GTP_DEBUG("Gesture switch OFF.");
gesture_enabled = 0;
break;
case GESTURE_FLAG_SET:
SETBIT(gestures_flag, (u8) value);
GTP_DEBUG("Gesture flag: 0x%02X enabled.", value);
break;
case GESTURE_FLAG_CLEAR:
CLEARBIT(gestures_flag, (u8) value);
GTP_DEBUG("Gesture flag: 0x%02X disabled.", value);
break;
case GESTURE_DATA_OBTAIN:
GTP_DEBUG("Obtain gesture data.");
mutex_lock(&gesture_data_mutex);
ret = copy_to_user(((u8 __user *) arg), &gesture_data.data, 4 + gesture_data.data[1] * 4 + gesture_data.data[3]);
if (ret) {
GTP_ERROR("ERROR when copy gesture data to user.");
ret = ERROR_MEM;
} else {
ret = 4 + gesture_data.data[1] * 4 + gesture_data.data[3];
}
mutex_unlock(&gesture_data_mutex);
break;
case GESTURE_DATA_ERASE:
GTP_DEBUG("ERASE_GESTURE_DATA");
gesture_clear_wakeup_data();
break;
#endif // GTP_GESTURE_WAKEUP
#if GTP_HOTKNOT
case HOTKNOT_VENDOR_VERSION:
ret = copy_to_user(((u8 __user *) arg), HOTKNOT_VERSION, sizeof(HOTKNOT_VERSION));
if (!ret) {
ret = sizeof(HOTKNOT_VERSION);
}
break;
case HOTKNOT_LOAD_HOTKNOT:
ret = hotknot_load_hotknot_subsystem();
break;
case HOTKNOT_LOAD_AUTHENTICATION:
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_OFF);
#endif
ret = hotknot_load_authentication_subsystem();
break;
case HOTKNOT_RECOVERY_MAIN:
ret = hotknot_recovery_main_system();
break;
#if HOTKNOT_BLOCK_RW
case HOTKNOT_DEVICES_PAIRED:
hotknot_paired_flag = 0;
force_wake_flag = 0;
block_enable = 1;
ret = hotknot_block_rw(HN_DEVICE_PAIRED, (s32) value);
break;
case HOTKNOT_MASTER_SEND:
ret = hotknot_block_rw(HN_MASTER_SEND, (s32) value);
if (!ret)
ret = got_hotknot_extra_state;
break;
case HOTKNOT_SLAVE_RECEIVE:
ret = hotknot_block_rw(HN_SLAVE_RECEIVED, (s32) value);
if (!ret)
ret = got_hotknot_extra_state;
break;
case HOTKNOT_MASTER_DEPARTED:
ret = hotknot_block_rw(HN_MASTER_DEPARTED, (s32) value);
break;
case HOTKNOT_SLAVE_DEPARTED:
ret = hotknot_block_rw(HN_SLAVE_DEPARTED, (s32) value);
break;
case HOTKNOT_WAKEUP_BLOCK:
hotknot_wakeup_block();
break;
#endif //HOTKNOT_BLOCK_RW
#endif //GTP_HOTKNOT
default:
GTP_INFO("Unknown cmd.");
ret = -1;
break;
}
if (data != NULL) {
kfree(data);
}
return ret;
}
#ifdef CONFIG_COMPAT
static long gt1x_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
void __user *arg32 = compat_ptr(arg);
if (!file->f_op || !file->f_op->unlocked_ioctl)
return -ENOTTY;
return file->f_op->unlocked_ioctl(file, cmd, (unsigned long)arg32);
}
#endif
static const struct file_operations gt1x_fops = {
.owner = THIS_MODULE,
#if GTP_GESTURE_WAKEUP
.read = gt1x_gesture_data_read,
.write = gt1x_gesture_data_write,
#endif
.unlocked_ioctl = gt1x_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = gt1x_compat_ioctl,
#endif
};
#if GTP_HOTKNOT
static const struct file_operations hotknot_fops = {
.open = hotknot_open,
.release = hotknot_release,
.unlocked_ioctl = gt1x_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = gt1x_compat_ioctl,
#endif
};
static struct miscdevice hotknot_misc_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = HOTKNOT_NODE,
.fops = &hotknot_fops,
};
#endif
s32 gt1x_init_node(void)
{
#if GTP_GESTURE_WAKEUP
struct proc_dir_entry *proc_entry = NULL;
mutex_init(&gesture_data_mutex);
memset(gestures_flag, 0, sizeof(gestures_flag));
memset((u8 *) & gesture_data, 0, sizeof(st_gesture_data));
proc_entry = proc_create(GESTURE_NODE, 0666, NULL, &gt1x_fops);
if (proc_entry == NULL) {
GTP_ERROR("CAN't create proc entry /proc/%s.", GESTURE_NODE);
return -1;
} else {
GTP_INFO("Created proc entry /proc/%s.", GESTURE_NODE);
}
#endif
#if GTP_HOTKNOT
if (misc_register(&hotknot_misc_device)) {
GTP_ERROR("CAN't create misc device in /dev/hotknot.");
return -1;
} else {
GTP_INFO("Created misc device in /dev/hotknot.");
}
#endif
return 0;
}
void gt1x_deinit_node(void)
{
#if GTP_GESTURE_WAKEUP
remove_proc_entry(GESTURE_NODE, NULL);
#endif
#if GTP_HOTKNOT
misc_deregister(&hotknot_misc_device);
#endif
}

View File

@@ -0,0 +1,551 @@
/* drivers/input/touchscreen/gt1x_firmware.h
*
* 2010 - 2014 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#ifndef _GT1X_FIRMWARE_H_
#define _GT1X_FIRMWARE_H_
unsigned char gt1x_default_FW[] =
{
};
#if GTP_HOTKNOT
unsigned char gt1x_patch_jump_fw[] = {
0xa8,0x3f,0x06,0xec,0xd9,0x50,0xf5,0xbf,0xb9,0xc2,0xec,0x5c,0x94,0x2c,0xd0,0xc0,
0x56,0x1b,0x01,0xaa,0xea,0x04,0xe0,0xa8,0x36,0x37,0xd4,0xbf,0x33,0xfe,0xea,0x9e,
0x7b,0xf0,0x20,0x46,0x80,0x73,0x6b,0x4e,0x3f,0x27,0x51,0x1e,0x3d,0x80,0x05,0x01,
0x2d,0xee,0x85,0x0f,0xa9,0x87,0x11,0x29,0x24,0xef,0x2c,0x47,0xc0,0x75,0x24,0xac,
0x41,0xb6,0x31,0x8c,0x3f,0xa3,0x95,0x98,0x50,0xe2,0x51,0x2d,0x9a,0xcb,0x14,0x6e,
0xb7,0x17,0xc1,0x85,0x2e,0x04,0x5d,0xa9,0xc5,0x0d,0x8a,0x46,0x59,0x69,0x13,0x55,
0xfb,0xbf,0x92,0xcb,0xc2,0xc0,0x63,0xdc,0x0a,0x94,0xfd,0x09,0x76,0x5c,0xd2,0xc6,
0xf2,0x21,0x03,0x81,0x7f,0xa9,0xe9,0xae,0x5d,0x04,0xff,0x98,0x5a,0x70,0xc3,0xd7,
0x09,0x0c,0xd1,0x7b,0xc4,0x88,0x81,0x2a,0xe1,0x36,0x78,0xbc,0x93,0x53,0xbf,0x04,
0x30,0x9f,0xa5,0x01,0xa2,0x98,0x80,0x58,0xe0,0x30,0xb0,0x86,0xbe,0x7c,0x70,0x7b,
0x39,0x8e,0x24,0x15,0xbb,0xf6,0x7d,0xab,0x06,0xc1,0xba,0xd7,0x28,0x5d,0x58,0xec,
0x8f,0xef,0x09,0x2b,0xb4,0xff,0xdd,0xe6,0x42,0x79,0xae,0x4b,0x21,0x4d,0xd1,0xa4,
0x62,0x88,0x0b,0x17,0x8d,0xc5,0x35,0x25,0xbc,0x47,0x2d,0x10,0x52,0x79,0x0a,0x4c,
0x0b,0x2e,0x7d,0xd2,0x5b,0xde,0x8b,0xe5,0x17,0x2d,0xe8,0xf8,0xf5,0x90,0xd9,0x65,
0xcf,0x3f,0xf6,0xf1,0xe7,0x10,0x49,0x6f,0xf3,0x22,0xb1,0x11,0x51,0x60,0xda,0x2c,
0xe7,0x26,0xb8,0xbc,0x70,0xf7,0xd9,0xf1,0x31,0x5f,0x37,0xd9,0x1b,0x1f,0x98,0x80,
0xeb,0xf2,0xa0,0x60,0x7b,0x06,0xb8,0x1c,0x15,0x54,0xe3,0x54,0x8e,0x24,0x21,0x7b,
0x4c,0xb0,0x20,0x15,0xec,0x97,0xf0,0x73,0x1c,0xb8,0x06,0x5e,0x5c,0xfe,0xc0,0x77,
0x01,0x85,0xe0,0x02,0x45,0xcf,0x01,0xcb,0x93,0x49,0x96,0x99,0x43,0x27,0x78,0x7e,
0x6d,0xd7,0xcc,0x9e,0xa4,0xe7,0x33,0x17,0x44,0x09,0x04,0xac,0xb9,0xe7,0x52,0x75,
0x51,0xfd,0xc9,0x50,0x1d,0xfa,0x22,0x63,0xc2,0x46,0x09,0x64,0xab,0x06,0xf0,0x3c,
0xe8,0xab,0x80,0xd5,0x7e,0x66,0xf6,0x28,0xc7,0x3c,0xc3,0x1f,0xa4,0x76,0x72,0x10,
0x7b,0xe9,0xd4,0xb9,0x9c,0xf4,0xc6,0xa4,0xf1,0xd9,0xf4,0x24,0xc7,0x97,0x51,0x13,
0xf7,0x59,0x80,0x50,0xa2,0x25,0xed,0x4f,0x88,0x27,0x4d,0x66,0xdf,0x17,0x71,0x7f,
0xdd,0x89,0xa6,0x11,0xa8,0x6e,0xba,0x1c,0x17,0xde,0x5b,0x10,0xb2,0xef,0x7e,0x64,
0xd9,0x38,0xc0,0x29,0xee,0x9f,0xfc,0x36,0xe4,0x3c,0xf0,0x7d,0x5e,0xf6,0x98,0x7f,
0x74,0xae,0x57,0x90,0x2b,0x09,0x29,0x27,0xb8,0x5f,0xf8,0xa7,0xae,0x2f,0x70,0xd6,
0x45,0x04,0x5e,0x96,0xef,0x9e,0x38,0x79,0xb3,0x51,0x97,0x9d,0xbb,0xeb,0x5a,0x7d,
0xc4,0xca,0xd6,0x07,0xb1,0xc3,0xae,0x37,0xea,0xd5,0xaa,0x36,0x42,0x8e,0x3b,0x6c,
0xb4,0x50,0xca,0xde,0x4a,0x2a,0x6f,0x14,0x25,0x5b,0x74,0x04,0xa6,0x7e,0x7e,0x06,
0xcb,0x39,0xea,0xdf,0x14,0x7e,0xdf,0x26,0x3b,0xe9,0x13,0x5f,0xaf,0x8f,0xb9,0x91,
0xb5,0xd8,0x30,0x04,0x99,0x08,0x01,0xfb,0xf2,0x47,0xd1,0x07,0x85,0xfc,0x58,0x79,
0xd8,0x0a,0xdb,0x0f,0xe1,0xe6,0xcf,0x60,0x31,0xd6,0x4c,0x5d,0xb1,0x50,0x35,0x92,
0x9c,0xf8,0x46,0x61,0x12,0xf8,0x05,0x6c,0x01,0x52,0x4f,0x40,0x05,0xa4,0x47,0xbc,
0x01,0x2a,0x65,0xe4,0x81,0xc9,0xa7,0x31,0x69,0x17,0x3d,0x43,0x4b,0x06,0x27,0x8c,
0x3b,0x0b,0x14,0xef,0x54,0x93,0x0c,0x87,0x40,0x53,0x83,0x42,0xa3,0x35,0x17,0xe7,
0x82,0xb9,0xf3,0x96,0x2b,0x4b,0x89,0xa9,0x42,0x86,0xc7,0x23,0x88,0x04,0x15,0x9b,
0x7f,0xa1,0x83,0x28,0x6a,0x66,0x44,0xe9,0xaf,0x85,0x96,0x46,0x80,0x51,0xf6,0x6f,
0x83,0xb9,0x6f,0xb7,0x31,0xeb,0x82,0x9e,0x0e,0xe4,0xa2,0x05,0x89,0x05,0x95,0x59,
0x78,0xeb,0x6c,0xe3,0x05,0x6d,0xb2,0x81,0x4f,0x00,0x6c,0xec,0x0e,0x95,0x76,0x6d,
0xf6,0x58,0x4f,0x78,0x8d,0x61,0xc5,0x34,0x72,0xca,0x56,0xd3,0xba,0x62,0x6f,0x7b,
0x22,0x0a,0xee,0x43,0xfb,0x65,0x4c,0xa2,0xe0,0x98,0xcd,0xcb,0xc5,0xba,0xc4,0xcd,
0x29,0x2b,0x1d,0xee,0x1a,0x55,0x9a,0x46,0xe0,0xdf,0xcc,0xda,0x09,0xd5,0xcc,0x27,
0x0b,0x1a,0xc8,0x44,0x32,0xf7,0x94,0x66,0x62,0x87,0xaa,0xcb,0x7b,0x68,0xef,0x56,
0x5a,0xb1,0x3d,0x24,0x84,0x3c,0x25,0x41,0x1b,0xcb,0x04,0x4c,0x1d,0x8c,0xdc,0xe4,
0x47,0x77,0xae,0x12,0x84,0x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,0x64,0xff,0x54,0x96,0x50,0xa0,0xc4,0x3f,0x74,0x23,0x85,0x57,0xbc,0x34,
0x4a,0xce,0xa6,0x4d,0xa8,0xe6,0xe1,0x28,0x25,0x75,0xde,0xf6,0x8e,0x6c,0x7b,0xbc,
0x7a,0x99,0x43,0xb1,0x54,0x9a,0x0e,0x95,0x19,0x52,0x84,0x4a,0x9e,0xba,0x3b,0xf0,
0x67,0x88,0xce,0xb2,0xd3,0xc4,0xe6,0x49,0xc3,0xab,0x32,0x98,0xcf,0x3f,0x05,0xf1,
0xaa,0x98,0xd3,0xb6,0x8a,0xe6,0xe3,0xb8,0x8d,0x35,0xc7,0xdd,0xb5,0x04,0x5c,0xf9,
0x88,0x0c,0xa1,0x8a,0xb8,0xff,0xf9,0x23,0xd4,0x80,0xe1,0x30,0xe8,0x27,0x9e,0x21,
0x8b,0x72,0x42,0xbe,0xe5,0x65,0x73,0xbe,0x52,0xcb,0xe2,0x4c,0xa2,0xc7,0x77,0xce,
0x7e,0xe3,0x02,0x4a,0x9f,0xa4,0x96,0x3e,0x71,0x65,0x98,0x4f,0x32,0x85,0x0c,0x41,
0x71,0x93,0x84,0x23,0xb6,0x6d,0x12,0x67,0x13,0x30,0x62,0x02,0x4d,0x72,0x38,0x00,
0x28,0x47,0xa1,0x46,0x38,0xac,0xc2,0x69,0x09,0x7a,0xe5,0x5f,0x10,0x33,0x9a,0xe9,
0x60,0x56,0xa2,0xfa,0x80,0x58,0x15,0x19,0x77,0x16,0xcd,0x9a,0xf6,0x73,0x9a,0x6a,
0x68,0xb3,0x03,0x62,0x3e,0x02,0x50,0x27,0x72,0x07,0x3d,0x40,0x0d,0x17,0x5c,0x03,
0x77,0xe0,0xea,0xc4,0xec,0x27,0x30,0x6a,0x99,0x3a,0x5b,0x9a,0xf7,0x72,0x42,0xcb,
0x3a,0xd8,0xff,0x07,0xea,0x0b,0xbb,0x2e,0x28,0xaa,0xc0,0x44,0xf0,0xac,0xb1,0x2b,
0x6a,0x5c,0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6b,0xa0,0xe4,
0x50,0xad,0xee,0x46,0x5c,0x34,0xf5,0xf0,0x55,0x17,0x41,0x99,0xda,0x89,0xaf,0xea,
0x49,0x44,0x07,0xc2,0xfb,0x69,0xb7,0x06,0xe3,0x7c,0xaa,0x84,0xe4,0x18,0x0e,0xe9,
0x77,0xe6,0x81,0x9b,0x68,0xd3,0x42,0x7b,0xaf,0x01,0xf4,0x53,0x69,0x05,0x06,0xf8,
0x25,0x68,0x4f,0x57,0xca,0x09,0xbf,0xae,0xf2,0x61,0x4a,0xc5,0xcc,0x9a,0xb5,0x8b,
0x52,0xe7,0x6c,0xcb,0x2a,0x9a,0x84,0xb9,0x3e,0xc1,0xac,0x5a,0xc3,0x5c,0xb6,0x0a,
0x5b,0x69,0xcd,0xca,0x87,0x4c,0x3d,0x2b,0x4d,0x8b,0x35,0x4b,0xa1,0x2a,0xda,0xf6,
0x80,0x0d,0x0f,0xc3,0x83,0x18,0x1c,0xef,0xfb,0x70,0x91,0xc6,0x85,0x8f,0xb4,0x48,
0x0f,0x3b,0x38,0x53,0x3d,0x42,0x18,0x70,0x8a,0x82,0x9e,0x81,0xac,0x8c,0x4e,0x11,
0x02,0x5d,0xac,0x20,0x42,0x8d,0xee,0xae,0x32,0x43,0xea,0x12,0x01,0x04,0x71,0x72,
0xdc,0x37,0x0d,0xca,0x41,0x4d,0x27,0xef,0x8c,0x2c,0x0c,0xcc,0x64,0x90,0x2b,0x8d,
0xbf,0x6b,0x83,0xcd,0x55,0x56,0x39,0x01,0x69,0x5f,0x24,0x8b,0x40,0xe4,0x2e,0xf9,
0x44,0xc6,0x6c,0x9d,0x9c,0x7d,0xdd,0xd3,0x67,0x26,0xfd,0x20,0xaa,0x13,0x72,0xec,
0x26,0x93,0x86,0x97,0xc1,0xe7,0x57,0x2e,0x6c,0xc3,0x4f,0x78,0x69,0x32,0xec,0x3b,
0x6f,0x78,0x07,0x9f,0xbb,0x27,0xb2,0xae,0x0d,0x50,0xca,0x7f,0x1a,0xd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x97,0xf4,0x97,0x85,0x9b,0x54,0xbe,0x30,0x72,0xb2,0x80,0x77,
0x41,0x43,0x8a,0x8f,0x1a,0xab,0x7f,0xc6,0x68,0x3d,0x63,0xd9,0x8b,0xc5,0x56,0xaa,
0x63,0xfc,0x26,0x85,0x85,0x75,0xd5,0xac,0xf9,0x78,0xe2,0xce,0x0d,0xb3,0x00,0x75,
0x68,0xe5,0xe7,0x8b,0x1f,0xb9,0xe9,0x5b,0x48,0xb2,0xbd,0xcb,0x0f,0x99,0xa9,0x1b,
0x62,0x53,0xa4,0x88,0x17,0xa9,0xe8,0x5a,0x00,0x10,0x06,0x85,0x07,0x89,0xa8,0x1a,
0x01,0x03,0x20,0x8b,0x1e,0xb8,0x69,0x59,0xe1,0x01,0x87,0xe6,0x0e,0x98,0x29,0x19,
0x23,0x4e,0xc6,0x82,0x16,0xa8,0x68,0x58,0x01,0x11,0x86,0x47,0x06,0x88,0x28,0x18,
0x72,0x17,0x6f,0xa8,0xfa,0x59,0x9e,0x8c,0x49,0xda,0x4f,0x79,0x06,0xaa,0x91,0x31,
0xdd,0x16,0xfe,0x8f,0x8a,0xa1,0x39,0xaf,0x9b,0xc9,0xc1,0x54,0x2a,0xbc,0x89,0xa3,
0x5b,0x79,0x73,0x7a,0x8b,0x6d,0xdc,0xa5,0x4d,0x2d,0x2d,0x49,0xb3,0x2f,0xdc,0xea,
0x23,0x3e,0x2c,0x03,0x0b,0x8c,0xfe,0xa5,0x43,0x5d,0x8d,0x84,0xe1,0x61,0x7e,0x8e,
0x1a,0xc8,0x0f,0x8b,0x1d,0xb1,0xe1,0x53,0x0a,0x4e,0xaf,0x53,0x0d,0x91,0xa1,0x13,
0x12,0x7e,0x8d,0x85,0x15,0xa1,0xe0,0x52,0x42,0x42,0xbc,0x70,0x05,0x81,0xa0,0x12,
0xd8,0xa9,0x22,0x73,0x1c,0xb0,0x61,0x51,0x34,0xef,0x57,0xc5,0x0c,0x90,0x21,0x11,
0x9d,0x29,0x2c,0x89,0x14,0xa0,0x60,0x50,0x23,0x8d,0x12,0x52,0x04,0x80,0x20,0x10,
0xa7,0x80,0x02,0x96,0x64,0xd8,0xd9,0x1b,0x4f,0x26,0xfd,0xdb,0xcc,0x82,0xdf,0xf7,
0x4c,0xd6,0x18,0x11,0xcc,0xd6,0x92,0x3a,0xc4,0xd4,0x87,0xd3,0x04,0xfb,0xdf,0x54,
0xad,0x42,0x45,0x9d,0xd4,0x9e,0x31,0xa7,0x0e,0x41,0x41,0x52,0x7b,0x59,0x1b,0x4f,
0x55,0x11,0xa0,0x1a,0xa9,0x75,0x19,0xbc,0xd0,0x97,0x35,0xd0,0xb6,0x8b,0x35,0xb6,
0x9b,0x40,0xa2,0xa9,0x1b,0x39,0xc9,0x4b,0xe4,0x60,0x67,0xb9,0x0b,0x19,0x89,0x0b,
0xd3,0x30,0x58,0xb5,0x13,0x29,0xc8,0x4a,0x55,0xf2,0x43,0x94,0x03,0x09,0x88,0x0a,
0xde,0x21,0x55,0xf3,0x1a,0x38,0x49,0x49,0xca,0x01,0xc2,0x96,0x0a,0x18,0x09,0x09,
0xed,0x89,0xfa,0x9b,0x12,0x28,0x48,0x48,0xed,0x0c,0x18,0x28,0x02,0x08,0x08,0x08,
0x1c,0x68,0xae,0xd0,0x0e,0xb0,0xbb,0xcd,0x11,0x0b,0x8d,0xde,0x61,0x4c,0x2f,0x5a,
0x32,0x78,0xf0,0x24,0x84,0xba,0xbf,0xb1,0x46,0x38,0xe5,0xd5,0x34,0xf2,0x9c,0x54,
0xec,0x69,0x2e,0xd2,0x4f,0xb5,0xba,0xe6,0x13,0xe9,0x4f,0xbf,0xe6,0xc8,0x8a,0xc2,
0x80,0xc5,0x5c,0x47,0x6b,0xfd,0xfe,0x04,0x07,0x41,0x41,0xd6,0xac,0x09,0x7c,0x65,
0x0e,0x3b,0xad,0x8e,0x19,0x31,0xc1,0x43,0x89,0x15,0x91,0x23,0x09,0x11,0x81,0x03,
0x66,0x7d,0xce,0x92,0x11,0x21,0xc0,0x42,0x81,0x05,0x90,0x22,0x01,0x01,0x80,0x02,
0xa7,0x95,0x7b,0x98,0x18,0x30,0x41,0x41,0x88,0x14,0x11,0x21,0x08,0x10,0x01,0x01,
0x0f,0x9a,0x23,0x92,0x10,0x20,0x40,0x40,0x80,0x04,0x10,0x20,0x00,0x00,0x54,0x3c,
};
unsigned char hotknot_transfer_fw[] = {
};
unsigned char hotknot_auth_fw[] = {
0xa8,0x3f,0x06,0xee,0xd9,0x50,0xf5,0xbf,0xb9,0xc2,0xec,0x5c,0x94,0x2c,0xd0,0xc0,
0x56,0x1b,0x01,0xaa,0xea,0x04,0xe0,0xa8,0x36,0x37,0xd4,0xbf,0x33,0xfe,0xea,0x9e,
0x7b,0xf0,0x20,0x46,0x80,0x73,0x6b,0x4e,0x3f,0x27,0x51,0x1e,0x3d,0x80,0x05,0x01,
0x2d,0xee,0x85,0x0d,0xa9,0x87,0x11,0x29,0x24,0xef,0x2c,0x47,0xc0,0x75,0x24,0xac,
0x41,0xb6,0x31,0x8c,0x3f,0xa3,0x95,0x98,0x50,0xe2,0x51,0x2d,0x9a,0xcb,0x14,0x6e,
0xb7,0x17,0xc1,0x85,0x2e,0x04,0x5d,0xa9,0xc5,0x0d,0x8a,0x46,0x59,0x69,0x13,0x55,
0xfb,0xbf,0x92,0xcb,0xc2,0xc0,0x63,0xdc,0x0a,0x94,0xfd,0x09,0x76,0x5c,0xd2,0xc6,
0xf2,0x21,0x03,0x81,0x7f,0xa9,0xe9,0xae,0x5d,0x04,0xff,0x98,0x5a,0x70,0xc3,0xd7,
0x09,0x0c,0xd3,0x53,0xc4,0x88,0x83,0x2a,0xe1,0x36,0x78,0xbc,0x93,0x53,0xbf,0x04,
0x30,0x9f,0xa5,0x01,0xa2,0x98,0x82,0x58,0xe0,0x30,0xb0,0x86,0xbe,0x7c,0x70,0x7b,
0x39,0x8e,0x24,0x15,0xbb,0xf6,0x7d,0xab,0x06,0xc1,0xba,0xd7,0x28,0x5d,0x58,0xec,
0x8f,0xef,0x09,0x2b,0xb4,0xff,0xdd,0xe6,0x42,0x79,0xae,0x4b,0x21,0x4d,0xd1,0xa4,
0x62,0x88,0x0b,0x17,0x8d,0xc5,0x35,0x25,0xbc,0x47,0x2d,0x10,0x52,0x79,0x0a,0x4c,
0x0b,0x2e,0x7d,0xd2,0x5b,0xde,0x8b,0xe5,0x17,0x2d,0xe8,0xf8,0xb5,0xd1,0xd9,0x65,
0xcf,0x3f,0xf6,0xf1,0xe7,0x10,0x49,0x6f,0xf3,0x22,0xb1,0x11,0x51,0x60,0xda,0x2c,
0xe7,0x26,0xb8,0xbc,0x70,0xf7,0xd9,0xf1,0x31,0x5f,0x37,0xd9,0x1b,0x1f,0x98,0x80,
0xeb,0xf2,0xa0,0x60,0x7b,0x06,0xb8,0x1c,0x15,0x54,0xe3,0x54,0x8e,0x24,0x21,0x7b,
0x4c,0xb0,0x20,0x15,0xec,0x97,0xf0,0x73,0x1c,0xb8,0x06,0x5e,0x5c,0x7e,0xc0,0x77,
0x01,0x85,0xe0,0x02,0x45,0x4f,0x01,0xcb,0x93,0x49,0x96,0x99,0x43,0x27,0x78,0x7e,
0x6d,0x57,0xcc,0x9e,0xe4,0xe7,0x33,0x17,0x44,0x09,0x04,0xac,0xb9,0xe7,0x52,0x75,
0x51,0xfd,0xc9,0x50,0x1d,0xfa,0x22,0x63,0xc2,0x46,0x09,0x64,0xab,0x06,0xf0,0x3c,
0xe8,0xab,0x80,0xd5,0x7e,0x66,0xf6,0x28,0xc7,0x3c,0xc3,0x1f,0xa4,0x76,0x72,0x10,
0x7b,0xe9,0xd4,0xb9,0x9c,0xf4,0xc6,0xa4,0xf1,0xd9,0xf4,0x24,0xc7,0x97,0x51,0x13,
0xf7,0x59,0x80,0x50,0xa2,0x25,0xed,0x4f,0x88,0x27,0x4d,0x66,0xdf,0x17,0x71,0x7f,
0xdd,0x89,0xa6,0x11,0xa8,0x6e,0xba,0x1c,0x17,0xde,0x5b,0x10,0xb2,0xef,0x7e,0x66,
0xd9,0x38,0xc0,0x29,0xee,0x9f,0xfc,0x36,0xe4,0x3c,0xf2,0x7d,0x5e,0x76,0x98,0x7f,
0x74,0xae,0x57,0x90,0x2b,0x09,0x2b,0x27,0xb8,0x5f,0xf8,0xa7,0xae,0x2f,0x70,0xd6,
0x45,0x04,0x5e,0x96,0xef,0x9e,0x38,0x79,0xb3,0x51,0x97,0x9d,0xbb,0xeb,0x5a,0x7d,
0xc4,0xca,0xd6,0x07,0xb1,0xc3,0xae,0x37,0xea,0xd5,0xaa,0x36,0x42,0x8e,0x3b,0x6c,
0xb4,0x50,0xca,0xde,0x4a,0x2a,0x6f,0x14,0x25,0x5b,0x74,0x04,0xa6,0x7e,0x7e,0x06,
0xcb,0x39,0xea,0xdf,0x14,0x7e,0xdf,0x26,0x3b,0xe9,0x13,0x5f,0xaf,0x8f,0xb9,0x91,
0xb5,0xd8,0x30,0x04,0x99,0x08,0x01,0xfb,0xf2,0x47,0xd1,0x07,0x85,0xfc,0x58,0x79,
0xd8,0x0a,0xdb,0x0f,0xe1,0xe6,0xcf,0x60,0x31,0xd6,0x4c,0x5d,0xb1,0x50,0x35,0x92,
0x9c,0xf8,0x46,0x61,0x12,0xf8,0x05,0x6c,0x01,0x52,0x4f,0x40,0x05,0xa4,0x47,0xbc,
0x01,0x2a,0x65,0xe4,0x81,0xc9,0xa7,0x31,0x69,0x17,0x3d,0x43,0x4b,0x06,0x27,0x8c,
0x3b,0x0b,0x14,0xef,0x54,0x93,0x0e,0x87,0x40,0x53,0x83,0x42,0xa3,0x35,0x17,0xe7,
0x82,0xb9,0xf3,0x96,0x2b,0x4b,0x89,0xa9,0x42,0x86,0xc7,0x23,0x88,0x04,0x15,0x9b,
0x7f,0xa1,0x83,0x28,0x6a,0x66,0x44,0xe9,0xaf,0x85,0x96,0x46,0x80,0x51,0xf6,0x6f,
0x83,0xb9,0x6f,0xb7,0x31,0xeb,0x82,0x9e,0x0e,0xe4,0xa2,0x05,0x89,0x05,0x95,0x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,0x98,0x4f,0x32,0x85,0x0c,0x41,
0x71,0x93,0x84,0x23,0xb6,0x6d,0x12,0x67,0x13,0x30,0x62,0x02,0x4d,0x72,0x38,0x00,
0x28,0x47,0xa1,0x46,0x38,0xac,0xc2,0x69,0x09,0x7a,0xe5,0x5f,0x10,0xb3,0x9a,0xe9,
0x60,0x56,0xa2,0xfa,0x80,0x58,0x15,0x1b,0x37,0xa6,0xcd,0x9a,0xf6,0x73,0x9a,0x6a,
0x28,0xb3,0x03,0x62,0x3e,0x02,0x50,0x27,0x72,0x07,0x3d,0x40,0x0d,0x17,0x5c,0x03,
0x77,0xe0,0xea,0xc4,0xec,0x27,0x30,0x6a,0x99,0xba,0x5b,0x9a,0xf7,0x72,0x42,0xcb,
0x3a,0xd8,0xff,0x07,0xea,0x0b,0xbb,0x2e,0x28,0xaa,0xc0,0x44,0xf0,0xac,0xb1,0x2b,
0x6a,0x5c,0x41,0x04,0x8e,0x98,0x82,0x39,0x7a,0x3b,0xc0,0x44,0x92,0x38,0xd0,0xa0,
0x3b,0x59,0x8c,0x05,0xa7,0x4e,0x39,0xab,0x6b,0x0e,0x6b,0x26,0x89,0x2f,0x1a,0x6e,
0x41,0xe7,0x2a,0x06,0xa3,0x1a,0x18,0x6f,0x79,0xb9,0x4b,0x6f,0x5b,0xf6,0x9e,0x66,
0x82,0x82,0x91,0xa5,0xc0,0xaa,0x9a,0x91,0x2a,0x0e,0x0a,0x03,0x72,0x26,0xf9,0x09,
0x22,0x5e,0x88,0x69,0x7b,0xbe,0xb7,0x22,0x05,0x58,0x38,0x4d,0xf4,0x7b,0xca,0xc1,
0x96,0xb7,0x77,0xd7,0xa3,0x47,0xba,0xa5,0xeb,0xdb,0xea,0x33,0xfd,0x6a,0x13,0x61,
0x33,0x2a,0xa5,0x8e,0xf1,0xb5,0xdd,0xe0,0x84,0xb9,0xbc,0x3b,0x7b,0x37,0xff,0xf8,
0xc2,0xe2,0xdf,0x9c,0xbc,0x7f,0xd9,0x73,0x6a,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0x3d,0x42,0x18,0x72,0x8a,0x82,0x9e,0x81,0xac,0x8c,0x4e,0x11,
0x02,0x5d,0xac,0x20,0x42,0x8d,0xee,0xae,0x32,0x43,0xea,0x12,0x01,0x04,0x71,0x72,
0xdc,0x37,0x0d,0xca,0x3a,0x4d,0x27,0xef,0x8c,0x2c,0x0c,0xcc,0x64,0x90,0x2b,0x8d,
0xbf,0x6b,0x83,0xcd,0x55,0x56,0x39,0x01,0x69,0x5f,0x24,0x8b,0x40,0xe4,0x2e,0xf9,
0x44,0xc6,0x6c,0x9d,0x9c,0x7d,0xdd,0xd3,0x67,0x26,0xff,0x20,0xaa,0x13,0x72,0xee,
0x26,0x93,0x86,0x97,0xc1,0xe7,0x57,0x2e,0x6c,0xc3,0x4f,0x78,0x69,0x32,0xee,0x3b,
0x6f,0x78,0x07,0x9f,0xbb,0x27,0xb2,0xac,0x0d,0x50,0xca,0x7f,0x1a,0xd6,0xc6,0x5d,
0xa5,0x07,0x04,0x6c,0x92,0xef,0x36,0xf7,0xed,0xc2,0xcb,0x7c,0x95,0xb0,0x74,0xb7,
0x32,0x66,0xcd,0xd7,0x24,0x11,0xe8,0xb7,0xcf,0x00,0xc3,0x54,0xcb,0x43,0x8d,0xfc,
0x4d,0xf2,0x86,0x1c,0x0b,0x29,0xd6,0x63,0x11,0x97,0x61,0xab,0x92,0x14,0xd0,0xb4,
0x51,0xd8,0x82,0x90,0x8b,0xd2,0x3b,0x3b,0x8d,0xe1,0x73,0x94,0x73,0x6d,0xf5,0x36,
0x23,0xb3,0xa3,0xba,0x16,0xf3,0x07,0xf3,0x2c,0x0a,0xe5,0x2c,0x51,0x7d,0x0c,0x07,
0x76,0xe8,0x30,0x9e,0xce,0x89,0x9f,0xbe,0x64,0x28,0xe4,0xd4,0x8e,0x51,0x95,0x7b,
0x51,0x78,0x8c,0x11,0xac,0x7c,0xbf,0x9d,0xa9,0x3e,0xf6,0x9b,0xd3,0xcf,0x4b,0x26,
0xaf,0x82,0x0d,0x10,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,0x2d,0x93,0xa5,0x93,
0x2a,0x18,0xad,0x00,0x35,0xa3,0xe4,0xd2,0xca,0x1a,0x0a,0x6d,0x25,0x83,0xa4,0x92,
0x4b,0xee,0x6b,0x01,0x3c,0xb2,0x65,0xd1,0x6b,0xb9,0x31,0x41,0x2c,0x92,0x25,0x91,
0x41,0x58,0x28,0x02,0x34,0xa2,0x64,0xd0,0x23,0x1b,0x8a,0x0f,0x24,0x82,0x24,0x90,
0x05,0x62,0xa2,0x13,0xfb,0x66,0x91,0xba,0xac,0x12,0x62,0x3d,0xec,0x26,0xa4,0xbe,
0x04,0xb5,0x80,0x9b,0x40,0x10,0xe6,0x37,0x45,0xae,0xc4,0xee,0xc6,0x6b,0xd2,0x77,
0x82,0xf3,0x03,0x14,0x78,0x67,0x32,0x7a,0x2f,0x49,0x34,0x1d,0xcf,0x7b,0x53,0x17,
0xf3,0x73,0x85,0xee,0xb5,0x45,0x0e,0x3c,0x0b,0x10,0x0a,0x17,0x3e,0x75,0x92,0xad,
0x24,0x80,0xc0,0xc9,0x3b,0x3b,0xcd,0xcb,0x2c,0xc4,0xe0,0x5c,0x2b,0x1b,0x8d,0x8b,
0xdc,0x52,0xab,0x62,0x33,0x2b,0xcc,0xca,0x24,0x8f,0xc0,0x14,0x23,0x0b,0x8c,0x8a,
0x3d,0xe6,0x5f,0x19,0x3a,0x3a,0x4d,0xc9,0xa1,0x83,0x1d,0xdb,0x2a,0x1a,0x0d,0x89,
0x75,0x2f,0x21,0x33,0x32,0x2a,0x4c,0xc8,0x67,0x0a,0x10,0xac,0x22,0x0a,0x0c,0x88,
0x44,0xe8,0x2a,0x98,0xbe,0x5c,0xd7,0x37,0x2c,0x19,0x4a,0xf7,0xee,0x8b,0x1b,0x11,
0xda,0xea,0x8a,0x1f,0x65,0x1e,0x98,0xb3,0x60,0xbe,0x88,0xda,0x50,0x42,0x96,0xc4,
0x5f,0xc1,0x2a,0x12,0xe7,0xc9,0xbf,0x78,0xb3,0xcb,0x88,0x50,0xef,0x89,0x53,0x7d,
0x07,0xbe,0x0a,0xe0,0x72,0x7f,0x18,0xb1,0xbe,0x4a,0x65,0x56,0x27,0xf0,0x53,0xde,
0xb7,0xaa,0xd1,0xa1,0x39,0x33,0xc5,0xc3,0x52,0x6c,0xb9,0xa4,0x29,0x13,0x85,0x83,
0xf5,0x3a,0xd8,0x78,0x31,0x23,0xc4,0xc2,0xe1,0x1a,0x4f,0x1d,0x21,0x03,0x84,0x82,
0xb8,0x4b,0x2e,0xf3,0x38,0x32,0x45,0xc1,0xc7,0x6b,0xeb,0x33,0x28,0x12,0x05,0x81,
0xf0,0x3b,0xd4,0x3f,0x30,0x22,0x44,0xc0,0x36,0xf9,0xcf,0x1e,0x20,0x02,0x04,0x80,
0x18,0xd2,0xeb,0x8f,0x98,0x3b,0xff,0xe4,0x60,0x39,0x6e,0x4d,0xc8,0x01,0xf7,0xac,
0x62,0xe9,0xa6,0x8c,0x97,0xf4,0x97,0x85,0x9b,0x54,0xbe,0x30,0x8b,0xb2,0xc2,0x6d,
0x41,0x43,0x8a,0x8f,0x1a,0xab,0x7f,0xc6,0x68,0x3d,0x63,0xd9,0x02,0xe1,0x68,0xac,
0x63,0xfc,0x26,0x85,0x85,0x75,0xd5,0xac,0xf9,0xf8,0xe2,0xce,0x29,0xb5,0x01,0xa9,
0x2a,0x5f,0x47,0x81,0x1f,0xb9,0xe9,0x5b,0x08,0x00,0x07,0x44,0x0f,0x99,0xa9,0x1b,
0xd3,0xb0,0xab,0x78,0x17,0xa9,0xe8,0x5a,0x3f,0xf6,0xdc,0xce,0x07,0x89,0xa8,0x1a,
0x19,0xc1,0x87,0x81,0x1e,0xb8,0x69,0x59,0x09,0x47,0x27,0x59,0x0e,0x98,0x29,0x19,
0x11,0x77,0x05,0x8f,0x16,0xa8,0x68,0x58,0x41,0x4b,0x34,0x7a,0x06,0x88,0x28,0x18,
0x72,0x17,0x6f,0xa8,0xfa,0x59,0x9e,0x8c,0x49,0xda,0x4f,0x79,0xe8,0xf0,0xff,0x8d,
0xdd,0x16,0xfe,0x8f,0x8a,0xa1,0x39,0xaf,0x9b,0xc9,0xc1,0x54,0x19,0x60,0x3e,0x37,
0x5b,0x79,0x73,0x7a,0x8b,0x6d,0xdc,0xa5,0x4d,0x2d,0x2d,0x49,0xe9,0x4d,0x7f,0xec,
0x23,0x3e,0x2c,0x03,0xa3,0x9a,0x3c,0x21,0x43,0x5d,0x8d,0x84,0xc3,0x18,0xbe,0x35,
0x94,0x38,0xad,0x8a,0x1d,0xb1,0xe1,0x53,0x2a,0x9c,0x93,0x51,0x0d,0x91,0xa1,0x13,
0x91,0xb8,0xae,0x07,0x15,0xa1,0xe0,0x52,0x8e,0x18,0x0e,0xed,0x05,0x81,0xa0,0x12,
0x6b,0xfd,0x2f,0x04,0x1c,0xb0,0x61,0x51,0xdc,0x4f,0x4c,0xcd,0x0c,0x90,0x21,0x11,
0xec,0x0b,0x8e,0x80,0x14,0xa0,0x60,0x50,0x03,0x19,0x8c,0x10,0x04,0x80,0x20,0x10,
0xa7,0x80,0x02,0x96,0x5a,0x64,0xb6,0xf8,0x4f,0x26,0xff,0xdb,0xbf,0x9a,0xb4,0xb5,
0x4c,0xd6,0x18,0x11,0x24,0x42,0x33,0x6f,0xc4,0xd4,0x87,0xd3,0xed,0xd1,0x03,0xc9,
0xad,0x42,0x45,0x9d,0xb8,0xf5,0x17,0xb4,0x0e,0x41,0x41,0x52,0x62,0x45,0xa7,0x50,
0x55,0x11,0xa0,0x1a,0xcd,0xb0,0xb3,0x6d,0xd0,0x97,0x35,0xd0,0x37,0xfb,0x14,0x5e,
0xe4,0x18,0x7b,0x98,0x1b,0x39,0xc9,0x4b,0xe4,0x1d,0x99,0x2b,0x0b,0x19,0x89,0x0b,
0xac,0x0c,0xa2,0x93,0x13,0x29,0xc8,0x4a,0x83,0x0d,0x98,0x2a,0x03,0x09,0x88,0x0a,
0x0d,0x32,0x25,0x84,0x1a,0x38,0x49,0x49,0x8a,0x1c,0x19,0x29,0x0a,0x18,0x09,0x09,
0x65,0x74,0x46,0x98,0x12,0x28,0x48,0x48,0x82,0x0c,0x18,0x28,0x02,0x08,0x08,0x08,
0x1c,0x68,0xae,0xd0,0xc6,0xa9,0x3a,0x56,0x11,0x0b,0x8d,0xde,0xa5,0x18,0xfd,0x66,
0x32,0x78,0xf0,0x24,0xae,0xba,0x3b,0x67,0x46,0x38,0xe5,0xd5,0x91,0xe4,0x88,0x65,
0xec,0x69,0x2e,0xd2,0x3c,0x8f,0xbc,0xba,0x13,0xe9,0x4f,0xbf,0xb2,0x32,0x25,0x07,
0x80,0xc5,0x5c,0x47,0x84,0xd9,0x41,0xf9,0x07,0x41,0x41,0xd6,0x84,0x6f,0xf1,0x77,
0x06,0x8b,0xa2,0x91,0x19,0x31,0xc1,0x43,0x89,0x15,0x91,0x23,0x09,0x11,0x81,0x03,
0x06,0xfe,0xad,0x95,0x11,0x21,0xc0,0x42,0x81,0x05,0x90,0x22,0x01,0x01,0x80,0x02,
0x6d,0xca,0x0d,0x90,0x18,0x30,0x41,0x41,0x88,0x14,0x11,0x21,0x08,0x10,0x01,0x01,
0xd9,0xb9,0x58,0x99,0x10,0x20,0x40,0x40,0x80,0x04,0x10,0x20,0x00,0x00,0x4e,0x0e,
};
#endif // GTP_HOTKNOT
#endif // _GT1X_FIRMWARE_H_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,579 @@
/* drivers/input/touchscreen/gt1x_generic.h
*
* 2010 - 2014 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#ifndef _GT1X_GENERIC_H_
#define _GT1X_GENERIC_H_
#include <linux/hrtimer.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/version.h>
#include <linux/jiffies.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/byteorder/generic.h>
#include <linux/interrupt.h>
#include <linux/time.h>
#include <linux/proc_fs.h>
#include <asm/uaccess.h>
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
#endif
/********* Device Tree Support *********/
#ifdef CONFIG_OF
#define GTP_CONFIG_OF
#endif
/***************************PART1:ON/OFF define*******************************/
#define GTP_INCELL_PANEL 0
#define GTP_DRIVER_SEND_CFG 1 // send config to TP while initializing (for no config built in TP's flash)
#define GTP_CUSTOM_CFG 0 // customize resolution & interrupt trigger mode
#define GTP_CHANGE_X2Y 0 // exchange xy
#define GTP_WARP_X_ON 0
#define GTP_WARP_Y_ON 0
#define GTP_GESTURE_WAKEUP 0 // gesture wakeup module
/* buffer used to store ges track points coor. */
#define GES_BUFFER_ADDR 0xA2A0 // GT1151
//#define GES_BUFFER_ADDR 0x8A40 // GT9L
//#define GES_BUFFER_ADDR 0x9734 // GT1152
//#define GES_BUFFER_ADDR 0xBDA8 // GT9286
#ifndef GES_BUFFER_ADDR
#warning [GOODIX] need define GES_BUFFER_ADDR .
#endif
#define KEY_GES_REGULAR KEY_F2 // regular gesture-key
#define KEY_GES_CUSTOM KEY_F3 //customize gesture-key
#define GTP_HOTKNOT 0 // hotknot module
#define HOTKNOT_TYPE 0 // 0: hotknot in flash; 1: hotknot in driver
#define HOTKNOT_BLOCK_RW 0 //
#define GTP_AUTO_UPDATE 0 // auto update FW to TP FLASH while initializing
#define GTP_HEADER_FW_UPDATE 0 // firmware in gt1x_firmware.h
#define GTP_FW_UPDATE_VERIFY 0 // verify fw when updating
#define GTP_HAVE_TOUCH_KEY 0 // touch key support
#define GTP_WITH_STYLUS 0 // pen support
#define GTP_HAVE_STYLUS_KEY 0 //
#define GTP_POWER_CTRL_SLEEP 0 // turn off power on suspend
#define GTP_ICS_SLOT_REPORT 0
#define GTP_CREATE_WR_NODE 1 // create the interface to support gtp_tools
#define GTP_PROXIMITY 0 // proximity module (function as the p-sensor)
#define GTP_SMART_COVER 0 // smart cover module
#define GTP_ESD_PROTECT 0 // esd-protection module (with a cycle of 2 seconds)
#define GTP_CHARGER_SWITCH 0 // charger plugin & plugout detect
#define GTP_DEBUG_ON 1 // enable log printed by GTP_DEBUG(...)
#define GTP_DEBUG_ARRAY_ON 0
#define GTP_DEBUG_FUNC_ON 0
/***************************PART2:TODO define**********************************/
/* Normal Configs
* TODO: puts the config info corresponded to your TP here, the following is just
* a sample config, send this config should cause the chip cannot work normally
*/
#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))
/* TODO define your config for Sensor_ID == 0 here, if needed */
#define GTP_CFG_GROUP0 {\
0x93,0xE0,0x01,0x56,0x03,0x05,0x05,0x01,0x01,0x00,\
0x00,0x05,0x50,0x3C,0x53,0x11,0x00,0x00,0x00,0x00,\
0x14,0x14,0x14,0x22,0x0A,0x04,0x00,0x00,0x00,0x00,\
0x00,0x00,0x53,0x00,0x14,0x00,0x00,0x84,0x00,0x00,\
0x3C,0x19,0x19,0x64,0x1E,0x28,0x8B,0x2B,0x0C,0x32,\
0x34,0x05,0x0D,0x20,0x33,0x60,0x13,0x02,0x24,0x00,\
0x00,0x64,0x80,0x80,0x14,0x02,0x00,0x00,0x54,0xC5,\
0x26,0xA5,0x2E,0x90,0x36,0x80,0x3F,0x75,0x47,0x6C,\
0x00,0x00,0x00,0x18,0x38,0x50,0x00,0xF0,0x50,0x3C,\
0xFF,0xFF,0x07,0x00,0x00,0x00,0x02,0x14,0x14,0x03,\
0x04,0x00,0x21,0x64,0x0A,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x32,0x20,0x50,0x3C,0x3C,0x00,0x00,0x00,0x00,0x00,\
0x04,0x0A,0x03,0x09,0x02,0x08,0x01,0x0B,0x06,0x0D,\
0x0C,0x05,0xFF,0xFF,0x00,0x01,0x02,0x03,0x04,0x05,\
0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,\
0x10,0x11,0x12,0x13,0x14,0x15,0xFF,0xFF,0xFF,0xFF,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x3C,0x00,0x05,0x1E,0x00,0x02,\
0x2A,0x1E,0x19,0x14,0x02,0x00,0x03,0x0A,0x05,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x86,\
0x22,0x03,0x00,0x00,0x33,0x00,0x0F,0x00,0x00,0x00,\
0x50,0x3C,0x50,0x00,0x00,0x00,0xBE,0xB2,0x01\
}
/* TODO define your config for Sensor_ID == 1 here, if needed */
#define GTP_CFG_GROUP1 {\
}
/* TODO define your config for Sensor_ID == 2 here, if needed */
#define GTP_CFG_GROUP2 {\
}
/* TODO define your config for Sensor_ID == 3 here, if needed */
#define GTP_CFG_GROUP3 {\
}
/* TODO define your config for Sensor_ID == 4 here, if needed */
#define GTP_CFG_GROUP4 {\
}
/* TODO define your config for Sensor_ID == 5 here, if needed */
#define GTP_CFG_GROUP5 {\
}
/*
* Charger Configs
*/
/* TODO define your config for Sensor_ID == 0 here, if needed */
#define GTP_CHARGER_CFG_GROUP0 {\
0x45,0x1C,0x02,0xC0,0x03,0x05,0x3D,0x10,0x00,0x08,\
0x00,0x05,0x50,0x28,0x5E,0x00,0x11,0x00,0x00,0x00,\
0x28,0x80,0x87,0xFE,0xC8,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x87,0x26,0x17,0x64,\
0x66,0xDF,0x07,0x91,0x31,0x18,0x0C,0x43,0x24,0x00,\
0x06,0x3C,0x8C,0x80,0x94,0x02,0x05,0x08,0x04,0xC2,\
0x49,0xA4,0x56,0x8E,0x63,0x80,0x71,0x75,0x7E,0x6E,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0F,0x23,0x04,\
0x0F,0x10,0x42,0xD8,0x0F,0x00,0x0F,0x00,0x00,0x00,\
0x00,0x00,0xFF,0xFF,0x04,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x05,0x1E,0x00,0x70,0x17,0x50,0x1E,\
0x08,0x09,0x0A,0x0B,0x0C,0x0F,0x0E,0x10,0x0D,0x12,\
0x13,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,\
0x16,0x15,0x14,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
0xFF,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,\
0x09,0x0A,0x0B,0x0C,0x0D,0xFF,0xFF,0xFF,0xFF,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC8,0x00,0x00,\
0x00,0xD0,0x24,0x1E,0x6D,0x00,0x14,0x28,0x00,0x00,\
0x10,0x00,0x00,0x00,0x00,0x00,0x6A,0xC3,0x01\
}
/* TODO define your config for Sensor_ID == 1 here, if needed */
#define GTP_CHARGER_CFG_GROUP1 {\
}
/* TODO define your config for Sensor_ID == 2 here, if needed */
#define GTP_CHARGER_CFG_GROUP2 {\
}
/* TODO define your config for Sensor_ID == 3 here, if needed */
#define GTP_CHARGER_CFG_GROUP3 {\
}
/* TODO define your config for Sensor_ID == 4 here, if needed */
#define GTP_CHARGER_CFG_GROUP4 {\
}
/* TODO define your config for Sensor_ID == 5 here, if needed */
#define GTP_CHARGER_CFG_GROUP5 {\
}
/*
* Smart Cover Configs
*/
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP0 {\
0x46,0xD0,0x02,0x64,0x02,0x05,0xBD,0x10,0x00,0x08,0x00,0x0F,0x50,0x28,0x5E,\
0x02,0x11,0x00,0x00,0x00,0x28,0x82,0x96,0xFC,0xC8,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x87,0x26,0x0B,0x64,0x66,0xDF,0x07,0x91,0x31,0x18,0x0E,0x43,0x24,0x00,\
0x04,0x28,0x6E,0x80,0x94,0x02,0x05,0x08,0x04,0xDA,0x33,0xAF,0x3F,0x92,0x4A,\
0x7F,0x56,0x71,0x62,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0F,0x19,0x04,0x0F,0x10,0x42,0xD8,0x0F,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x04,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x1E,\
0x00,0x70,0x17,0x50,0x1E,0x08,0x09,0x0A,0x0B,0x0C,0x0F,0x0E,0x10,0x0D,0x12,\
0x13,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0xFF,0xFF,\
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,\
0x09,0x0A,0x0B,0x0C,0x0D,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC8,0x00,0x00,0x00,0x00,0x24,0x1E,0x6D,\
0x00,0x14,0x28,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x9E,0x29,0x01\
}
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP1 {\
}
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP2 {\
}
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP3 {\
}
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP4 {\
}
/* TODO define your config for Sendor_ID == 0 here, if needed */
#define GTP_SMART_COVER_CFG_GROUP5 {\
}
#if GTP_CUSTOM_CFG
#define GTP_MAX_HEIGHT 854
#define GTP_MAX_WIDTH 480
#define GTP_INT_TRIGGER 1 //0:Rising 1:Falling
#define GTP_WAKEUP_LEVEL 1
#else
#define GTP_MAX_HEIGHT 4096
#define GTP_MAX_WIDTH 4096
#define GTP_INT_TRIGGER 1
#define GTP_WAKEUP_LEVEL 1
#endif
#define GTP_MAX_TOUCH 10
#if GTP_WITH_STYLUS
#define GTP_STYLUS_KEY_TAB {BTN_STYLUS, BTN_STYLUS2}
#endif
#if GTP_HAVE_TOUCH_KEY
#define GTP_KEY_TAB {KEY_BACK, KEY_HOMEPAGE, KEY_MENU, KEY_SEARCH}
#define GTP_MAX_KEY_NUM 4
#endif
/****************************PART3:OTHER define*********************************/
#define GTP_DRIVER_VERSION "V1.4<2015/07/10>"
#define GTP_I2C_NAME "Goodix-TS"
#define GT1X_DEBUG_PROC_FILE "gt1x_debug"
#define GTP_POLL_TIME 10
#define GTP_ADDR_LENGTH 2
#define GTP_CONFIG_MIN_LENGTH 186
#define GTP_CONFIG_MAX_LENGTH 240
#define GTP_MAX_I2C_XFER_LEN 250
#define SWITCH_OFF 0
#define SWITCH_ON 1
#define GTP_REG_MATRIX_DRVNUM 0x8069
#define GTP_REG_MATRIX_SENNUM 0x806A
#define GTP_REG_RQST 0x8044
#define GTP_REG_BAK_REF 0x90EC
#define GTP_REG_MAIN_CLK 0x8020
#define GTP_REG_HAVE_KEY 0x8057
#define GTP_REG_HN_STATE 0x8800
#define GTP_REG_WAKEUP_GESTURE 0x814C
#define GTP_REG_WAKEUP_GESTURE_DETAIL 0xA2A0 // need change
#define GTP_BAK_REF_PATH "/data/gt1x_ref.bin"
#define GTP_MAIN_CLK_PATH "/data/gt1x_clk.bin"
/* request type */
#define GTP_RQST_CONFIG 0x01
#define GTP_RQST_BAK_REF 0x02
#define GTP_RQST_RESET 0x03
#define GTP_RQST_MAIN_CLOCK 0x04
#define GTP_RQST_HOTKNOT_CODE 0x20
#define GTP_RQST_RESPONDED 0x00
#define GTP_RQST_IDLE 0xFF
#define HN_DEVICE_PAIRED 0x80
#define HN_MASTER_DEPARTED 0x40
#define HN_SLAVE_DEPARTED 0x20
#define HN_MASTER_SEND 0x10
#define HN_SLAVE_RECEIVED 0x08
/*Register define */
#define GTP_READ_COOR_ADDR 0x814E
#define GTP_REG_CMD 0x8040
#define GTP_REG_SENSOR_ID 0x814A
#define GTP_REG_CONFIG_DATA 0x8050
#define GTP_REG_CONFIG_RESOLUTION 0x8051
#define GTP_REG_CONFIG_TRIGGER 0x8056
#define GTP_REG_CONFIG_CHECKSUM 0x813C
#define GTP_REG_CONFIG_UPDATE 0x813E
#define GTP_REG_VERSION 0x8140
#define GTP_REG_HW_INFO 0x4220
#define GTP_REG_REFRESH_RATE 0x8056
#define GTP_REG_ESD_CHECK 0x8043
#define GTP_REG_FLASH_PASSBY 0x8006
#define GTP_REG_HN_PAIRED 0x81AA
#define GTP_REG_HN_MODE 0x81A8
#define GTP_REG_MODULE_SWITCH3 0x8058
#define GTP_REG_FW_CHK_MAINSYS 0x41E4
#define GTP_REG_FW_CHK_SUBSYS 0x5095
#define set_reg_bit(reg,pos,val) ((reg)=((reg) & (~(1<<(pos))))|(!!(val)<<(pos)))
/* cmd define */
#define GTP_CMD_SLEEP 0x05
#define GTP_CMD_CHARGER_ON 0x06
#define GTP_CMD_CHARGER_OFF 0x07
#define GTP_CMD_GESTURE_WAKEUP 0x08
#define GTP_CMD_CLEAR_CFG 0x10
#define GTP_CMD_ESD 0xAA
#define GTP_CMD_HN_TRANSFER 0x22
#define GTP_CMD_HN_EXIT_SLAVE 0x28
/* define offset in the config*/
#define RESOLUTION_LOC (GTP_REG_CONFIG_RESOLUTION - GTP_REG_CONFIG_DATA)
#define TRIGGER_LOC (GTP_REG_CONFIG_TRIGGER - GTP_REG_CONFIG_DATA)
#define MODULE_SWITCH3_LOC (GTP_REG_MODULE_SWITCH3 - GTP_REG_CONFIG_DATA)
#define GTP_I2C_ADDRESS 0xBA
#if GTP_WARP_X_ON
#define GTP_WARP_X(x_max, x) ( x_max - 1 - x )
#else
#define GTP_WARP_X(x_max, x) x
#endif
#if GTP_WARP_Y_ON
#define GTP_WARP_Y(y_max, y) ( y_max - 1 - y )
#else
#define GTP_WARP_Y(y_max, y) y
#endif
#define IS_NUM_OR_CHAR(x) (((x) >= 'A' && (x) <= 'Z') || ((x) >= '0' && (x) <= '9'))
//Log define
#define GTP_INFO(fmt,arg...) printk("<<GTP-INF>>[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
#define GTP_ERROR(fmt,arg...) printk("<<GTP-ERR>>[%s:%d] "fmt"\n", __func__, __LINE__, ##arg)
#define GTP_DEBUG(fmt,arg...) do{\
if(GTP_DEBUG_ON)\
printk("<<GTP-DBG>>[%s:%d]"fmt"\n",__func__, __LINE__, ##arg);\
}while(0)
#define GTP_DEBUG_ARRAY(array, num) do{\
s32 i;\
u8* a = array;\
if(GTP_DEBUG_ARRAY_ON)\
{\
printk("<<GTP-DBG>>");\
for (i = 0; i < (num); i++)\
{\
printk("%02x ", (a)[i]);\
if ((i + 1 ) %10 == 0)\
{\
printk("\n<<GTP-DBG>>");\
}\
}\
printk("\n");\
}\
}while(0)
#define GTP_DEBUG_FUNC() do{\
if(GTP_DEBUG_FUNC_ON)\
printk("<<GTP-FUNC>> Func:%s@Line:%d\n",__func__,__LINE__);\
}while(0)
#define GTP_SWAP(x, y) do{\
typeof(x) z = x;\
x = y;\
y = z;\
}while (0)
#pragma pack(1)
struct gt1x_version_info {
u8 product_id[5];
u32 patch_id;
u32 mask_id;
u8 sensor_id;
u8 match_opt;
};
#pragma pack()
typedef enum {
DOZE_DISABLED = 0,
DOZE_ENABLED = 1,
DOZE_WAKEUP = 2,
} DOZE_T;
typedef enum {
CHIP_TYPE_GT1X = 0,
CHIP_TYPE_GT2X = 1,
CHIP_TYPE_NONE = 0xFF
} CHIP_TYPE_T;
#define _ERROR(e) ((0x01 << e) | (0x01 << (sizeof(s32) * 8 - 1)))
#define ERROR _ERROR(1) //for common use
//system relevant
#define ERROR_IIC _ERROR(2) //IIC communication error.
#define ERROR_MEM _ERROR(3) //memory error.
//system irrelevant
#define ERROR_HN_VER _ERROR(10) //HotKnot version error.
#define ERROR_CHECK _ERROR(11) //Compare src and dst error.
#define ERROR_RETRY _ERROR(12) //Too many retries.
#define ERROR_PATH _ERROR(13) //Mount path error
#define ERROR_FW _ERROR(14)
#define ERROR_FILE _ERROR(15)
#define ERROR_VALUE _ERROR(16) //Illegal value of variables
/* bit operation */
#define SET_BIT(data, flag) ((data) |= (flag))
#define CLR_BIT(data, flag) ((data) &= ~(flag))
#define CHK_BIT(data, flag) ((data) & (flag))
/* touch states */
#define BIT_TOUCH 0x01
#define BIT_TOUCH_KEY 0x02
#define BIT_STYLUS 0x04
#define BIT_STYLUS_KEY 0x08
#define BIT_HOVER 0x10
#include <linux/input.h>
struct i2c_msg;
/* Export global variables and functions */
/* Export from gt1x_extents.c and gt1x_firmware.h */
#if GTP_HOTKNOT
extern u8 hotknot_enabled;
extern u8 hotknot_transfer_mode;
extern u8 gt1x_patch_jump_fw[];
extern u8 hotknot_auth_fw[];
extern u8 hotknot_transfer_fw[];
#if HOTKNOT_BLOCK_RW
extern s32 hotknot_paired_flag;
extern s32 hotknot_event_handler(u8 * data);
#endif
#endif //GTP_HOTKNOT
extern s32 gt1x_init_node(void);
extern void gt1x_deinit_node(void);
#if GTP_GESTURE_WAKEUP
extern DOZE_T gesture_doze_status;
extern int gesture_enabled;
extern void gt1x_gesture_debug(int on) ;
extern s32 gesture_event_handler(struct input_dev *dev);
extern s32 gesture_enter_doze(void);
extern void gesture_clear_wakeup_data(void);
#endif
/* Export from gt1x_tpd.c */
extern void gt1x_touch_down(s32 x, s32 y, s32 size, s32 id);
extern void gt1x_touch_up(s32 id);
extern int gt1x_power_switch(s32 state);
extern void gt1x_irq_enable(void);
extern void gt1x_irq_disable(void);
extern int gt1x_debug_proc(u8 * buf, int count);
struct fw_update_info {
int update_type;
int status;
int progress;
int max_progress;
int force_update;
struct fw_info *firmware;
u32 fw_length;
// file update
char *fw_name;
u8 *buffer;
mm_segment_t old_fs;
struct file *fw_file;
// header update
u8 *fw_data;
};
/* Export form gt1x_update.c */
extern struct fw_update_info update_info;
extern u8 gt1x_default_FW[];
extern int gt1x_hold_ss51_dsp(void);
extern int gt1x_auto_update_proc(void *data);
extern int gt1x_update_firmware(void *filename);
extern void gt1x_enter_update_mode(void);
extern void gt1x_leave_update_mode(void);
extern int gt1x_hold_ss51_dsp_no_reset(void);
extern int gt1x_load_patch(u8 * patch, u32 patch_size, int offset, int bank_size);
extern int gt1x_startup_patch(void);
/* Export from gt1x_tool.c */
#if GTP_CREATE_WR_NODE
extern int gt1x_init_tool_node(void);
extern void gt1x_deinit_tool_node(void);
#endif
/* Export from gt1x_generic.c */
extern struct i2c_client *gt1x_i2c_client;
extern CHIP_TYPE_T gt1x_chip_type;
extern struct gt1x_version_info gt1x_version;
extern s32 _do_i2c_read(struct i2c_msg *msgs, u16 addr, u8 * buffer, s32 len);
extern s32 _do_i2c_write(struct i2c_msg *msg, u16 addr, u8 * buffer, s32 len);
extern s32 gt1x_i2c_write(u16 addr, u8 * buffer, s32 len);
extern s32 gt1x_i2c_read(u16 addr, u8 * buffer, s32 len);
extern s32 gt1x_i2c_read_dbl_check(u16 addr, u8 * buffer, s32 len);
extern u8 gt1x_config[];
extern u32 gt1x_cfg_length;
extern u8 gt1x_int_type;
extern u8 gt1x_wakeup_level;
extern u32 gt1x_abs_x_max;
extern u32 gt1x_abs_y_max;
extern u8 gt1x_init_failed;
extern int gt1x_halt;
extern volatile int gt1x_rawdiff_mode;
extern s32 gt1x_init(void);
extern void gt1x_deinit(void);
extern s32 gt1x_read_version(struct gt1x_version_info *ver_info);
extern s32 gt1x_init_panel(void);
extern s32 gt1x_get_chip_type(void);
extern s32 gt1x_request_event_handler(void);
extern int gt1x_send_cmd(u8 cmd, u8 data);
extern s32 gt1x_send_cfg(u8 * config, int cfg_len);
extern void gt1x_select_addr(void);
extern s32 gt1x_reset_guitar(void);
extern void gt1x_power_reset(void);
extern int gt1x_parse_config(char *filename, u8 * gt1x_config);
extern s32 gt1x_touch_event_handler(u8 * data, struct input_dev *dev, struct input_dev *pen_dev);
extern int gt1x_suspend(void);
extern int gt1x_resume(void);
#if GTP_HAVE_TOUCH_KEY
extern const u16 gt1x_touch_key_array[];
#endif
#if GTP_WITH_STYLUS
extern struct input_dev *pen_dev;
extern void gt1x_pen_up(s32 id);
extern void gt1x_pen_down(s32 x, s32 y, s32 size, s32 id);
#endif
#if GTP_PROXIMITY
extern u8 gt1x_proximity_flag;
extern int gt1x_prox_event_handler(u8 * data);
#endif
#if GTP_SMART_COVER
extern int gt1x_parse_sc_cfg(int sensor_id);
#endif
#if GTP_ESD_PROTECT
extern void gt1x_init_esd_protect(void);
extern void gt1x_esd_switch(s32 on);
#endif
#if GTP_CHARGER_SWITCH
extern u32 gt1x_get_charger_status(void);
extern void gt1x_charger_switch(s32 on);
extern void gt1x_charger_config(s32 dir_update);
extern int gt1x_parse_chr_cfg(int sensor_id);
#endif
#endif // _GT1X_GENERIC_H_

View File

@@ -0,0 +1,438 @@
/* drivers/input/touchscreen/goodix_tool.c
*
* 2010 - 2014 Goodix Technology.
*
* 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: 1.4
* Release Date: 2015/07/10
*/
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include <generated/utsrelease.h>
#include "gt1x_generic.h"
static ssize_t gt1x_tool_read(struct file *filp, char __user * buffer, size_t count, loff_t * ppos);
static ssize_t gt1x_tool_write(struct file *filp, const char *buffer, size_t count, loff_t * ppos);
static int gt1x_tool_release(struct inode *inode, struct file *filp);
static int gt1x_tool_open(struct inode *inode,struct file *file);
#pragma pack(1)
typedef struct {
u8 wr; //write read flag£¬0:R 1:W 2:PID 3:
u8 flag; //0:no need flag/int 1: need flag 2: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 befor 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
} st_cmd_head;
#pragma pack()
static st_cmd_head cmd_head;
static s32 DATA_LENGTH;
static s8 IC_TYPE[16] = "GT1X";
#define UPDATE_FUNCTIONS
#define DATA_LENGTH_UINT 512
#define CMD_HEAD_LENGTH (sizeof(st_cmd_head) - sizeof(u8*))
static char procname[20] = { 0 };
static struct proc_dir_entry *gt1x_tool_proc_entry;
static struct file_operations gt1x_tool_fops = {
.read = gt1x_tool_read,
.write = gt1x_tool_write,
.open = gt1x_tool_open,
.release = gt1x_tool_release,
.owner = THIS_MODULE,
};
static void set_tool_node_name(char *procname)
{
int v0 = 0, v1 = 0, v2 = 0;
sscanf(UTS_RELEASE, "%d.%d.%d", &v0, &v1, &v2);
sprintf(procname, "gmnode%02d%02d%02d", v0, v1, v2);
}
int gt1x_init_tool_node(void)
{
DATA_LENGTH = 0;
memset(&cmd_head, 0, sizeof(cmd_head));
cmd_head.wr = 1; //if the first operation is read, will return fail.
cmd_head.data = kzalloc(DATA_LENGTH_UINT, GFP_KERNEL);
if (NULL == cmd_head.data) {
GTP_ERROR("Apply for memory failed.");
return -1;
}
GTP_INFO("Alloc memory size:%d.", DATA_LENGTH_UINT);
DATA_LENGTH = DATA_LENGTH_UINT - GTP_ADDR_LENGTH;
set_tool_node_name(procname);
gt1x_tool_proc_entry = proc_create(procname, 0666, NULL, &gt1x_tool_fops);
if (gt1x_tool_proc_entry == NULL) {
GTP_ERROR("CAN't create proc entry /proc/%s.", procname);
return -1;
} else {
GTP_INFO("Created proc entry /proc/%s.", procname);
}
return 0;
}
void gt1x_deinit_tool_node(void)
{
remove_proc_entry(procname, NULL);
kfree(cmd_head.data);
cmd_head.data = NULL;
}
static s32 tool_i2c_read(u8 * buf, u16 len)
{
u16 addr = (buf[0] << 8) + buf[1];
if (!gt1x_i2c_read(addr, &buf[2], len)) {
return 1;
}
return -1;
}
static s32 tool_i2c_write(u8 * buf, u16 len)
{
u16 addr = (buf[0] << 8) + buf[1];
if (!gt1x_i2c_write(addr, &buf[2], len - 2)) {
return 1;
}
return -1;
}
static u8 relation(u8 src, u8 dst, u8 rlt)
{
u8 ret = 0;
switch (rlt) {
case 0:
ret = (src != dst) ? true : false;
break;
case 1:
ret = (src == dst) ? true : false;
GTP_DEBUG("equal:src:0x%02x dst:0x%02x ret:%d.", src, dst, (s32) ret);
break;
case 2:
ret = (src > dst) ? true : false;
break;
case 3:
ret = (src < dst) ? true : false;
break;
case 4:
ret = (src & dst) ? true : false;
break;
case 5:
ret = (!(src | dst)) ? true : false;
break;
default:
ret = false;
break;
}
return ret;
}
/*******************************************************
Function:
Comfirm function.
Input:
None.
Output:
Return write length.
********************************************************/
static u8 comfirm(void)
{
s32 i = 0;
u8 buf[32];
memcpy(buf, cmd_head.flag_addr, cmd_head.addr_len);
for (i = 0; i < cmd_head.times; i++) {
if (tool_i2c_read(buf, 1) <= 0) {
GTP_ERROR("Read flag data failed!");
return -1;
}
if (true == relation(buf[GTP_ADDR_LENGTH], cmd_head.flag_val, cmd_head.flag_relation)) {
GTP_DEBUG("value at flag addr:0x%02x.", buf[GTP_ADDR_LENGTH]);
GTP_DEBUG("flag value:0x%02x.", cmd_head.flag_val);
break;
}
msleep(cmd_head.circle);
}
if (i >= cmd_head.times) {
GTP_ERROR("Didn't get the flag to continue!");
return -1;
}
return 0;
}
/*******************************************************
Function:
Goodix tool write function.
Input:
standard proc write function param.
Output:
Return write length.
********************************************************/
static ssize_t gt1x_tool_write(struct file *filp, const char __user * buff, size_t len, loff_t * data)
{
u64 ret = 0;
GTP_DEBUG_FUNC();
GTP_DEBUG_ARRAY((u8 *) buff, len);
ret = copy_from_user(&cmd_head, buff, CMD_HEAD_LENGTH);
if (ret) {
GTP_ERROR("copy_from_user failed.");
}
GTP_DEBUG("wr :0x%02x.", cmd_head.wr);
/*
GTP_DEBUG("flag:0x%02x.", cmd_head.flag);
GTP_DEBUG("flag addr:0x%02x%02x.", cmd_head.flag_addr[0], cmd_head.flag_addr[1]);
GTP_DEBUG("flag val:0x%02x.", cmd_head.flag_val);
GTP_DEBUG("flag rel:0x%02x.", cmd_head.flag_relation);
GTP_DEBUG("circle :%d.", (s32)cmd_head.circle);
GTP_DEBUG("times :%d.", (s32)cmd_head.times);
GTP_DEBUG("retry :%d.", (s32)cmd_head.retry);
GTP_DEBUG("delay :%d.", (s32)cmd_head.delay);
GTP_DEBUG("data len:%d.", (s32)cmd_head.data_len);
GTP_DEBUG("addr len:%d.", (s32)cmd_head.addr_len);
GTP_DEBUG("addr:0x%02x%02x.", cmd_head.addr[0], cmd_head.addr[1]);
GTP_DEBUG("len:%d.", (s32)len);
GTP_DEBUG("buf[20]:0x%02x.", buff[CMD_HEAD_LENGTH]);
*/
if (1 == cmd_head.wr) {
u16 addr, data_len, pos;
if (1 == cmd_head.flag) {
if (comfirm()) {
GTP_ERROR("[WRITE]Comfirm fail!");
return -1;
}
} else if (2 == cmd_head.flag) {
//Need interrupt!
}
addr = (cmd_head.addr[0] << 8) + cmd_head.addr[1];
data_len = cmd_head.data_len;
pos = 0;
while (data_len > 0) {
len = data_len > DATA_LENGTH ? DATA_LENGTH : data_len;
ret = copy_from_user(&cmd_head.data[GTP_ADDR_LENGTH], &buff[CMD_HEAD_LENGTH + pos], len);
if (ret) {
GTP_ERROR("[WRITE]copy_from_user failed.");
return -1;
}
cmd_head.data[0] = ((addr >> 8) & 0xFF);
cmd_head.data[1] = (addr & 0xFF);
GTP_DEBUG_ARRAY(cmd_head.data, len + GTP_ADDR_LENGTH);
if (tool_i2c_write(cmd_head.data, len + GTP_ADDR_LENGTH) <= 0) {
GTP_ERROR("[WRITE]Write data failed!");
return -1;
}
addr += len;
pos += len;
data_len -= len;
}
if (cmd_head.delay) {
msleep(cmd_head.delay);
}
return cmd_head.data_len + CMD_HEAD_LENGTH;
} else if (3 == cmd_head.wr) { //gt1x unused
memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len);
return cmd_head.data_len + CMD_HEAD_LENGTH;
} else if (5 == cmd_head.wr) { //?
//memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len);
return cmd_head.data_len + CMD_HEAD_LENGTH;
} else if (7 == cmd_head.wr) { //disable irq!
gt1x_irq_disable();
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_OFF);
#endif
return CMD_HEAD_LENGTH;
} else if (9 == cmd_head.wr) { //enable irq!
gt1x_irq_enable();
#if GTP_ESD_PROTECT
gt1x_esd_switch(SWITCH_ON);
#endif
return CMD_HEAD_LENGTH;
} else if (17 == cmd_head.wr) {
ret = copy_from_user(&cmd_head.data[GTP_ADDR_LENGTH], &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
if (ret) {
GTP_ERROR("copy_from_user failed.");
return -1;
}
if (cmd_head.data[GTP_ADDR_LENGTH]) {
GTP_DEBUG("gtp enter rawdiff.");
gt1x_rawdiff_mode = true;
} else {
gt1x_rawdiff_mode = false;
GTP_DEBUG("gtp leave rawdiff.");
}
return CMD_HEAD_LENGTH;
} else if (11 == cmd_head.wr) {
gt1x_enter_update_mode();
} else if (13 == cmd_head.wr) {
gt1x_leave_update_mode();
} else if (15 == cmd_head.wr) {
struct task_struct *thrd = NULL;
memset(cmd_head.data, 0, cmd_head.data_len + 1);
memcpy(cmd_head.data, &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
GTP_DEBUG("update firmware, filename: %s", cmd_head.data);
thrd = kthread_run(gt1x_update_firmware, (void *)cmd_head.data, "GT1x FW Update");
if (IS_ERR(thrd)) {
return PTR_ERR(thrd);
}
}
return CMD_HEAD_LENGTH;
}
static u8 devicecount = 0;
static int gt1x_tool_open(struct inode *inode,struct file *file)
{
if (devicecount > 0) {
return -ERESTARTSYS;
GTP_ERROR("tools open failed!");
}
devicecount++;
return 0;
}
static int gt1x_tool_release(struct inode *inode, struct file *filp)
{
devicecount--;
return 0;
}
/*******************************************************
Function:
Goodix tool read function.
Input:
standard proc read function param.
Output:
Return read length.
********************************************************/
static ssize_t gt1x_tool_read(struct file *filp, char __user * buffer, size_t count, loff_t * ppos)
{
GTP_DEBUG_FUNC();
if(*ppos) {
GTP_DEBUG("[PARAM]size: %zd, *ppos: %d", count, (int)*ppos);
*ppos = 0;
return 0;
}
if (cmd_head.wr % 2) {
GTP_ERROR("[READ] invaild operator fail!");
return -1;
} else if (!cmd_head.wr) {
/* general i2c read */
u16 addr, data_len, len, loc;
if (1 == cmd_head.flag) {
if (comfirm()) {
GTP_ERROR("[READ]Comfirm fail!");
return -1;
}
} else if (2 == cmd_head.flag) {
//Need interrupt!
}
addr = (cmd_head.addr[0] << 8) + cmd_head.addr[1];
data_len = cmd_head.data_len;
loc = 0;
GTP_DEBUG("[READ] ADDR:0x%04X.", addr);
GTP_DEBUG("[READ] Length: %d", data_len);
if (cmd_head.delay) {
msleep(cmd_head.delay);
}
while (data_len > 0) {
len = data_len > DATA_LENGTH ? DATA_LENGTH : data_len;
cmd_head.data[0] = (addr >> 8) & 0xFF;
cmd_head.data[1] = (addr & 0xFF);
if (tool_i2c_read(cmd_head.data, len) <= 0) {
GTP_ERROR("[READ]Read data failed!");
return -1;
}
memcpy(&buffer[loc], &cmd_head.data[GTP_ADDR_LENGTH], len);
data_len -= len;
addr += len;
loc += len;
GTP_DEBUG_ARRAY(&cmd_head.data[GTP_ADDR_LENGTH], len);
}
*ppos += cmd_head.data_len;
return cmd_head.data_len;
} else if (2 == cmd_head.wr) {
GTP_DEBUG("Return ic type:%s len:%d.", buffer, (s32) cmd_head.data_len);
return -1;
} else if (4 == cmd_head.wr) {
/* read fw update progress */
buffer[0] = update_info.progress >> 8;
buffer[1] = update_info.progress & 0xff;
buffer[2] = update_info.max_progress >> 8;
buffer[3] = update_info.max_progress & 0xff;
*ppos += 4;
return 4;
} else if (6 == cmd_head.wr) {
//Read error code!
return -1;
} else if (8 == cmd_head.wr) {
/* Read driver version */
s32 tmp_len;
tmp_len = strlen(GTP_DRIVER_VERSION);
memcpy(buffer, GTP_DRIVER_VERSION, tmp_len);
buffer[tmp_len] = 0;
*ppos += tmp_len + 1;
return (tmp_len + 1);
}
*ppos += cmd_head.data_len;
return cmd_head.data_len;
}

File diff suppressed because it is too large Load Diff