Skip to content

[+] Added Goodix GT801 touchscreen support #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: odroidc-3.10.y-android
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/amlogic/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ config GOODIX_CAPACITIVE_TOUCHSCREEN
help
Say Y here if you want to use the Goodix capacitive panel.

config GOODIX_GT801_CAPACITIVE_TOUCHSCREEN
tristate "Goodix I2C GT801 capacitive touchscreen"
depends on I2C
default n
help
Say Y here if you want to use the Goodix Guitar touch.

config GOODIX_GT81XX_CAPACITIVE_TOUCHSCREEN
tristate "Goodix I2C GT81XX capacitive touchscreen"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/amlogic/input/touchscreen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
obj-$(CONFIG_MESON_INPUT_TOUCHSCREEN) += common.o
obj-$(CONFIG_FOCALTECH_CAPACITIVE_TOUCHSCREEN) +=focaltech_5x06.o
obj-$(CONFIG_GOODIX_GT81XX_CAPACITIVE_TOUCHSCREEN) += goodix_gt81xx.o
obj-$(CONFIG_GOODIX_GT801_CAPACITIVE_TOUCHSCREEN) += gt801_ts.o
obj-$(CONFIG_GSLX680_CAPACITIVE_TOUCHSCREEN) += gslx680.o aml_gsl_common.o
obj-$(CONFIG_GSLX680B_CAPACITIVE_TOUCHSCREEN) += gslx680B.o
obj-$(CONFIG_GSLX680_COMPATIBLE_CAPACITIVE_TOUCHSCREEN) += gslx680_compatible.o aml_gsl_common.o
Expand Down
31 changes: 31 additions & 0 deletions drivers/amlogic/input/touchscreen/aml.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,36 @@
fw_file = "/etc/touch/ct36x.dat";
};
#endif

#ifdef CONFIG_GOODIX_GT801_CAPACITIVE_TOUCHSCREEN
//$$ DEVICE = "touch_gt801"
//$$ L2 PROP_STR = "status"
//$$ L2 PROP_STR = "touch_name"
//$$ L3 PROP_STR = "i2c_bus"
//$$ L3 PROP_U32 ="reg"
//$$ L3 PROP_U32 ="irq"
//$$ L3 PROP_STR = "gpio_interrupt"
//$$ L3 PROP_STR = "gpio_reset"
//$$ L3 PROP_U32 ="xres"
//$$ L3 PROP_U32 ="yres"
//$$ L3 PROP_U32 ="pol"
//$$ L3 PROP_STR = "irq_edge"
//$$ L3 PROP_STR = "config_file"
touch_gt801:gt801{
compatible = "goodix,gt801";
status = "okay";
touch_name = "gt801";
i2c_bus = "i2c_bus_a";
reg = <0x55>;
irq = <0>;
gpio_interrupt = "GPIOX_19";
gpio_reset = "GPIOY_8";
xres = <800>;
yres = <480>;
pol = <0x4>; // bit0 - swap x, bit1 - swap y , bit2 - swap xy
irq_edge= "GPIO_IRQ_LOW"
/*config_file = "/etc/touch/goodix.cfg";*/
};
#endif
};
#endif
83 changes: 49 additions & 34 deletions drivers/amlogic/input/touchscreen/goodix_queue.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* include/linux/goodix_queue.h
*
* Copyright (C) 2010 Goodix, Inc.
* Author: Eltonny
* Date: 2010.9.15
*/
/*---------------------------------------------------------------------------------------------------------
* kernel/include/linux/goodix_queue.h
* Copyright(c) 2010 Goodix Technology Corp. All rights reserved.
* Author: Eltonny
* Date: 2010.11.11
*
*---------------------------------------------------------------------------------------------------------*/

/* 用于管理手指序列的伪队列操作函数,
* 适用于Goodix的Guitar小屏驱动
* 调整手指上报顺序以避免出现手指ID交换现象
Expand All @@ -14,10 +14,13 @@
#ifndef _LINUX_GOODIX_QUEUE_H
#define _LINUX_GOODIX_QUEUE_H

struct point_node
struct point_node
{
unsigned int num;
unsigned int state;
uint8_t num;
uint8_t state;
uint8_t pressure;
unsigned int x;
unsigned int y;
};

struct point_queue
Expand All @@ -26,7 +29,6 @@ struct point_queue
struct point_node pointer[MAX_FINGER_NUM];
};


/*******************************************************
功能:
删除手指队列中松键的手指
Expand All @@ -35,18 +37,21 @@ struct point_queue
********************************************************/
static void del_point(struct point_queue *point_list)
{
int count = point_list->length-1;
int count = point_list->length - 1;
int position;
for(; count >= 0; count--) //note: must search from tail to head
if(point_list->pointer[count].state == FLAG_UP)
{
if(point_list->length == 0 )
return ;
for (; count >= 0; count--) //note: must search from tail to head
{
if (point_list->pointer[count].state == FLAG_UP)
{
if (point_list->length == 0)
return;
position = count;
for(; position < MAX_FINGER_NUM -1; position++)
point_list->pointer[position] = point_list->pointer[position+1];
for (; position < MAX_FINGER_NUM - 1; position++)
point_list->pointer[position] =
point_list->pointer[position + 1];
point_list->length--;
}
}
}
}

/*******************************************************
Expand All @@ -58,17 +63,29 @@ static void del_point(struct point_queue *point_list)
return:
是否成功增加手指
********************************************************/
static int add_point(struct point_queue *point_list, int num)
static int add_point(struct point_queue *point_list, int num)
{
if(point_list->length >= MAX_FINGER_NUM || num < 0 )
if (point_list->length >= MAX_FINGER_NUM || num < 0)
return -1;
point_list->pointer[point_list->length].num = num;
point_list->pointer[point_list->length].state = FLAG_DOWN;
point_list->length++;
return 0;
}

//

static int search_point(struct point_queue *point_list, int num)
{
int count = 0;
if (point_list->length <= 0 || num < 0 || num > MAX_FINGER_NUM)
return -1; //no data
for (; count < point_list->length; count++)
if (point_list->pointer[count].num == num)
return count;
else
continue;
return -1;
}
/*******************************************************
功能:
查找松键的手指并设置标志位为FLAG_UP
Expand All @@ -78,18 +95,16 @@ static int add_point(struct point_queue *point_list, int num)
return:
是否成功设置手指标志位
********************************************************/
static int set_up_point(struct point_queue *point_list, int num)
static int set_up_point(struct point_queue *point_list, int num)
{
int count = 0;
if(point_list->length <= 0 || num < 0 || num > MAX_FINGER_NUM)
int number = 0;
if (point_list->length <= 0 || num < 0 || num > MAX_FINGER_NUM)
return -1; //no data
for(; count < point_list->length; count++)
if(point_list->pointer[count].num == num)
{
point_list->pointer[count].state = FLAG_UP;
return 0;
}
else continue;
number = search_point(point_list, num);
if (num >= 0) {
point_list->pointer[number].state = FLAG_UP;
return 0;
}
return -1;
}

Expand Down
Loading