!739 fix input code warning

Merge pull request !739 from hua.liang/OpenHarmony-3.1-Release
This commit is contained in:
openharmony_ci
2022-03-10 03:50:42 +00:00
committed by Gitee
4 changed files with 7 additions and 8 deletions
@@ -7,12 +7,12 @@
*/
#include "hdf_input_device_manager.h"
#include <securec.h>
#include "event_hub.h"
#include "hdf_base.h"
#include "hdf_device_object.h"
#include "hdf_log.h"
#include "osal_mem.h"
#include <securec.h>
#define NODE_MODE 0660
#define SERVICE_NAME_LEN 24
@@ -34,12 +34,11 @@ static bool IsHidDevice(uint32_t devType)
{
if ((devType > INDEV_TYPE_HID_BEGIN_POS) && (devType < INDEV_TYPE_UNKNOWN)) {
return true;
}
#ifdef CONFIG_ARCH_ROCKCHIP
else if (devType == INDEV_TYPE_KEY) {
} else if (devType == INDEV_TYPE_KEY) {
return true;
}
#endif
}
return false;
}
-2
View File
@@ -34,7 +34,6 @@ int32_t KeyIrqHandle(uint16_t intGpioNum, void *data)
return HDF_FAILURE;
}
ret = GpioDisableIrq(intGpioNum);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: disable irq failed, ret %d", __func__, ret);
}
@@ -66,7 +65,6 @@ static int32_t SetupKeyIrq(KeyDriver *keyDrv)
uint16_t intGpioNum = keyDrv->keyCfg->gpioNum;
uint16_t irqFlag = keyDrv->keyCfg->irqFlag;
int32_t ret = GpioSetDir(intGpioNum, GPIO_DIR_IN);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: gpio set dir failed, ret %d", __func__, ret);
return ret;
+2 -2
View File
@@ -194,7 +194,7 @@ static int32_t UpdateFirmware(ChipDevice *device)
}
HDF_LOGI("%s: buf[0]=0x%x", __func__, buf[0]);
if (buf[0] == firmWareParm[2]) {
if (buf[0] == firmWareParm[FIRMWARE_3RD]) {
HDF_LOGI("%s: needn't update fw version", __func__);
return HDF_SUCCESS;
}
@@ -215,7 +215,7 @@ static void SetAbility(ChipDevice *device)
device->driver->inputDev->abilitySet.absCode[0] = SET_BIT(ABS_X) | SET_BIT(ABS_Y);
device->driver->inputDev->abilitySet.absCode[1] = SET_BIT(ABS_MT_POSITION_X) |
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->abilitySet.keyCode[KEY_CODE_4TH] = 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 = device->boardCfg->attr.resolutionX - 1;
device->driver->inputDev->attrSet.axisInfo[ABS_X].range = 0;
@@ -44,6 +44,8 @@
#define GT_SOLU_X_HIGH 7
#define GT_SOLU_Y_LOW 8
#define GT_SOLU_Y_HIGH 9
#define FIRMWARE_3RD 2
#define KEY_CODE_4TH 3
#if defined(CONFIG_ARCH_ROCKCHIP)
#define FIRMWARE_LEN 241
#define GTP_REG_CONFIG_DATA 0x8050