input: ili9882_mmi: don't use kernel_read/write for 5.10

ili9882_mmi:
Don't use kernel_read/kernel_write for 5.10 kernel.
Use apk for factory test, so delete these functions are OK.

Change-Id: Ifccbb1dd37feec063affa0183c71fcdd427a700b
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2396131
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: <lvxj4@motorola.com>
Reviewed-by: Jing Hu <hujing3@lenovo.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2022-10-02 13:48:25 +08:00 • committed by Yeqing Wang
commit 39689b540f
4 changed files with 16 additions and 15 deletions

View file

@ -179,14 +179,14 @@ int ili_fw_dump_iram_data(u32 start, u32 end, bool save)
}
pos = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
kernel_write(f, fw_buf, len, &pos);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
vfs_write(f, fw_buf, len, &pos);
set_fs(old_fs);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
kernel_write(f, fw_buf, len, &pos);
#endif
filp_close(f, NULL);
ILI_INFO("Save iram data to %s\n", DUMP_IRAM_PATH);
@ -540,14 +540,14 @@ int ili_fw_dump_flash_data(u32 start, u32 end, bool user)
goto out;
pos = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
kernel_write(f, buf, length, &pos);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
vfs_write(f, buf, length, &pos);
set_fs(old_fs);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
kernel_write(f, buf, length, &pos);
#endif
filp_close(f, NULL);
ipio_vfree((void **)&buf);

View file

@ -239,14 +239,15 @@ int ili_fw_dump_iram_data(u32 start, u32 end, bool save)
}
pos = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
kernel_write(f, ilits->update_buf, len, &pos);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
vfs_write(f, ilits->update_buf, len, &pos);
set_fs(old_fs);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
kernel_write(f, ilits->update_buf, len, &pos);
#endif
filp_close(f, NULL);
ILI_INFO("Save iram data to %s\n", DUMP_IRAM_PATH);

View file

@ -3324,13 +3324,13 @@ static int mp_show_result(bool lcm_on)
}
pos = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
kernel_write(f, csv, csv_len, &pos);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
fs = get_fs();
set_fs(KERNEL_DS);
vfs_write(f, csv, csv_len, &pos);
set_fs(fs);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
kernel_write(f, csv, csv_len, &pos);
#endif
filp_close(f, NULL);

View file

@ -224,13 +224,13 @@ static int file_write(struct file_buffer *file, bool new_open)
return -1;
}
pos = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
kernel_write(f, file->ptr, file->wlen, &pos);
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
fs = get_fs();
set_fs(KERNEL_DS);
vfs_write(f, file->ptr, file->flen, &pos);
set_fs(fs);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
kernel_write(f, file->ptr, file->wlen, &pos);
#endif
filp_close(f, NULL);
return 0;