diff options
author | Xiaohui Tao <xtao@nvidia.com> | 2013-07-30 12:40:14 -0400 |
---|---|---|
committer | David Pu <dpu@nvidia.com> | 2017-07-27 19:09:19 -0400 |
commit | 4bd6911da8e3b6134f72d708193f8dd99e49463e (patch) | |
tree | 0d753bb55f2bc5106b53a41bf6781e90fa0521da /drivers/input/touchscreen/rm31080a_ctrl.c | |
parent | 4686f6b797789d1508c6cc0c02a3258b974ca40e (diff) |
input: touchscreen: raydium v60.0 touch driver
raydium code drop
[1] Shorten suspend/resume duration
[2] Uniform debug msgs (with prefix "Raydium" and using dev_info instead of printk)
[3] Idle mode abnormal CPU clock frequency
[4] AVC snesor support (To verify AVC sensor, the return value of rm_tch_get_gpio_sensor_select routine in rm31080a_ts.c should be changed from 0 to 1. *0 for normal dalmore sensor ; 1 for ANC sensor)
[5] Pismo support (To verify Pismo, the past platform ID of dalmore_touch_init routine in /kernel/arch/arm/mach-tegra/board-dalmore.c should be changed from RM_PLATFORM_D010 to RM_PLATFORM_P140)
[6] Reduce TCH_WAKE_LOCK_TIMEOUT from 2 secs to 500 msec
Bug 1343545
Change-Id: Ia65ecb13dc667fce937e82858321ca44f50bb733
Signed-off-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-on: http://git-master/r/255657
(cherry picked from commit ad8d07d3ce337390b34784387693b63c6f4ca7d2)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/258557
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'drivers/input/touchscreen/rm31080a_ctrl.c')
-rw-r--r-- | drivers/input/touchscreen/rm31080a_ctrl.c | 55 |
1 files changed, 7 insertions, 48 deletions
diff --git a/drivers/input/touchscreen/rm31080a_ctrl.c b/drivers/input/touchscreen/rm31080a_ctrl.c index 04f9f70e9..50a70c046 100644 --- a/drivers/input/touchscreen/rm31080a_ctrl.c +++ b/drivers/input/touchscreen/rm31080a_ctrl.c | |||
@@ -14,9 +14,9 @@ | |||
14 | INCLUDED FILES | 14 | INCLUDED FILES |
15 | =============================================================================*/ | 15 | =============================================================================*/ |
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <asm/uaccess.h> // copy_to_user(), | 17 | #include <asm/uaccess.h> /* copy_to_user() */ |
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/module.h> // Module definition | 19 | #include <linux/module.h> /* Module definition */ |
20 | 20 | ||
21 | #include <linux/spi/rm31080a_ts.h> | 21 | #include <linux/spi/rm31080a_ts.h> |
22 | #include <linux/spi/rm31080a_ctrl.h> | 22 | #include <linux/spi/rm31080a_ctrl.h> |
@@ -24,7 +24,7 @@ | |||
24 | /*============================================================================= | 24 | /*============================================================================= |
25 | GLOBAL VARIABLES DECLARATION | 25 | GLOBAL VARIABLES DECLARATION |
26 | =============================================================================*/ | 26 | =============================================================================*/ |
27 | struct rm31080a_ctrl_para g_stCtrl; | 27 | struct rm_tch_ctrl_para g_stCtrl; |
28 | 28 | ||
29 | /*============================================================================= | 29 | /*============================================================================= |
30 | FUNCTION DECLARATION | 30 | FUNCTION DECLARATION |
@@ -77,16 +77,10 @@ void rm_tch_ctrl_wait_for_scan_finish(void) | |||
77 | void rm_set_repeat_times(u8 u8Times) | 77 | void rm_set_repeat_times(u8 u8Times) |
78 | { | 78 | { |
79 | u8 bReg1_1Fh = 0x00; | 79 | u8 bReg1_1Fh = 0x00; |
80 | u8 u8Reg = 0x00; | ||
81 | 80 | ||
82 | u8Reg = g_stCtrl.bSenseNumber - 1; | ||
83 | rm_tch_spi_byte_write(0x0A, u8Reg&0x0F); | ||
84 | rm_tch_spi_byte_write(0x0E, u8Times&0x1F); | 81 | rm_tch_spi_byte_write(0x0E, u8Times&0x1F); |
85 | 82 | ||
86 | if (g_stCtrl.bfTHMode) | 83 | bReg1_1Fh &= ~FILTER_NONTHRESHOLD_MODE; |
87 | bReg1_1Fh |= FILTER_THRESHOLD_MODE; | ||
88 | else | ||
89 | bReg1_1Fh &= ~FILTER_NONTHRESHOLD_MODE; | ||
90 | 84 | ||
91 | if (u8Times != REPEAT_1) | 85 | if (u8Times != REPEAT_1) |
92 | bReg1_1Fh |= 0x44; | 86 | bReg1_1Fh |= 0x44; |
@@ -104,7 +98,7 @@ void rm_set_repeat_times(u8 u8Times) | |||
104 | =============================================================================*/ | 98 | =============================================================================*/ |
105 | void rm_tch_ctrl_init(void) | 99 | void rm_tch_ctrl_init(void) |
106 | { | 100 | { |
107 | memset(&g_stCtrl, 0, sizeof(struct rm31080a_ctrl_para)); | 101 | memset(&g_stCtrl, 0, sizeof(struct rm_tch_ctrl_para)); |
108 | } | 102 | } |
109 | 103 | ||
110 | /*============================================================================= | 104 | /*============================================================================= |
@@ -132,44 +126,9 @@ unsigned char rm_tch_ctrl_get_idle_mode(u8 *p) | |||
132 | Output: | 126 | Output: |
133 | N/A | 127 | N/A |
134 | =============================================================================*/ | 128 | =============================================================================*/ |
135 | void rm_tch_ctrl_get_parameter(void *arg) | 129 | void rm_tch_ctrl_set_parameter(void *arg) |
136 | { | 130 | { |
137 | #define PARA_BASIC_LEN 4 | 131 | memcpy(&g_stCtrl, arg, sizeof(struct rm_tch_ctrl_para)); |
138 | #define PARA_HARDWARE_LEN 28 | ||
139 | #define PARA_NOISE_LEN 32 | ||
140 | #define PARA_ALGORITHM_LEN 128 | ||
141 | |||
142 | u8 Temp; | ||
143 | u8 *pPara; | ||
144 | |||
145 | pPara = (u8 *) arg; | ||
146 | Temp = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + PARA_NOISE_LEN + PARA_ALGORITHM_LEN + 3]; | ||
147 | rm_tch_set_autoscan(Temp); | ||
148 | |||
149 | g_stCtrl.bICVersion = pPara[PARA_BASIC_LEN - 1]; | ||
150 | g_stCtrl.bADCNumber = pPara[PARA_BASIC_LEN + 5]; | ||
151 | g_stCtrl.bChannelNumberX = pPara[PARA_BASIC_LEN]; | ||
152 | g_stCtrl.bChannelNumberY = pPara[PARA_BASIC_LEN + 1]; | ||
153 | g_stCtrl.u16DataLength = (g_stCtrl.bChannelNumberX + 2 + g_stCtrl.bADCNumber) * (g_stCtrl.bChannelNumberY); | ||
154 | |||
155 | g_stCtrl.bActiveRepeatTimes[0] = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + 4]; | ||
156 | g_stCtrl.bActiveRepeatTimes[1] = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + 5]; | ||
157 | g_stCtrl.bIdleRepeatTimes[0] = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + 6]; | ||
158 | g_stCtrl.bIdleRepeatTimes[1] = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + 7]; | ||
159 | g_stCtrl.bSenseNumber = pPara[PARA_BASIC_LEN + 10]; | ||
160 | g_stCtrl.bfTHMode = pPara[PARA_BASIC_LEN + PARA_HARDWARE_LEN + 10]; | ||
161 | g_stCtrl.bTime2Idle = pPara[194]; | ||
162 | g_stCtrl.bfPowerMode = pPara[195]; | ||
163 | g_stCtrl.bDebugMessage = pPara[204]; | ||
164 | g_stCtrl.bTimerTriggerScale = pPara[205]; | ||
165 | |||
166 | g_stCtrl.u16ResolutionX = ((u16) pPara[PARA_BASIC_LEN + 12]) << 8 | ((u16)pPara[PARA_BASIC_LEN + 11]); | ||
167 | g_stCtrl.u16ResolutionY = ((u16) pPara[PARA_BASIC_LEN + 14]) << 8 | ((u16)pPara[PARA_BASIC_LEN + 13]); | ||
168 | |||
169 | if ((g_stCtrl.u16ResolutionX == 0) || (g_stCtrl.u16ResolutionY == 0)) { | ||
170 | g_stCtrl.u16ResolutionX = RM_INPUT_RESOLUTION_X; | ||
171 | g_stCtrl.u16ResolutionY = RM_INPUT_RESOLUTION_Y; | ||
172 | } | ||
173 | } | 132 | } |
174 | 133 | ||
175 | /*=============================================================================*/ | 134 | /*=============================================================================*/ |