update:add luckfox-pico Ultra support

This commit is contained in:
luckfox-eng29
2024-03-16 17:03:10 +08:00
committed by luckfox-eng33
parent 1e160dee55
commit d3153ac97e
234 changed files with 89019 additions and 2435 deletions

View File

@@ -425,6 +425,11 @@ config TOUCHSCREEN_GSLX680_PAD
config TOUCHSCREEN_GT1X
tristate "GT1X touchscreens support"
config TOUCHSCREEN_GT9XX
tristate "GT9XX touchscreens support"
config TOUCHSCREEN_HIDEEP
tristate "HiDeep Touch IC"
depends on I2C

View File

@@ -52,6 +52,7 @@ gsl3673-ts-y := gsl3673.o gsl_point_id.o
obj-$(CONFIG_TOUCHSCREEN_GSLX680_PAD) += gslx680-pad.o
gslx680-pad-y := gslx680_pad.o gsl_point_id.o
obj-$(CONFIG_TOUCHSCREEN_GT1X) += gt1x/
obj-$(CONFIG_TOUCHSCREEN_GT9XX) += gt9xx/
obj-$(CONFIG_TOUCHSCREEN_HIDEEP) += hideep.o
obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o
obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC) += imx6ul_tsc.o

View File

@@ -12,7 +12,7 @@
* Development of this driver has been sponsored by Glyn:
* http://www.glyn.com/Products/Displays
*/
#define DEBUG
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
@@ -832,8 +832,10 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
error = edt_ft5x06_ts_readwrite(client, 1, "\xBB",
EDT_NAME_LEN - 1, rdbuf);
if (error)
return error;
{
dev_dbg(&client->dev, "edt_ft5x06_ts_read_write xBB failed\n");
//return error;
}
/* Probe content for something consistent.
* M06 starts with a response byte, M12 gives the data directly.
* M09/Generic does not provide model number information.
@@ -881,15 +883,19 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
error = edt_ft5x06_ts_readwrite(client, 1, "\xA6",
2, rdbuf);
if (error)
{
dev_dbg(&client->dev, "edt_ft5x06_ts_read_write XA6 failed\n");
return error;
}
strlcpy(fw_version, rdbuf, 2);
error = edt_ft5x06_ts_readwrite(client, 1, "\xA8",
1, rdbuf);
if (error)
{
dev_dbg(&client->dev, "edt_ft5x06_ts_read_write xA8 failed\n");
return error;
}
/* This "model identification" is not exact. Unfortunately
* not all firmwares for the ft5x06 put useful values in
* the identification registers.
@@ -917,7 +923,10 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
error = edt_ft5x06_ts_readwrite(client, 1, "\x53",
1, rdbuf);
if (error)
{
dev_dbg(&client->dev, "edt_ft5x06_ts_read_write x53 failed\n");
return error;
}
strlcpy(fw_version, rdbuf, 1);
snprintf(model_name, EDT_NAME_LEN,
"EVERVISION-FT5726NEi");
@@ -1155,7 +1164,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
}
if (tsdata->reset_gpio) {
usleep_range(5000, 6000);
//usleep_range(5000, 6000);
usleep_range(6000, 7000);
gpiod_set_value_cansleep(tsdata->reset_gpio, 0);
msleep(300);
}
@@ -1174,7 +1184,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
error = edt_ft5x06_ts_identify(client, tsdata, fw_version);
if (error) {
dev_err(&client->dev, "touchscreen probe failed\n");
return error;
dev_err(&client->dev, "error = %d\n",error);
// return error;
}
/*

View File

@@ -10,6 +10,7 @@
* 2010 - 2012 Goodix Technology.
*/
#define DEBUG
#include <linux/kernel.h>
#include <linux/dmi.h>
@@ -962,6 +963,8 @@ static int goodix_read_version(struct goodix_ts_data *ts)
{
int error;
u8 buf[6];
//u8 reg_data[6];
//int i = 0;
char id_str[GOODIX_ID_MAX_LEN + 1];
error = goodix_i2c_read(ts->client, GOODIX_REG_ID, buf, sizeof(buf));
@@ -978,7 +981,6 @@ static int goodix_read_version(struct goodix_ts_data *ts)
dev_info(&ts->client->dev, "ID %s, version: %04x\n", ts->id,
ts->version);
return 0;
}
@@ -1058,11 +1060,15 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
dev_dbg(&ts->client->dev, "(%d, %d, %d)", ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);
/* Read configuration and apply touchscreen parameters */
goodix_read_config(ts);
dev_dbg(&ts->client->dev, "(%d, %d, %d)", ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);
/* Try overriding touchscreen parameters via device properties */
touchscreen_parse_properties(ts->input_dev, true, &ts->prop);
dev_dbg(&ts->client->dev, "(%d, %d, %d)", ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);
if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) {
dev_err(&ts->client->dev,
@@ -1127,9 +1133,17 @@ static void goodix_config_cb(const struct firmware *cfg, void *ctx)
{
struct goodix_ts_data *ts = ctx;
int error;
int i;
if (cfg) {
/* send device configuration to the firmware */
while(i < cfg->size)
{
dev_dbg(&ts->client->dev, "reg %d: %#x\n", i, cfg->data[i]);
i ++;
}
error = goodix_send_cfg(ts, cfg->data, cfg->size);
if (error)
goto err_release_cfg;
@@ -1229,8 +1243,11 @@ reset:
ts->chip = goodix_get_chip_data(ts->id);
ts->load_cfg_from_disk = 0;
if (ts->load_cfg_from_disk) {
/* update device config */
dev_dbg(&client->dev, "Configure from Disk\n");
ts->cfg_name = devm_kasprintf(&client->dev, GFP_KERNEL,
"goodix_%s_cfg.bin", ts->id);
if (!ts->cfg_name)
@@ -1248,6 +1265,7 @@ reset:
return 0;
} else {
dev_dbg(&client->dev, "Configure from Device\n");
error = goodix_configure_dev(ts);
if (error)
return error;

View File

@@ -3,4 +3,4 @@ obj-y += goodix_gt9xx.o
#goodix_gt9xx-y +=goodix_tool.o
goodix_gt9xx-y +=gt9xx.o
goodix_gt9xx-y +=gt9xx_update.o
#goodix_gt9xx-y +=gt9xx_update.o

View File

@@ -218,6 +218,7 @@ extern u16 total_len;
}
*/
/*
//WGJ10187_GT9271_Config_20140623_104014_0X41.cfg
#define CTP_CFG_GROUP1 {\
0x41,0x80,0x07,0xB0,0x04,0x0A,0x05,0x00,0x01,0x08,0x28,0x0F,0x50,0x32,0x03, \
@@ -234,6 +235,32 @@ extern u16 total_len;
0x23,0x24,0x25,0x26,0x27,0x28,0x29,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, \
0x00,0x00,0x00,0x00,0xB5,0x01 \
}
*/
//FT040017_GT911_Config_20221026.cfg
#define CTP_CFG_GROUP1 { \
0x4F,0xE0,0x01,0xE0,0x01,0x05,0x35,0x00,0x01,0xC8, \
0x28,0x0F,0x50,0x3C,0x03,0x05,0x00,0x00,0x00,0x00, \
0x00,0x00,0x00,0x18,0x1A,0x1E,0x14,0x85,0x25,0x0A, \
0xEA,0xEC,0xB5,0x06,0x00,0x00,0x00,0x20,0x21,0x10, \
0x00,0x01,0x00,0x0F,0x00,0x2A,0x00,0x00,0x01,0x50, \
0x32,0xDC,0xFA,0x94,0xD0,0x02,0x08,0x00,0x00,0x04, \
0x80,0xDE,0x00,0x80,0xE4,0x00,0x80,0xEA,0x00,0x7F, \
0xF0,0x00,0x7F,0xF6,0x00,0x7F,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,0x00,0x00,0x00,0x00,0x00,0x00, \
0x00,0x00,0x14,0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06, \
0x04,0x02,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0x21,0x20,0x1F,0x1E,0x1D,0x00,0x02,0x04, \
0x06,0x08,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xAA,0x01 \
}
// TODO: define your config for Sensor_ID == 1 here, if needed
#define CTP_CFG_GROUP2 {\
@@ -391,7 +418,7 @@ extern u16 total_len;
}while (0)
//*****************************End of Part III********************************
#define TRUE 1
#define FALSE 0
//#define TRUE 1
//#define FALSE 0
#endif /* _GOODIX_GT9XX_H_ */