touch: Correct message read size for CRC feature.
authormakarand.karvekar <makarand.karvekar@motorola.com>
Tue, 6 Jul 2010 18:30:44 +0000 (13:30 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:15 +0000 (16:33 -0700)
Previously, Message Processor always generated
CRC byte at end of message.
Now(version 8), this CRC byte is generated only upon request.
To request that a checksum is generated, the MSBit
of the address of the Message Processor object is set to 1.

By default the CRC byte is not generated, reading the CRC byte
will remove new messages from IC causing lost touches.

Added control flag and message size correction for this feature.

Change-Id: I7d1a75528a59afcc95688ae1b7d6704d29ffe443
Signed-off-by: makarand.karvekar <makarand.karvekar@motorola.com>
drivers/input/touchscreen/qtouch_obp_ts.c
include/linux/qtouch_obp_ts.h

index 84dee22280ab7c0bdac38f80db1f1bbb6f7d105f..2fd39472f84c73980d3fcf2f2ac9a38a36dcb3ce 100644 (file)
@@ -666,8 +666,6 @@ static int qtouch_hw_init(struct qtouch_ts_data *ts)
 
                        kfree(msg);
                }
-
-               qtouch_set_addr(ts, ts->obj_tbl[QTM_OBJ_GEN_MSG_PROC].entry.addr);
        }
 
        /* reset the address pointer */
@@ -1179,8 +1177,14 @@ static int qtouch_process_info_block(struct qtouch_ts_data *ts)
                }
 
                /* save the message_procesor msg_size for easy reference. */
-               if (entry.type == QTM_OBJ_GEN_MSG_PROC)
-                       ts->msg_size = entry.size;
+               if (entry.type == QTM_OBJ_GEN_MSG_PROC) {
+                       if (ts->pdata->flags & QTOUCH_USE_MSG_CRC) {
+                               ts->msg_size = entry.size;
+                               entry.addr |= QTOUCH_USE_MSG_CRC_MASK;
+                       } else {
+                               ts->msg_size = entry.size -1;
+                       }
+               }
 
                obj = create_obj(ts, &entry);
                /* set the report_id range that the object is responsible for */
index 9e16f5c42423f3bfbc52709573263c053aab8357..f2000adf3ce46b052fea0295919a2e0d66198c80 100644 (file)
@@ -441,6 +441,9 @@ struct touch_fw_entry {
 #define QTOUCH_USE_KEYARRAY    (1 << 4)
 #define QTOUCH_CFG_BACKUPNV    (1 << 5)
 #define QTOUCH_EEPROM_CHECKSUM  (1 << 6)
+#define QTOUCH_USE_MSG_CRC     (1 << 7)
+
+#define QTOUCH_USE_MSG_CRC_MASK        0x8000
 
 struct qtouch_ts_platform_data {
        uint32_t                flags;