diff options
Diffstat (limited to 'goodix_ts_proc.c')
-rw-r--r-- | goodix_ts_proc.c | 166 |
1 files changed, 99 insertions, 67 deletions
diff --git a/goodix_ts_proc.c b/goodix_ts_proc.c index 41d1032..a8ed02f 100644 --- a/goodix_ts_proc.c +++ b/goodix_ts_proc.c @@ -50,6 +50,7 @@ #define CMD_GET_DUMP_LOG "get_dump_log" #define CMD_GET_STYLUS_DATA "get_stylus_data" #define CMD_SET_FREQ_INDEX "set_freq_index" +#define CMD_DISABLE_FILTER "disable_filter" char *cmd_list[] = { CMD_FW_UPDATE, CMD_AUTO_TEST, CMD_OPEN_TEST, CMD_SELF_OPEN_TEST, CMD_NOISE_TEST, CMD_AUTO_NOISE_TEST, CMD_SHORT_TEST, @@ -65,7 +66,7 @@ char *cmd_list[] = { CMD_FW_UPDATE, CMD_AUTO_TEST, CMD_OPEN_TEST, CMD_SET_GRIP_MODE, CMD_SET_PALM_MODE, CMD_SET_NOISE_MODE, CMD_SET_WATER_MODE, CMD_SET_HEATMAP, CMD_GET_SELF_COMPEN, CMD_SET_REPORT_RATE, CMD_GET_DUMP_LOG, CMD_GET_STYLUS_DATA, - CMD_SET_FREQ_INDEX, NULL }; + CMD_SET_FREQ_INDEX, CMD_DISABLE_FILTER, NULL }; /* test limits keyword */ #define CSV_TP_SPECIAL_RAW_MIN "special_raw_min" @@ -448,23 +449,23 @@ static int cal_cha_to_gnd_res(int v) static int malloc_test_resource(void) { - ts_test = kzalloc(sizeof(*ts_test), GFP_KERNEL); + ts_test = vzalloc(sizeof(*ts_test)); if (!ts_test) return -ENOMEM; if (raw_data_cnt > 0) { - ts_test->rawdata = kcalloc(raw_data_cnt, - sizeof(struct ts_test_rawdata), GFP_KERNEL); + ts_test->rawdata = + vzalloc(raw_data_cnt * sizeof(struct ts_test_rawdata)); if (ts_test->rawdata == NULL) return -ENOMEM; - ts_test->deltadata = kcalloc(raw_data_cnt, - sizeof(struct ts_test_rawdata), GFP_KERNEL); + ts_test->deltadata = + vzalloc(raw_data_cnt * sizeof(struct ts_test_rawdata)); if (ts_test->deltadata == NULL) return -ENOMEM; } if (noise_data_cnt > 0) { - ts_test->noisedata = kcalloc(noise_data_cnt, - sizeof(struct ts_test_rawdata), GFP_KERNEL); + ts_test->noisedata = vzalloc( + noise_data_cnt * sizeof(struct ts_test_rawdata)); if (ts_test->noisedata == NULL) return -ENOMEM; } @@ -475,10 +476,10 @@ static int malloc_test_resource(void) static void release_test_resource(void) { if (ts_test) { - kfree(ts_test->rawdata); - kfree(ts_test->deltadata); - kfree(ts_test->noisedata); - kfree(ts_test); + vfree(ts_test->rawdata); + vfree(ts_test->deltadata); + vfree(ts_test->noisedata); + vfree(ts_test); ts_test = NULL; } raw_data_cnt = 0; @@ -1209,7 +1210,7 @@ static void seq_stop(struct seq_file *s, void *v) { if (s->read_pos >= index) { // ts_info("read_pos:%d", (int)s->read_pos); - kfree(rbuf); + vfree(rbuf); rbuf = NULL; index = 0; release_test_resource(); @@ -2593,6 +2594,8 @@ static void goodix_get_fw_status(void) cd->hw_ops->read(cd, 0x1021A, &val, 1); index += sprintf( + &rbuf[index], "coordfilter_status[%d] ", (val >> 7) & 0x01); + index += sprintf( &rbuf[index], "set_highsense_mode[%d] ", (val >> 6) & 0x01); index += sprintf(&rbuf[index], "set_noise_mode[%d] ", (val >> 4) & 0x03); @@ -3010,7 +3013,7 @@ static void goodix_get_dump_log(void) static void goodix_get_stylus_data(void) { struct goodix_stylus_data stylus_data; - u8 temp_buf[40] = {0}; + u8 temp_buf[40] = { 0 }; u32 flag_addr = cd->ic_info.misc.touch_data_addr; int tx = cd->ic_info.parm.drv_num; int rx = cd->ic_info.parm.sen_num; @@ -3071,10 +3074,11 @@ static void goodix_get_stylus_data(void) angle_y = le16_to_cpup((__le16 *)(temp_buf + 18)) / 100; stylus_struct_addr = cd->ic_info.misc.frame_data_addr + - cd->ic_info.misc.frame_data_head_len + - cd->ic_info.misc.fw_attr_len + - cd->ic_info.misc.fw_log_len; - ret = cd->hw_ops->read(cd, stylus_struct_addr, (u8 *)&stylus_data, sizeof(stylus_data)); + cd->ic_info.misc.frame_data_head_len + + cd->ic_info.misc.fw_attr_len + + cd->ic_info.misc.fw_log_len; + ret = cd->hw_ops->read( + cd, stylus_struct_addr, (u8 *)&stylus_data, sizeof(stylus_data)); if (ret < 0) { ts_err("read stylus struct data failed"); goto exit; @@ -3160,6 +3164,17 @@ static void goodix_set_freq_index(int freq) cd->hw_ops->send_cmd(cd, &temp_cmd); } +static void goodix_disable_coor_filter(int val) +{ + struct goodix_ts_cmd temp_cmd; + + index = sprintf(rbuf, "disable coordinate filter %d\n", val); + temp_cmd.len = 5; + temp_cmd.cmd = 0xCA; + temp_cmd.data[0] = val ? 1 : 0; + cd->hw_ops->send_cmd(cd, &temp_cmd); +} + static ssize_t driver_test_write( struct file *file, const char __user *buf, size_t count, loff_t *pos) { @@ -3183,7 +3198,7 @@ static ssize_t driver_test_write( return count; } - kfree(rbuf); + vfree(rbuf); rbuf = NULL; index = 0; release_test_resource(); @@ -3191,13 +3206,13 @@ static ssize_t driver_test_write( ts_info("input cmd[%s]", p); if (!strncmp(p, CMD_FW_UPDATE, strlen(CMD_FW_UPDATE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); goodix_force_update(); goto exit; } if (!strncmp(p, CMD_GET_VERSION, strlen(CMD_GET_VERSION))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3212,7 +3227,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_RAWDATA, strlen(CMD_GET_RAWDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3225,7 +3240,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_BASEDATA, strlen(CMD_GET_BASEDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3238,7 +3253,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_DIFFDATA, strlen(CMD_GET_DIFFDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3251,7 +3266,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_SELF_RAWDATA, strlen(CMD_GET_SELF_RAWDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3264,7 +3279,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_SELF_DIFFDATA, strlen(CMD_GET_SELF_DIFFDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3278,7 +3293,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_SELF_BASEDATA, strlen(CMD_GET_SELF_BASEDATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3292,7 +3307,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_DOUBLE_TAP, strlen(CMD_SET_DOUBLE_TAP))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3323,7 +3338,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_SINGLE_TAP, strlen(CMD_SET_SINGLE_TAP))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3354,7 +3369,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_LONG_PRESS, strlen(CMD_SET_LONG_PRESS))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3385,7 +3400,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_IRQ_ENABLE, strlen(CMD_SET_IRQ_ENABLE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3414,7 +3429,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_ESD_ENABLE, strlen(CMD_SET_ESD_ENABLE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3443,7 +3458,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_DEBUG_LOG, strlen(CMD_SET_DEBUG_LOG))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3474,7 +3489,7 @@ static ssize_t driver_test_write( if (!strncmp(p, CMD_AUTO_TEST, strlen(CMD_AUTO_TEST))) { raw_data_cnt = 16; noise_data_cnt = 1; - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3494,7 +3509,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_CHANNEL_NUM, strlen(CMD_GET_CHANNEL_NUM))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3505,7 +3520,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_TX_FREQ, strlen(CMD_GET_TX_FREQ))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3525,7 +3540,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_SENSE_MODE, strlen(CMD_SET_SENSE_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3561,7 +3576,7 @@ static ssize_t driver_test_write( goto exit; } noise_data_cnt = cmd_val; - rbuf = kzalloc(noise_data_cnt * 2000 + 5000, GFP_KERNEL); + rbuf = vzalloc(noise_data_cnt * 2000 + 5000); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3595,7 +3610,7 @@ static ssize_t driver_test_write( ts_err("%s: invalid cmd param", CMD_AUTO_NOISE_TEST); goto exit; } - rbuf = kzalloc(HUGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(HUGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3605,7 +3620,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_PACKAGE_ID, strlen(CMD_GET_PACKAGE_ID))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3623,7 +3638,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_MCU_ID, strlen(CMD_GET_MCU_ID))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3640,7 +3655,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_SCAN_MODE, strlen(CMD_SET_SCAN_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3666,7 +3681,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_SCAN_MODE, strlen(CMD_GET_SCAN_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3676,7 +3691,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_CONTINUE_MODE, strlen(CMD_SET_CONTINUE_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3722,7 +3737,7 @@ static ssize_t driver_test_write( goto exit; } raw_data_cnt = cmd_val; - rbuf = kzalloc(raw_data_cnt * 5000 + 10000, GFP_KERNEL); + rbuf = vzalloc(raw_data_cnt * 5000 + 10000); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3739,7 +3754,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SELF_OPEN_TEST, strlen(CMD_SELF_OPEN_TEST))) { - rbuf = kzalloc(HUGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(HUGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3755,7 +3770,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SHORT_TEST, strlen(CMD_SHORT_TEST))) { - rbuf = kzalloc(HUGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(HUGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3771,7 +3786,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_CONFIG, strlen(CMD_GET_CONFIG))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3781,7 +3796,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_FW_STATUS, strlen(CMD_GET_FW_STATUS))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3792,7 +3807,7 @@ static ssize_t driver_test_write( if (!strncmp(p, CMD_SET_HIGHSENSE_MODE, strlen(CMD_SET_HIGHSENSE_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3818,7 +3833,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_GRIP_DATA, strlen(CMD_SET_GRIP_DATA))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3839,7 +3854,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_GRIP_MODE, strlen(CMD_SET_GRIP_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3860,7 +3875,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_PALM_MODE, strlen(CMD_SET_PALM_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3881,7 +3896,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_NOISE_MODE, strlen(CMD_SET_NOISE_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3902,7 +3917,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_WATER_MODE, strlen(CMD_SET_WATER_MODE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3923,7 +3938,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_ST_PARAM, strlen(CMD_SET_ST_PARAM))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3940,7 +3955,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_LP_PARAM, strlen(CMD_SET_LP_PARAM))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3957,7 +3972,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_HEATMAP, strlen(CMD_SET_HEATMAP))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3978,7 +3993,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_SELF_COMPEN, strlen(CMD_GET_SELF_COMPEN))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -3988,7 +4003,7 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_SET_REPORT_RATE, strlen(CMD_SET_REPORT_RATE))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -4009,25 +4024,25 @@ static ssize_t driver_test_write( } if (!strncmp(p, CMD_GET_DUMP_LOG, strlen(CMD_GET_DUMP_LOG))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); goodix_get_dump_log(); goto exit; } if (!strncmp(p, CMD_GET_STYLUS_DATA, strlen(CMD_GET_STYLUS_DATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); goodix_get_stylus_data(); goto exit; } if (!strncmp(p, CMD_GET_STYLUS_DATA, strlen(CMD_GET_STYLUS_DATA))) { - rbuf = kzalloc(LARGE_SIZE, GFP_KERNEL); + rbuf = vzalloc(LARGE_SIZE); goodix_get_stylus_data(); goto exit; } if (!strncmp(p, CMD_SET_FREQ_INDEX, strlen(CMD_SET_FREQ_INDEX))) { - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); token = strsep(&p, ","); if (!token || !p) { index = sprintf(rbuf, "%s: invalid cmd param\n", @@ -4043,7 +4058,24 @@ static ssize_t driver_test_write( goto exit; } - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + if (!strncmp(p, CMD_DISABLE_FILTER, strlen(CMD_DISABLE_FILTER))) { + rbuf = vzalloc(SHORT_SIZE); + token = strsep(&p, ","); + if (!token || !p) { + index = sprintf(rbuf, "%s: invalid cmd param\n", + CMD_DISABLE_FILTER); + goto exit; + } + if (kstrtos32(p, 10, &cmd_val)) { + index = sprintf(rbuf, "%s: invalid cmd param\n", + CMD_DISABLE_FILTER); + goto exit; + } + goodix_disable_coor_filter(cmd_val); + goto exit; + } + + rbuf = vzalloc(SHORT_SIZE); if (!rbuf) { ts_err("failed to alloc rbuf"); goto exit; @@ -4113,13 +4145,13 @@ int driver_test_selftest(char* buf) release_test_resource(); index = 0; if (rbuf != NULL) { - kfree(rbuf); + vfree(rbuf); rbuf = NULL; } raw_data_cnt = 16; noise_data_cnt = 1; - rbuf = kzalloc(SHORT_SIZE, GFP_KERNEL); + rbuf = vzalloc(SHORT_SIZE); if (rbuf == NULL) { ts_err("failed to alloc rbuf"); ret = -ENOMEM; |