From: makarand.karvekar Date: Tue, 6 Jul 2010 18:30:44 +0000 (-0500) Subject: touch: Correct message read size for CRC feature. X-Git-Tag: firefly_0821_release~9834^2~803 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=23b71fa971f8f5517081a2f4610abb638668c285;p=firefly-linux-kernel-4.4.55.git touch: Correct message read size for CRC feature. 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 --- diff --git a/drivers/input/touchscreen/qtouch_obp_ts.c b/drivers/input/touchscreen/qtouch_obp_ts.c index 84dee22280ab..2fd39472f84c 100644 --- a/drivers/input/touchscreen/qtouch_obp_ts.c +++ b/drivers/input/touchscreen/qtouch_obp_ts.c @@ -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 */ diff --git a/include/linux/qtouch_obp_ts.h b/include/linux/qtouch_obp_ts.h index 9e16f5c42423..f2000adf3ce4 100644 --- a/include/linux/qtouch_obp_ts.h +++ b/include/linux/qtouch_obp_ts.h @@ -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;