From d21a817028ba962fad53724c79b3e175d24ba5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Thu, 29 Jul 2021 11:13:04 +0000 Subject: [PATCH 1/4] update model/input/driver/hdf_touch.c. --- model/input/driver/hdf_touch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index 8d2f17078..d595e1461 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -106,7 +106,8 @@ static int32_t HandlePowerEvent(ChipDevice *chipDev, uint32_t *timing, uint32_t static int32_t InputPinMuxCfg(uint32_t regAddr, int32_t regSize, uint32_t regValue) { - uint8_t *base = NULL; + return HDF_SUCCESS; +/* uint8_t *base = NULL; if (regAddr == 0) { HDF_LOGE("%s: regAddr invalid", __func__); return HDF_FAILURE; @@ -120,7 +121,7 @@ static int32_t InputPinMuxCfg(uint32_t regAddr, int32_t regSize, uint32_t regVal OSAL_WRITEL(regValue, base); OsalIoUnmap((void *)base); - return HDF_SUCCESS; + return HDF_SUCCESS; */ } static int32_t SetPowerOnTiming(ChipDevice *chipDev) -- Gitee From bc35e450fc06a5c983db58069d70fa5e29e63a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Thu, 29 Jul 2021 11:39:48 +0000 Subject: [PATCH 2/4] add code for dayu Signed-off-by: huangkai71 --- model/input/driver/hdf_touch.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index d595e1461..acaadd92c 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -106,8 +106,10 @@ static int32_t HandlePowerEvent(ChipDevice *chipDev, uint32_t *timing, uint32_t static int32_t InputPinMuxCfg(uint32_t regAddr, int32_t regSize, uint32_t regValue) { +#if defined(CONFIG_ARCH_SPRD) return HDF_SUCCESS; -/* uint8_t *base = NULL; +#endif + uint8_t *base = NULL; if (regAddr == 0) { HDF_LOGE("%s: regAddr invalid", __func__); return HDF_FAILURE; @@ -121,7 +123,7 @@ static int32_t InputPinMuxCfg(uint32_t regAddr, int32_t regSize, uint32_t regVal OSAL_WRITEL(regValue, base); OsalIoUnmap((void *)base); - return HDF_SUCCESS; */ + return HDF_SUCCESS; } static int32_t SetPowerOnTiming(ChipDevice *chipDev) @@ -265,9 +267,13 @@ static int32_t ChipDriverInit(ChipDevice *chipDev) CHECK_RETURN_VALUE(ret); HDF_LOGI("%s: chipDetect succ, ret = %d ", __func__, ret); +#if defined(CONFIG_ARCH_SPRD) + HDF_LOGI("%s: DAYU do not update firmware", __func__); +#else ret = chipDev->ops->UpdateFirmware(chipDev); CHECK_RETURN_VALUE(ret); HDF_LOGI("%s: update firmware success", __func__); +#endif ret = SetupChipIrq(chipDev); CHECK_RETURN_VALUE(ret); -- Gitee From 96d0a89eed80ced6a1c68cd153a05918f5ff4a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Thu, 29 Jul 2021 11:46:46 +0000 Subject: [PATCH 3/4] add code for dayu Signed-off-by: huangkai71 --- model/input/driver/touchscreen/touch_gt911.c | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/model/input/driver/touchscreen/touch_gt911.c b/model/input/driver/touchscreen/touch_gt911.c index c25c7c099..2a5354f45 100644 --- a/model/input/driver/touchscreen/touch_gt911.c +++ b/model/input/driver/touchscreen/touch_gt911.c @@ -14,10 +14,6 @@ #include "input_i2c_ops.h" #include "touch_gt911.h" -#define AXIS_X_MAX 479 -#define AXIS_X_RANGE 0 -#define AXIS_Y_MAX 959 -#define AXIS_Y_RANGE 0 #define MAX_POINT 5 static int32_t ChipInit(ChipDevice *device) @@ -98,10 +94,17 @@ static void ParsePointData(ChipDevice *device, FrameData *frame, uint8_t *buf, u for (i = 0; i < pointNum; i++) { if (chipVer == 0) { // chipversion A:gt911_zsj5p5 frame->fingers[i].trackId = buf[GT_POINT_SIZE * i + GT_TRACK_ID]; +#if defined(CONFIG_ARCH_SPRD) + frame->fingers[i].y = (resY - 1 - ((buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | + ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET))) * resX / resY; + frame->fingers[i].x = ((buf[GT_POINT_SIZE * i + GT_Y_LOW] & ONE_BYTE_MASK) | + ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET)) * resY / resX; +#else frame->fingers[i].y = (buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET); frame->fingers[i].x = (buf[GT_POINT_SIZE * i + GT_Y_LOW] & ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET); +#endif if (frame->fingers[i].x == 0) { frame->fingers[i].x = X_OFFSET; } @@ -189,17 +192,17 @@ static void SetAbility(ChipDevice *device) SET_BIT(ABS_MT_POSITION_Y) | SET_BIT(ABS_MT_TRACKING_ID); device->driver->inputDev->abilitySet.keyCode[3] = SET_BIT(KEY_UP) | SET_BIT(KEY_DOWN); device->driver->inputDev->attrSet.axisInfo[ABS_X].min = 0; - device->driver->inputDev->attrSet.axisInfo[ABS_X].max = AXIS_X_MAX; - device->driver->inputDev->attrSet.axisInfo[ABS_X].range = AXIS_X_RANGE; + device->driver->inputDev->attrSet.axisInfo[ABS_X].max = device->boardCfg->attr.resolutionX - 1; + device->driver->inputDev->attrSet.axisInfo[ABS_X].range = 0; device->driver->inputDev->attrSet.axisInfo[ABS_Y].min = 0; - device->driver->inputDev->attrSet.axisInfo[ABS_Y].max = AXIS_Y_MAX; - device->driver->inputDev->attrSet.axisInfo[ABS_Y].range = AXIS_Y_RANGE; + device->driver->inputDev->attrSet.axisInfo[ABS_Y].max = device->boardCfg->attr.resolutionY - 1; + device->driver->inputDev->attrSet.axisInfo[ABS_Y].range = 0; device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_X].min = 0; - device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_X].max = AXIS_X_MAX; - device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_X].range = AXIS_X_RANGE; + device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_X].max = device->boardCfg->attr.resolutionX - 1; + device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_X].range = 0; device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_Y].min = 0; - device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_Y].max = AXIS_Y_MAX; - device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_Y].range = AXIS_Y_RANGE; + device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_Y].max = device->boardCfg->attr.resolutionY - 1; + device->driver->inputDev->attrSet.axisInfo[ABS_MT_POSITION_Y].range = 0; device->driver->inputDev->attrSet.axisInfo[ABS_MT_TRACKING_ID].max = MAX_POINT; } -- Gitee From 6f00697e5e75b9db67d3448121d75ff335e5bac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Thu, 29 Jul 2021 12:31:36 +0000 Subject: [PATCH 4/4] update model/input/driver/touchscreen/touch_gt911.c. Signed-off-by: huangkai71 --- model/input/driver/touchscreen/touch_gt911.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/model/input/driver/touchscreen/touch_gt911.c b/model/input/driver/touchscreen/touch_gt911.c index 2a5354f45..7ed36242e 100644 --- a/model/input/driver/touchscreen/touch_gt911.c +++ b/model/input/driver/touchscreen/touch_gt911.c @@ -96,9 +96,11 @@ static void ParsePointData(ChipDevice *device, FrameData *frame, uint8_t *buf, u frame->fingers[i].trackId = buf[GT_POINT_SIZE * i + GT_TRACK_ID]; #if defined(CONFIG_ARCH_SPRD) frame->fingers[i].y = (resY - 1 - ((buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | - ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET))) * resX / resY; + ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << + ONE_BYTE_OFFSET))) * resX / resY; frame->fingers[i].x = ((buf[GT_POINT_SIZE * i + GT_Y_LOW] & ONE_BYTE_MASK) | - ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET)) * resY / resX; + ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << + ONE_BYTE_OFFSET)) * resY / resX; #else frame->fingers[i].y = (buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET); -- Gitee