Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5826112ybv; Wed, 12 Feb 2020 00:45:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzKSOCC2IIJHJYQqVvHnu7gIjWzHEpFobLaHjH/Q/RnGikHU0siVi0gMr+z5ydG6OFb9DEU X-Received: by 2002:a9d:170a:: with SMTP id i10mr8350174ota.284.1581497131745; Wed, 12 Feb 2020 00:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581497131; cv=none; d=google.com; s=arc-20160816; b=Kcrwzmlb4q4ww6naz0b4tn6HOM1xSbL6WNVtjHR1bh/JPaiD12pwNWL61cUszjLUQ5 yGhA28ETbcTVyC0S+d8NqQ1Fxm2NLHSzqoiImQzB8Bf0DpJvQL+yQFFD+0MLbALEPF0E Pyv+vD6NwYSL/7X4YWh6PNZiLGKqnHMubFYWRoGmit0iOEY6xhl9S48ah5IH/Cul9OHt Dx8SoEdf9IbjP01pdo9PDLTohMa6IIxNHtjdozwVdB8t7uwYZADLcGJAoE+CeJDU6gZk /h/DgS+PngicGACxgqI2YH7YA4eIRXB6KCv6MTa4VFigbQjCryEcEwW9IGsiutC5XsaW 96ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=8z+TFWOMgriu5dCMUXMohP9AFfkgEcQGqc5PuJp63jw=; b=mJE6Dn4tJAZj9uC67loId1GMiYrH8bBg3hSgkYKFDz+wdP0IUf58UswPjcmI0ldV+X ArjPx1mstccuTwhUx2Y7/H2gDOD7cEBohK0SF91g228crDlzDh3aCSjkqx33Lr4vsMNi ZWDQAElGnOq1glw6vKzP2+h8F6BoPAXlr/uRLI0EXVjthRksvB6Md17O4cs75i26FuOj ktbE2f2I5SHh6FvAbtipjtXB5rQ6TtNSd0VpYSEWlz2GEatmil7Ph93imLWVuLqHZAjn zGAbpr+os2gSbN0rF5cloFJimCKjsPhvkgcS27IBcBc6LiW9Q1PDYfrETK/sC+IZLJ0V 1mJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g72si3202358oib.157.2020.02.12.00.45.19; Wed, 12 Feb 2020 00:45:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728650AbgBLIox (ORCPT + 99 others); Wed, 12 Feb 2020 03:44:53 -0500 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:29711 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728493AbgBLIow (ORCPT ); Wed, 12 Feb 2020 03:44:52 -0500 IronPort-SDR: U29lGl+PWnu5JzqN2qMtJnIiEkFwpAMDFm5N6j18A740pSVW9JLbKI0pwJiz0wTfXUyy6lm3nC Ud0QaGWboGEnx+O51Z8xrL+6S9P40w1HMc+adCXqP6glzx/YlPnF0edlGA3UrAPBmQRfi1zR+G UpnTCZslehcoWbN1UWocHOS2m9MWSMcLlysYIw3NHJXgjpltmruf1EpUpz1iEZIz/urv5bXZGS EikMdNjJBE6lksnCPAbCGaGfsbJknMY/hq3B4RoupwMl58FS9OXjW4/1gF570V7pnMzYvS+BLk Xjs= X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="47667028" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 12 Feb 2020 00:44:51 -0800 IronPort-SDR: AfCvXqD33tg1qg+gf0WZFokOgbHzA3U+M8HiZLDjUFwCo2HARRKbaMCB3w1LfZwN5EqhxZJ5o4 kl5aB6Lj5jH3Neip+uU0uhRu3SoQ5I+H+kYVZpwsYsuwy3Vt0KmCW8ce1Fx1QQKfUO094cdVrg XGa27JssPnIbdllN6QhBu7h4fPeOY83aRAVjcaeaQgmsAm2n2DGO2eQ3XjQQIwegzIpo3/HQ0V I0ELtkXn6VVqgL+ALIGf40vEI+nJJ2GchhJFAltwiLeoPVBGwCcJghGNb/jvzMQIF9Xu08eaje lAw= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v7 18/48] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Wed, 12 Feb 2020 00:41:48 -0800 Message-ID: <20200212084218.32344-19-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200212084218.32344-1-jiada_wang@mentor.com> References: <20200212084218.32344-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 b0a07d077016..7abaca26dcba 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 }; -- 2.17.1