summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSivasankari <Sivasankari.muthusamy@st.com>2019-09-20 11:04:17 +0800
committerDavid Chen <davidycchen@google.com>2019-10-05 06:46:49 +0000
commitc363effc7bdf48edcb238bd6ff1701063adc46da (patch)
treea58e50a1eb589666e9489d85858886a2bc60c7f4
parentf0b761ffa445e96049801c7b56c6f5ae88bf0000 (diff)
downloadfts_touch_s5-c363effc7bdf48edcb238bd6ff1701063adc46da.tar.gz
input: touchscreen: stm: Driver version 5.2.16.12
Option to read Filter raw data new API to know the status of the Info block Signed-off-by: Sivasankari <Sivasankari.muthusamy@st.com> Change-Id: Ibc098031740716c2b5314a5faea6139ca5f7344f (cherry picked from commit eb9dce5460a23dedff4c3ce6d6d1f5c84eede795)
-rw-r--r--fts.c13
-rw-r--r--fts.h4
-rw-r--r--fts_lib/ftsError.h3
-rw-r--r--fts_lib/ftsHardware.h4
-rw-r--r--fts_lib/ftsSoftware.h3
-rw-r--r--fts_lib/ftsTest.c16
-rw-r--r--fts_proc.c18
7 files changed, 58 insertions, 3 deletions
diff --git a/fts.c b/fts.c
index 9486986..32d61ea 100644
--- a/fts.c
+++ b/fts.c
@@ -1961,7 +1961,11 @@ static ssize_t stm_fts_cmd_show(struct device *dev,
* FIFO)
*/
flushFIFO();
+#ifdef READ_FILTERED_RAW
+ res = getMSFrame3(MS_FILTER, &frameMS);
+#else
res = getMSFrame3(MS_RAW, &frameMS);
+#endif
if (res < 0) {
pr_err("Error while taking the MS frame... ERROR %08X\n",
res);
@@ -2008,10 +2012,17 @@ static ssize_t stm_fts_cmd_show(struct device *dev,
*/
if (numberParameters >= 2 &&
typeOfCommand[1] == LOCKED_LP_DETECT)
+#ifdef READ_FILTERED_RAW
+ res = getSSFrame3(SS_DETECT_FILTER, &frameSS);
+#else
res = getSSFrame3(SS_DETECT_RAW, &frameSS);
+#endif
else
+#ifdef READ_FILTERED_RAW
+ res = getSSFrame3(SS_FILTER, &frameSS);
+#else
res = getSSFrame3(SS_RAW, &frameSS);
-
+#endif
if (res < OK) {
pr_err("Error while taking the SS frame... ERROR %08X\n",
res);
diff --git a/fts.h b/fts.h
index 977afb7..1c80d12 100644
--- a/fts.h
+++ b/fts.h
@@ -58,9 +58,9 @@
*/
/* **** CODE CONFIGURATION **** */
#define FTS_TS_DRV_NAME "fts" /* driver name */
-#define FTS_TS_DRV_VERSION "5.2.16.11" /* driver version string
+#define FTS_TS_DRV_VERSION "5.2.16.12" /* driver version string
* */
-#define FTS_TS_DRV_VER 0x0502100B /* driver version u32 format */
+#define FTS_TS_DRV_VER 0x0502100C /* driver version u32 format */
/* #define DEBUG */ /* /< define to print more logs in the kernel log
* and better follow the code flow */
diff --git a/fts_lib/ftsError.h b/fts_lib/ftsError.h
index 1186ecf..d3a539f 100644
--- a/fts_lib/ftsError.h
+++ b/fts_lib/ftsError.h
@@ -139,6 +139,9 @@
#define ERROR_CH_LEN (0x80001500) /* /< unable to retrieve
* the force and/or
* sense length */
+#define ERROR_INFO_BLOCK (0x80001600) /* /< info
+ * block
+ * corruption */
/** @}*/
/* THIRD LEVEL ERROR CODE */
diff --git a/fts_lib/ftsHardware.h b/fts_lib/ftsHardware.h
index 7e2b6cd..20844cb 100644
--- a/fts_lib/ftsHardware.h
+++ b/fts_lib/ftsHardware.h
@@ -47,6 +47,10 @@
* a single i2c write on mem,
* max allowed value is 2kB */
+#define READ_FILTERED_RAW /* /< To understand
+ * which type of RAW data to read
+ * OCTA panel needs to read Filtered RAW */
+
/* PROTOCOL INFO */
#define SPI_INETERFACE
#ifdef I2C_INTERFACE
diff --git a/fts_lib/ftsSoftware.h b/fts_lib/ftsSoftware.h
index c2c8ee4..38b6571 100644
--- a/fts_lib/ftsSoftware.h
+++ b/fts_lib/ftsSoftware.h
@@ -465,6 +465,9 @@ typedef enum {
* Subsection Area */
#define EVT_TYPE_ERROR_ESD 0xF0 /* /< ESD error */
+
+#define EVT_TYPE_ERROR_OSC_TRIM 0x24 /* /< OSC Trim error */
+#define EVT_TYPE_ERROR_AOFFSET_TRIM 0x29 /* /< Aoffset Trim error */
/** @}*/
diff --git a/fts_lib/ftsTest.c b/fts_lib/ftsTest.c
index 0deb189..edebcee 100644
--- a/fts_lib/ftsTest.c
+++ b/fts_lib/ftsTest.c
@@ -1312,7 +1312,11 @@ int production_test_ms_raw(const char *path_limits, int stop_on_fail,
msleep(WAIT_FOR_FRESH_FRAMES);
ret |= setScanMode(SCAN_MODE_ACTIVE, 0x00);
msleep(WAIT_AFTER_SENSEOFF);
+#ifdef READ_FILTERED_RAW
+ ret |= getMSFrame3(MS_FILTER, &msRawFrame);
+#else
ret |= getMSFrame3(MS_RAW, &msRawFrame);
+#endif
if (ret < OK) {
pr_err("production_test_data: getMSFrame failed... ERROR %08X\n",
ERROR_PROD_TEST_DATA);
@@ -1814,7 +1818,11 @@ int production_test_ms_raw_lp(const char *path_limits, int stop_on_fail,
msleep(WAIT_FOR_FRESH_FRAMES);
ret |= setScanMode(SCAN_MODE_ACTIVE, 0x00);
msleep(WAIT_AFTER_SENSEOFF);
+#ifdef READ_FILTERED_RAW
+ ret |= getMSFrame3(MS_FILTER, &msRawFrame);
+#else
ret |= getMSFrame3(MS_RAW, &msRawFrame);
+#endif
if (ret < 0) {
pr_err("production_test_data: getMSFrame failed... ERROR %08X\n",
ERROR_PROD_TEST_DATA);
@@ -3395,7 +3403,11 @@ int production_test_ss_raw(const char *path_limits, int stop_on_fail,
msleep(WAIT_FOR_FRESH_FRAMES);
ret |= setScanMode(SCAN_MODE_ACTIVE, 0x00);
msleep(WAIT_AFTER_SENSEOFF);
+#ifdef READ_FILTERED_RAW
+ ret |= getSSFrame3(SS_FILTER, &ssRawFrame);
+#else
ret |= getSSFrame3(SS_RAW, &ssRawFrame);
+#endif
if (ret < 0) {
pr_err("production_test_data: getSSFrame failed... ERROR %08X\n",
ERROR_PROD_TEST_DATA);
@@ -3767,7 +3779,11 @@ int production_test_ss_raw_lp(const char *path_limits, int stop_on_fail,
msleep(WAIT_FOR_FRESH_FRAMES);
ret |= setScanMode(SCAN_MODE_ACTIVE, 0x00);
msleep(WAIT_AFTER_SENSEOFF);
+#ifdef READ_FILTERED_RAW
+ ret |= getSSFrame3(SS_DETECT_FILTER, &ssRawFrame);
+#else
ret |= getSSFrame3(SS_DETECT_RAW, &ssRawFrame);
+#endif
if (ret < 0) {
pr_err("production_test_data: getSSFrame failed... ERROR %08X\n",
ERROR_PROD_TEST_DATA);
diff --git a/fts_proc.c b/fts_proc.c
index b6cbd4e..34ca325 100644
--- a/fts_proc.c
+++ b/fts_proc.c
@@ -361,6 +361,8 @@
#define CMD_CHANGE_SAD 0x70 /* /< Allow to change
* the SAD address (for
* debugging) */
+#define CMD_INFOBLOCK_STATUS 0x61 /* /< Check for Info
+ * block error */
/* Debug functionalities requested by Google for B1 Project */
#define CMD_TRIGGER_FORCECAL 0x80 /* /< Trigger manually
@@ -788,6 +790,8 @@ static ssize_t fts_driver_test_write(struct file *file, const char __user *buf,
MutualSenseFrame frameMS;
MutualSenseFrame deltas;
SelfSenseFrame frameSS;
+ u8 error_to_search[2] = { EVT_TYPE_ERROR_OSC_TRIM,
+ EVT_TYPE_ERROR_AOFFSET_TRIM };
DataHeader dataHead;
MutualSenseData compData;
@@ -2882,6 +2886,20 @@ END_DIAGNOSTIC:
}
break;
+ case CMD_INFOBLOCK_STATUS:
+ res = fts_system_reset();
+ if (res >= OK) {
+ res = pollForErrorType(error_to_search, 2);
+ if (res < OK) {
+ pr_err("No info block corruption!\n");
+ res = OK;
+ } else {
+ pr_info("Info block errors found!\n");
+ res = ERROR_INFO_BLOCK;
+ }
+ }
+ break;
+
default:
pr_err("COMMAND ID NOT VALID!!!\n");
res = ERROR_OP_NOT_ALLOW;