Skip to content
Merged
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
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/amlogic/kvim3_linux.dts
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
compatible = "goodix,gt9xx";
status = "okay";
reg = <0x5d>;
reset_pin = <6>;
reset-gpio = <&gpio_expander 6 GPIO_ACTIVE_HIGH>;
tp-size = <89>;
rotation = <1>;
goodix,cfg-group0 = [
Expand Down
27 changes: 27 additions & 0 deletions arch/arm64/boot/dts/amlogic/kvim3l_linux.dts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,33 @@
status = "okay";
};

gt9xx@5d {
compatible = "goodix,gt9xx";
status = "okay";
reg = <0x5d>;
reset-gpio = <&gpio_expander 6 GPIO_ACTIVE_HIGH>;
tp-size = <89>;
rotation = <1>;
goodix,cfg-group0 = [
41 80 07 B0 04 0A 3D 00 01 08 28
05 64 50 03 05 00 00 00 00 23 13
00 17 19 1C 13 90 30 AA 17 15 31
0D 00 00 01 9B 03 24 00 00 00 00
00 00 00 00 00 00 00 0F 23 94 D5
02 07 00 00 04 A3 10 00 8C 13 00
7B 16 00 69 1B 00 5B 20 00 5B 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 01 04 05 06 07 08 09 0C
0D 0E 0F 10 11 14 15 16 17 18 19
FF FF FF FF FF FF FF FF FF FF 00
02 04 06 07 08 0A 0C 0D 0E 0F 10
11 12 13 14 19 1B 1C 1E 1F 20 21
22 23 24 25 26 27 28 29 2A FF FF
FF FF FF FF FF FF FF FF 6F 01];
};

bq25703:bq25703@6b {
compatible = "bq25703";
reg = <0x6b>;
Expand Down
42 changes: 21 additions & 21 deletions drivers/amlogic/input/touchscreen/gt9xx/gt9xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const char *goodix_input_phys = "input/ts";
static struct workqueue_struct *goodix_wq;
struct i2c_client * i2c_connect_client = NULL;
int gtp_rst_gpio;
int gtp_int_gpio;
//int gtp_int_gpio;
static u32 rotation;
u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH]
= {GTP_REG_CONFIG_DATA >> 8, GTP_REG_CONFIG_DATA & 0xff};
Expand Down Expand Up @@ -1072,9 +1072,9 @@ static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)
*******************************************************/
void gtp_int_sync(s32 ms)
{
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
msleep(ms);
GTP_GPIO_AS_INT(gtp_int_gpio);
//GTP_GPIO_AS_INT(gtp_int_gpio);
}


Expand All @@ -1097,7 +1097,7 @@ void gtp_reset_guitar(struct i2c_client *client, s32 ms)
GTP_GPIO_OUTPUT(gtp_rst_gpio, 0); // begin select I2C slave addr
msleep(ms); // T2: > 10ms
// HIGH: 0x28/0x29, LOW: 0xBA/0xBB
GTP_GPIO_OUTPUT(gtp_int_gpio, client->addr == 0x14);
//GTP_GPIO_OUTPUT(gtp_int_gpio, client->addr == 0x14);

msleep(2); // T3: > 100us
GTP_GPIO_OUTPUT(gtp_rst_gpio, 1);
Expand Down Expand Up @@ -1204,7 +1204,7 @@ static s8 gtp_enter_sleep(struct goodix_ts_data * ts)
}
#endif

GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
msleep(5);

while(retry++ < 5)
Expand Down Expand Up @@ -1243,7 +1243,7 @@ static s8 gtp_wakeup_sleep(struct goodix_ts_data * ts)
{
u8 opr_buf[3] = {0x41, 0x80};

GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
msleep(5);

for (retry = 0; retry < 10; ++retry)
Expand Down Expand Up @@ -1317,7 +1317,7 @@ static s8 gtp_wakeup_sleep(struct goodix_ts_data * ts)
gtp_irq_enable(ts);

#else
GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
msleep(5);
#endif

Expand Down Expand Up @@ -1735,7 +1735,7 @@ static s8 gtp_i2c_test(struct i2c_client *client)
Executive outcomes.
>= 0: succeed, < 0: failed
*******************************************************/
static s8 gtp_request_io_port(struct goodix_ts_data *ts)
/*static s8 gtp_request_io_port(struct goodix_ts_data *ts)
{
s32 ret = 0;

Expand All @@ -1762,7 +1762,7 @@ static s8 gtp_request_io_port(struct goodix_ts_data *ts)
gtp_reset_guitar(ts->client, 20);

return 0;
}
}*/

/*******************************************************
Function:
Expand All @@ -1789,8 +1789,8 @@ static s8 gtp_request_irq(struct goodix_ts_data *ts)
if (ret)
{
GTP_ERROR("Request IRQ failed!ERRNO:%d.", ret);
GTP_GPIO_AS_INPUT(gtp_int_gpio);
GTP_GPIO_FREE(gtp_int_gpio);
//GTP_GPIO_AS_INPUT(gtp_int_gpio);
//GTP_GPIO_FREE(gtp_int_gpio);

hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ts->timer.function = goodix_ts_timer_handler;
Expand Down Expand Up @@ -2334,7 +2334,7 @@ static void gtp_parse_dt(struct device *dev)
u32 temp_val;
int ret = 0;

gtp_int_gpio = of_get_named_gpio(np, "irq-gpio", 0);
//gtp_int_gpio = of_get_named_gpio(np, "irq-gpio", 0);
gtp_rst_gpio = of_get_named_gpio(np, "reset-gpio", 0);

ret = of_property_read_u32(np, "rotation", &temp_val);
Expand Down Expand Up @@ -2486,8 +2486,8 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
goto err_power_switch;
}
#else /* use gpio defined in gt9xx.h */
gtp_rst_gpio = GTP_RST_PORT;
gtp_int_gpio = GTP_INT_PORT;
//gtp_rst_gpio = GTP_RST_PORT;
//gtp_int_gpio = GTP_INT_PORT;
#endif

INIT_WORK(&ts->work, goodix_ts_work_func);
Expand All @@ -2502,12 +2502,12 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
#endif
i2c_set_clientdata(client, ts);
ts->gtp_rawdiff_mode = 0;
ret = gtp_request_io_port(ts);
/*ret = gtp_request_io_port(ts);
if (ret < 0)
{
GTP_ERROR("GTP request IO port failed.");
goto err_request_io_port;
}
}*/

#if GTP_COMPATIBLE_MODE
gtp_get_chip_type(ts);
Expand Down Expand Up @@ -2606,9 +2606,9 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
gtp_esd_switch(client, SWITCH_OFF);
#endif
err_chip_init:
GTP_GPIO_FREE(gtp_int_gpio);
GTP_GPIO_FREE(gtp_rst_gpio);
err_request_io_port:
//GTP_GPIO_FREE(gtp_int_gpio);
//GTP_GPIO_FREE(gtp_rst_gpio);
//err_request_io_port:
#ifdef GTP_CONFIG_OF
gtp_power_switch(client, 0);
err_power_switch:
Expand Down Expand Up @@ -2655,8 +2655,8 @@ static int goodix_ts_remove(struct i2c_client *client)
{
if (ts->use_irq)
{
GTP_GPIO_AS_INPUT(gtp_int_gpio);
GTP_GPIO_FREE(gtp_int_gpio);
//GTP_GPIO_AS_INPUT(gtp_int_gpio);
//GTP_GPIO_FREE(gtp_int_gpio);
free_irq(client->irq, ts);
}
else
Expand Down
4 changes: 2 additions & 2 deletions drivers/amlogic/input/touchscreen/gt9xx/gt9xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@

#define GTP_GESTURE_WAKEUP 1 // gesture wakeup

#define GTP_DEBUG_ON 1
#define GTP_DEBUG_ON 0
#define GTP_DEBUG_ARRAY_ON 1
#define GTP_DEBUG_FUNC_ON 1
#define GTP_DEBUG_FUNC_ON 0

#if GTP_COMPATIBLE_MODE
typedef enum
Expand Down
28 changes: 14 additions & 14 deletions drivers/amlogic/input/touchscreen/gt9xx/gt9xx_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ s32 gup_enter_update_mode(struct i2c_client *client)
msleep(2);

//step2:select I2C slave addr,INT:0--0xBA;1--0x28.
GTP_GPIO_OUTPUT(gtp_int_gpio, (client->addr == 0x14));
//GTP_GPIO_OUTPUT(gtp_int_gpio, (client->addr == 0x14));
msleep(2);

//step3:RST output high reset guitar
Expand Down Expand Up @@ -523,7 +523,7 @@ s32 gup_enter_update_mode(struct i2c_client *client)

void gup_leave_update_mode(void)
{
GTP_GPIO_AS_INT(gtp_int_gpio);
//GTP_GPIO_AS_INT(gtp_int_gpio);

GTP_DEBUG("[leave_update_mode]reset chip.");
gtp_reset_guitar(i2c_connect_client, 20);
Expand Down Expand Up @@ -2831,21 +2831,21 @@ void gup_output_pulse(int t)
unsigned long flags;
//s32 i;

GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
msleep(10);

local_irq_save(flags);

GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
msleep(50);
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
msleep(t - 50);
GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);

local_irq_restore(flags);

msleep(20);
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
}

static void gup_sys_clk_init(void)
Expand Down Expand Up @@ -2906,7 +2906,7 @@ s32 gup_clk_calibration(void)
gup_sys_clk_init();
gup_clk_calibration_pin_select(1);//use GIO1 to do the calibration

GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);

ts = i2c_get_clientdata(i2c_connect_client);

Expand All @@ -2933,25 +2933,25 @@ s32 gup_clk_calibration(void)
}

#else
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);

//local_irq_save(flags);
do_gettimeofday(&start);
GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//local_irq_restore(flags);

msleep(1);
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
msleep(1);

//local_irq_save(flags);
do_gettimeofday(&end);
GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 1);
//local_irq_restore(flags);

count = gup_clk_count_get();
msleep(20);
GTP_GPIO_OUTPUT(gtp_int_gpio, 0);
//GTP_GPIO_OUTPUT(gtp_int_gpio, 0);

usec = end.tv_usec - start.tv_usec;
sec = end.tv_sec - start.tv_sec;
Expand Down Expand Up @@ -2990,7 +2990,7 @@ s32 gup_clk_calibration(void)
i2c_write_bytes(i2c_connect_client, 0x41F9, &buf, 1);
#endif

GTP_GPIO_AS_INT(gtp_int_gpio);
//GTP_GPIO_AS_INT(gtp_int_gpio);
return i;
}

Expand Down