aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/mxt224_u1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/mxt224_u1.c')
-rw-r--r--drivers/input/touchscreen/mxt224_u1.c56
1 files changed, 34 insertions, 22 deletions
diff --git a/drivers/input/touchscreen/mxt224_u1.c b/drivers/input/touchscreen/mxt224_u1.c
index a2b0a1d..f4368e8 100644
--- a/drivers/input/touchscreen/mxt224_u1.c
+++ b/drivers/input/touchscreen/mxt224_u1.c
@@ -456,12 +456,15 @@ static void mxt224_ta_probe(bool ta_status)
copy_data->noise_median.mferr_setting = false;
#endif
} else {
- if (copy_data->boot_or_resume == 1)
+ if (copy_data->boot_or_resume == 1) {
copy_data->threshold = copy_data->tchthr_batt_init;
- else
+ calcfg_dis = copy_data->calcfg_batt_e;
+ } else {
copy_data->threshold = copy_data->tchthr_batt;
+ calcfg_dis = copy_data->calcfg_batt_e ^ 0x20;
+ }
copy_data->threshold_e = copy_data->tchthr_batt_e;
- calcfg_dis = copy_data->calcfg_batt_e;
+
calcfg_en = copy_data->calcfg_batt_e | 0x20;
noise_threshold = copy_data->noisethr_batt;
charge_time = copy_data->chrgtime_batt_e;
@@ -530,11 +533,13 @@ static void mxt224_ta_probe(bool ta_status)
size_one = 1;
write_mem(copy_data, obj_address + (u16) register_address,
size_one, &value);
+#if !defined(PRODUCT_SHIP)
read_mem(copy_data, obj_address + (u16) register_address,
(u8) size_one, &val);
printk(KERN_ERR "[TSP]TA_probe MXT224E T%d Byte%d is %d\n", 48,
register_address, val);
#endif
+#endif
if (ta_status)
write_config(copy_data, PROCG_NOISESUPPRESSION_T48,
copy_data->noise_suppression_cfg_ta);
@@ -546,55 +551,53 @@ static void mxt224_ta_probe(bool ta_status)
value = copy_data->blen_charging_e;
write_mem(copy_data, obj_address + 34, size_one,
&value);
+#if !defined(PRODUCT_SHIP)
read_mem(copy_data, obj_address + 34, (u8) size_one,
&val);
printk(KERN_DEBUG
"[TSP]TA_probe MXT224E T%d Byte%d is %d\n", 48,
34, val);
+#endif
value = 40;
write_mem(copy_data, obj_address + 35, size_one,
&value);
+#if !defined(PRODUCT_SHIP)
read_mem(copy_data, obj_address + 35, (u8) size_one,
&val);
printk(KERN_DEBUG
"[TSP]TA_probe MXT224E T%d Byte%d is %d\n", 48,
35, val);
+#endif
value = 240;
write_mem(copy_data, obj_address + 43, size_one,
&value);
- read_mem(copy_data, obj_address + 43, (u8) size_one,
- &val);
value = 245;
write_mem(copy_data, obj_address + 44, size_one,
&value);
- read_mem(copy_data, obj_address + 44, (u8) size_one,
- &val);
value = 148;
write_mem(copy_data, obj_address + 47, size_one,
&value);
- read_mem(copy_data, obj_address + 47, (u8) size_one,
- &val);
value = 50;
write_mem(copy_data, obj_address + 48, size_one,
&value);
- read_mem(copy_data, obj_address + 48, (u8) size_one,
- &val);
}
#endif
#ifndef CONFIG_TARGET_LOCALE_NAATT_TEMP
value = calcfg_en;
write_mem(copy_data, obj_address + (u16) register_address,
size_one, &value);
+#if !defined(PRODUCT_SHIP)
read_mem(copy_data, obj_address + (u16) register_address,
(u8) size_one, &val);
printk(KERN_ERR "[TSP]TA_probe MXT224E T%d Byte%d is %d\n", 48,
register_address, val);
#endif
+#endif
} else {
if (copy_data->freq_table.fherr_setting >= 1) {
ret = get_object_info(copy_data, GEN_POWERCONFIG_T7,
@@ -637,10 +640,12 @@ static void mxt224_ta_probe(bool ta_status)
value = (u8) copy_data->threshold;
write_mem(copy_data, obj_address + (u16) register_address,
size_one, &value);
+#if !defined(PRODUCT_SHIP)
read_mem(copy_data, obj_address + (u16) register_address,
(u8) size_one, &val);
printk(KERN_ERR "[TSP]TA_probe MXT224 T%d Byte%d is %d\n", 9,
register_address, val);
+#endif
value = noise_threshold;
register_address = 8;
@@ -685,7 +690,7 @@ void check_chip_calibration(unsigned char one_touch_input_flag)
get_object_info(copy_data, DEBUG_DIAGNOSTIC_T37, &size,
&object_address);
- mdelay(10);
+ usleep_range(10000, 10000);
/* read touch flags from the diagnostic object
- clear buffer so the while loop can run first time */
@@ -703,7 +708,7 @@ void check_chip_calibration(unsigned char one_touch_input_flag)
break;
}
- mdelay(2); /* 0318 hugh 3-> 2 */
+ usleep_range(2000, 2000); /* 0318 hugh 3-> 2 */
try_ctr++; /* timeout counter */
/* read_mem(diag_address, 2,data_buffer); */
@@ -1237,6 +1242,7 @@ static void report_input_data(struct mxt224_data *data)
#else
printk(KERN_ERR "[TSP] Up[%d]\n", i);
#endif
+
continue;
}
@@ -1537,6 +1543,7 @@ static void median_err_setting(void)
write_mem(copy_data, obj_address+39, 1,
&value);
#else
+#if 0
ret =
get_object_info(copy_data,
TOUCH_MULTITOUCHSCREEN_T9,
@@ -1550,18 +1557,19 @@ static void median_err_setting(void)
value = 80;
write_mem(copy_data, obj_address + 13, 1,
&value);
+#endif
ret |=
get_object_info(copy_data,
SPT_CTECONFIG_T46,
&size_one, &obj_address);
- value = 32;
+ value = 48; /* 32;*/
write_mem(copy_data, obj_address + 3, 1,
&value);
ret |=
get_object_info(copy_data,
PROCG_NOISESUPPRESSION_T48,
&size_one, &obj_address);
- value = 29;
+ value = 20; /*29;*/
write_mem(copy_data, obj_address + 3, 1,
&value);
value = 1;
@@ -1570,25 +1578,27 @@ static void median_err_setting(void)
value = 2;
write_mem(copy_data, obj_address + 9, 1,
&value);
- value = 100;
+ value = 64; /*100;*/
write_mem(copy_data, obj_address + 17, 1,
&value);
value = 64;
write_mem(copy_data, obj_address + 19, 1,
&value);
- value = 20;
+ value = 100; /*20;*/
write_mem(copy_data, obj_address + 22, 1,
&value);
- value = 38;
+ value = 100; /*38;*/
write_mem(copy_data, obj_address + 25, 1,
&value);
+#if 0
value = 16;
write_mem(copy_data, obj_address + 34, 1,
&value);
+#endif
value = 40;
write_mem(copy_data, obj_address + 35, 1,
&value);
- value = 80;
+ value = 81; /*80;*/
write_mem(copy_data, obj_address + 39, 1,
&value);
#endif
@@ -1665,7 +1675,7 @@ static void median_err_setting(void)
get_object_info(copy_data,
SPT_CTECONFIG_T46,
&size_one, &obj_address);
- value = 63; /* actvsyncsperx */
+ value = 53; /* actvsyncsperx */
write_mem(copy_data, obj_address + 3, 1,
&value);
}
@@ -2905,7 +2915,7 @@ static ssize_t set_mxt_update_show(struct device *dev,
printk(KERN_ERR "[TSP] The firmware update succeeded\n");
/* Wait for reset */
- mdelay(QT602240_FWRESET_TIME);
+ msleep(QT602240_FWRESET_TIME);
/* initialize the TSP */
mxt224_init_touch_driver(data);
/*jerry no need of it */
@@ -3362,7 +3372,9 @@ static int __devinit mxt224_probe(struct i2c_client *client,
data->gpio_read_done = pdata->gpio_read_done;
data->power_on();
-
+#if defined(CONFIG_MACH_M0_GRANDECTC)
+ msleep(100);
+#endif
ret = mxt224_init_touch_driver(data);
if (ret) {
dev_err(&client->dev, "chip initialization failed\n");