From patchwork Tue Oct 29 07:19:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11217441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E94831390 for ; Tue, 29 Oct 2019 07:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D052F20862 for ; Tue, 29 Oct 2019 07:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730712AbfJ2HVU (ORCPT ); Tue, 29 Oct 2019 03:21:20 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:41262 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730690AbfJ2HVT (ORCPT ); Tue, 29 Oct 2019 03:21:19 -0400 IronPort-SDR: fF03ikvs7G7vH8yOVK/nMeK6zExKKTGwSSuZJusyHsF6XaW5rWuupxrAdhy0vsjUNIlpCrut3J RKS9U5xbcmjBxByXC4mr5PU6MnQ0jxtXHtUHs0A/D8AVWCJ/nk/fwzirvNM+A0ajmInIQ+7Ncn sOUhAvHAU7erJBKNMWm3eCVKRMlqibh3g2ckE7GfjkXu+Mh8S9A02gILrfe3fPNVSSEqlN/BrU JEea2R8ss9eC3d5h8CiHf+L5Q7jx6DxEUO4bFRDIOYfeTkdkX+Lkzh7IYJ76AM2w8Ju9hOt/Te hKg= X-IronPort-AV: E=Sophos;i="5.68,243,1569312000"; d="scan'208";a="42663242" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 28 Oct 2019 23:21:19 -0800 IronPort-SDR: Ou3TL1AxzQn6Rl82/L/hFlUy4lK5ZaoX77m1bzHjKNi4rOjH5OyLL+mxrbZIdyc/sYuiVqoR2V 35XcjJxLod2BUSVS1CjDBoDeZAKffnoDMA2sKIUabY1HANnPXb6yDm502lGOajwU3xraTrVEdX rsgLpWFT8SmENgg2ZetR+1G3wwKNwz79sgDf8cpa0h7exI0y3SZ4bUvMg9YJpudGH5X4MZvMdH sMA+3mUEbquoFM+Z56s0c9inWjsiSr1fZDP0SREy/mbmJuV7ngEABuf05Ss5PrmIeU/hM9wXqy H/E= From: Jiada Wang To: , , , CC: , , , , Subject: [PATCH v4 18/48] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Tue, 29 Oct 2019 16:19:40 +0900 Message-ID: <20191029072010.8492-19-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029072010.8492-1-jiada_wang@mentor.com> References: <20191029072010.8492-1-jiada_wang@mentor.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: karl tsou Signed-off-by: Nick Dyer (cherry picked from ndyer/linux/for-upstream commit 03477477ddbe5dcad42853ab3f84166a8f807acf) [gdavis: Forward port and fix conflicts.] Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 43f71a4a44dd..f55d1f719f18 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3128,6 +3128,15 @@ static int mxt_configure_objects(struct mxt_data *data, return error; } +/* Configuration crc check sum is returned as hex xxxxxx */ +static ssize_t mxt_config_crc_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct mxt_data *data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%06x\n", data->config_crc); +} + /* Firmware Version is returned as Major.Minor.Build */ static ssize_t mxt_fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -3481,12 +3490,14 @@ static DEVICE_ATTR(fw_version, S_IRUGO, mxt_fw_version_show, NULL); static DEVICE_ATTR(hw_version, S_IRUGO, mxt_hw_version_show, NULL); static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); static DEVICE_ATTR(update_cfg, S_IWUSR, NULL, mxt_update_cfg_store); +static DEVICE_ATTR(config_crc, S_IRUGO, mxt_config_crc_show, NULL); static struct attribute *mxt_attrs[] = { &dev_attr_fw_version.attr, &dev_attr_hw_version.attr, &dev_attr_object.attr, &dev_attr_update_cfg.attr, + &dev_attr_config_crc.attr, NULL };