summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/input/touchscreen/rm31080a_ts.c47
-rw-r--r--include/linux/spi/rm31080a_ts.h13
2 files changed, 56 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/rm31080a_ts.c b/drivers/input/touchscreen/rm31080a_ts.c
index c3e8e7d791fb..91417be85d22 100644
--- a/drivers/input/touchscreen/rm31080a_ts.c
+++ b/drivers/input/touchscreen/rm31080a_ts.c
@@ -1,8 +1,8 @@
/*
* Raydium RM31080 touchscreen driver
*
- * Copyright (C) 2012 - 2013, Raydium Semiconductor Corporation.
- * Copyright (C) 2012 - 2013, NVIDIA Corporation, All Rights Reserved.
+ * Copyright (C) 2012-2013, Raydium Semiconductor Corporation.
+ * Copyright (C) 2012-2013, NVIDIA Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -38,6 +38,7 @@
#define CREATE_TRACE_POINTS
#include <trace/events/touchscreen_raydium.h>
+
/*=========================================================================*/
/*DEFINITIONS */
/*=========================================================================*/
@@ -104,11 +105,16 @@ struct rm31080a_ts_para {
bool bEnableAutoScan;
bool bIsSuspended;
+ bool bInitStartFlag;
+ bool bInitFailFlag;
+ bool bReissueSignalFlag;
+
struct mutex mutex_scan_mode;
#ifdef ENABLE_WORK_QUEUE
struct workqueue_struct *rm_workqueue;
struct work_struct rm_work;
#endif
+
#ifdef ENABLE_RAW_DATA_QUEUE
u8 u8ScanModeState;
#endif
@@ -693,13 +699,14 @@ void rm31080_ctrl_enter_auto_mode(void)
{
if (g_stCtrl.bICVersion == T007A6)
rm31080_ts_send_signal(g_stTs.ulHalPID,
- RM_SIGNAL_ENTER_AUTO_SCAN);
+ RM_SIGNAL_ENTER_AUTO_SCAN);
/*Enable auto scan */
if (g_stCtrl.bfIdleMessage)
rm_printk("Enter Auto Scan Mode\n");
/*Set idle*/
rm_set_idle(1);
+
if (g_stCtrl.bSTScan)
rm_set_auto(1);
else
@@ -715,6 +722,7 @@ void rm31080_ctrl_leave_auto_mode(void)
rm_printk("Leave Auto Scan Mode\n");
/*leave idle*/
rm_set_idle(0);
+
if (g_stCtrl.bSTScan)
rm_set_auto(0);
else
@@ -829,6 +837,9 @@ static int rm31080_ctrl_suspend(struct rm31080_ts *ts)
"raydium regulator 1.8V disable failed: %d\n",
error);
}
+ printk(KERN_ALERT "Raydium Sending SUSPEND complete\n");
+ if (g_stTs.bInitStartFlag)
+ g_stTs.bInitFailFlag = 1;
mutex_unlock(&g_stTs.mutex_scan_mode);
return 1;
}
@@ -1625,6 +1636,11 @@ static void rm31080_init_ts_structure(void)
g_stTs.rm_workqueue = create_singlethread_workqueue("rm_work");
INIT_WORK(&g_stTs.rm_work, rm_work_handler);
#endif
+
+ g_stTs.bInitStartFlag = 0;
+ g_stTs.bInitFailFlag = 0;
+ g_stTs.bReissueSignalFlag = 0;
+
mutex_init(&g_stTs.mutex_scan_mode);
}
@@ -1784,7 +1800,17 @@ static void rm31080_start(struct rm31080_ts *ts)
/* 7. delay */
msleep(20);
rm31080_init_ts_structure_part();
- rm31080_ts_send_signal(g_stTs.ulHalPID, RM_SIGNAL_RESUME);
+
+ if (g_stTs.bInitStartFlag) {
+ if (!g_stTs.bReissueSignalFlag) {
+ printk(KERN_ALERT "Raydium Re-Sending RESUME complete\n");
+ rm31080_ts_send_signal(g_stTs.ulHalPID, RM_SIGNAL_RESUME);
+ g_stTs.bReissueSignalFlag = 1;
+ }
+ } else {
+ printk(KERN_ALERT "Raydium Sending RESUME complete\n");
+ rm31080_ts_send_signal(g_stTs.ulHalPID, RM_SIGNAL_RESUME);
+ }
#elif defined(ENABLE_AUTO_SCAN)
rm31080_ctrl_clear_int();
rm31080_ctrl_scan_start();
@@ -1902,6 +1928,7 @@ struct rm31080_ts *rm31080_input_init(struct device *dev, unsigned int irq,
ts->irq = irq;
pdata = dev->platform_data;
+
if (pdata->name_of_clock || pdata->name_of_clock_con) {
ts->clk = clk_get_sys(pdata->name_of_clock,
pdata->name_of_clock_con);
@@ -2075,11 +2102,19 @@ static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
case RM_IOCTL_INIT_START:
g_stTs.bInitFinish = 0;
+ g_stTs.bInitStartFlag = 1;
+ printk(KERN_ALERT "Raydium Received RM_IOCTL_INIT_START.");
+ printk(KERN_ALERT " Touch not ready, ScanModeState = 0x%x\n",
+ g_stTs.u8ScanModeState);
rm31080_enter_manual_mode();
break;
case RM_IOCTL_INIT_END:
+ printk(KERN_ALERT "Raydium Received RM_IOCTL_INIT_END");
+ printk(KERN_ALERT " Touch ready.\n");
g_stTs.bInitFinish = 1;
g_stTs.bCalcFinish = 1;
+ g_stTs.bInitStartFlag = 0;
+ g_stTs.bReissueSignalFlag = 0;
#ifdef ENABLE_RAW_DATA_QUEUE
ret = rm31080_ctrl_scan_start();
#endif
@@ -2126,6 +2161,10 @@ static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case RM_IOCTL_GET_SACN_MODE:
rm31080_ctrl_get_idle_mode((u8 *) arg);
break;
+ case RM_IOCTL_CHECK_INIT_STATUS:
+ ret = g_stTs.bInitFailFlag;
+ g_stTs.bInitFailFlag = 0;
+ break;
default:
break;
diff --git a/include/linux/spi/rm31080a_ts.h b/include/linux/spi/rm31080a_ts.h
index 42ee65910627..9a1364ec8240 100644
--- a/include/linux/spi/rm31080a_ts.h
+++ b/include/linux/spi/rm31080a_ts.h
@@ -1,3 +1,15 @@
+/*
+ * Raydium RM31080 touchscreen header
+ *
+ * Copyright (C) 2012-2013, Raydium Semiconductor Corporation.
+ * Copyright (C) 2012-2013, NVIDIA Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
#ifndef _RM31080A_TS_H_
#define _RM31080A_TS_H_
@@ -42,6 +54,7 @@
#define RM_VARIABLE_PLATFORM_ID 0x01
#define RM_IOCTL_SET_SLOWSCAN_PARA 0x1012
#define RM_IOCTL_GET_SACN_MODE 0x1013
+#define RM_IOCTL_CHECK_INIT_STATUS 0x1014
#define RM_INPUT_RESOLUTION_X 4096
#define RM_INPUT_RESOLUTION_Y 4096