diff options
author | Xiaohui Tao <xtao@nvidia.com> | 2013-12-17 16:54:34 -0500 |
---|---|---|
committer | David Pu <dpu@nvidia.com> | 2017-07-27 19:09:19 -0400 |
commit | a4b824bb9cd14f2b7be981f982332449c014f68e (patch) | |
tree | 37d9653f4c157137c156bfeba2e3d57944353e5f /drivers/input/touchscreen/rm31080a_ctrl.c | |
parent | aa0bbe6e619df646a13c8b60197c3001885bc8e0 (diff) |
input: touch: Raydium: Code drop v61.5
[1] Partially resolve user space pointer directly used in kernel driver (except DEV_ATTR part)
[2] Report mode switch support
[3] Refine multiple input devices and input protocol A
[4] Support eraser
[5] Implement mechanism to ensure multi-resume/suspend will be correctly executed
[6] Fix CS cmd fail issue
[7] Fix fast draw suffered from line broken issue
[8] Fix idle mode stability on Ardbeg issue
Bug 1414130
Bug 1408503
Bug 1398820
Bug 1398173
Bug 1371286
Bug 1392722
Change-Id: Icbd9250339a04f60390d5247e37aad3bfc49c526
Reviewed-on: http://git-master/r/346650
GVS: Gerrit_Virtual_Submit
Reviewed-by: Xiaohui Tao <xtao@nvidia.com>
Tested-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/input/touchscreen/rm31080a_ctrl.c')
-rw-r--r-- | drivers/input/touchscreen/rm31080a_ctrl.c | 64 |
1 files changed, 4 insertions, 60 deletions
diff --git a/drivers/input/touchscreen/rm31080a_ctrl.c b/drivers/input/touchscreen/rm31080a_ctrl.c index f95c7f449..68f0201bc 100644 --- a/drivers/input/touchscreen/rm31080a_ctrl.c +++ b/drivers/input/touchscreen/rm31080a_ctrl.c | |||
@@ -30,65 +30,6 @@ struct rm_tch_ctrl_para g_stCtrl; | |||
30 | /*============================================================================= | 30 | /*============================================================================= |
31 | FUNCTION DECLARATION | 31 | FUNCTION DECLARATION |
32 | =============================================================================*/ | 32 | =============================================================================*/ |
33 | |||
34 | /*============================================================================= | ||
35 | Description: | ||
36 | Control functions for Touch IC | ||
37 | Input: | ||
38 | |||
39 | Output: | ||
40 | |||
41 | =============================================================================*/ | ||
42 | int rm_tch_ctrl_clear_int(void) | ||
43 | { | ||
44 | u8 flag; | ||
45 | if (g_stCtrl.bICVersion >= 0xD0) | ||
46 | return rm_tch_spi_byte_read(0x72, &flag); | ||
47 | else | ||
48 | return rm_tch_spi_byte_read(0x02, &flag); | ||
49 | } | ||
50 | |||
51 | int rm_tch_ctrl_scan_start(void) | ||
52 | { | ||
53 | return rm_tch_spi_byte_write(RM31080_REG_11, 0x17); | ||
54 | } | ||
55 | |||
56 | void rm_tch_ctrl_wait_for_scan_finish(void) | ||
57 | { | ||
58 | u8 u8reg11; | ||
59 | int i; | ||
60 | /*50ms = 20Hz*/ | ||
61 | for (i = 0; i < 50; i++) { | ||
62 | rm_tch_spi_byte_read(RM31080_REG_11, &u8reg11); | ||
63 | if (u8reg11 & 0x01) | ||
64 | usleep_range(1000, 2000);/* msleep(1); */ | ||
65 | else | ||
66 | break; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /*============================================================================= | ||
71 | Description: | ||
72 | |||
73 | Input: | ||
74 | N/A | ||
75 | Output: | ||
76 | N/A | ||
77 | =============================================================================*/ | ||
78 | void rm_set_repeat_times(u8 u8Times) | ||
79 | { | ||
80 | u8 bReg1_1Fh = 0x00; | ||
81 | |||
82 | rm_tch_spi_byte_write(0x0E, u8Times&0x1F); | ||
83 | |||
84 | bReg1_1Fh &= ~FILTER_NONTHRESHOLD_MODE; | ||
85 | |||
86 | if (u8Times != REPEAT_1) | ||
87 | bReg1_1Fh |= 0x44; | ||
88 | |||
89 | rm_tch_spi_byte_write(RM31080_REG_1F, bReg1_1Fh); | ||
90 | } | ||
91 | |||
92 | /*============================================================================= | 33 | /*============================================================================= |
93 | Description: | 34 | Description: |
94 | 35 | ||
@@ -129,7 +70,10 @@ unsigned char rm_tch_ctrl_get_idle_mode(u8 *p) | |||
129 | =============================================================================*/ | 70 | =============================================================================*/ |
130 | void rm_tch_ctrl_set_parameter(void *arg) | 71 | void rm_tch_ctrl_set_parameter(void *arg) |
131 | { | 72 | { |
132 | memcpy(&g_stCtrl, arg, sizeof(struct rm_tch_ctrl_para)); | 73 | ssize_t missing; |
74 | missing = copy_from_user(&g_stCtrl, arg, sizeof(struct rm_tch_ctrl_para)); | ||
75 | if (missing) | ||
76 | return; | ||
133 | } | 77 | } |
134 | 78 | ||
135 | /*===========================================================================*/ | 79 | /*===========================================================================*/ |