Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3367175ybb; Tue, 31 Mar 2020 03:55:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vubWich3rvvrZnBPKacSVEG09hGH6vSQhE89l8MAwznAeExtocsqw+kqD/UGTf5iEoIxQyp X-Received: by 2002:a05:6830:4d1:: with SMTP id s17mr11446772otd.27.1585652147865; Tue, 31 Mar 2020 03:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585652147; cv=none; d=google.com; s=arc-20160816; b=CmhXG60q+6JKTpLDQ71Qho1MaDNO6Jlrosi2fkTCWFgM8vbbh6TH1rIGwe6JKjoErp O+Ie+Xy7wbljKWWJHA6eEbolT32+C330zEaTtnY4jijDO8NiZ/rCfy2lnYEtzFZN2+xj 8j4fEdqrNWV6puLqt1ohU90Zh5+h5aFSSSlxHXa6KlQj2XKsH7O2akWoxoAmYV7vG1yd uizOPC32tdGyjH9OIVBffAS3jZB+hkLLruL2idwEUNIUJK1fjqZFD1imwh18vL7Apqv+ Cq39xxjUrIm9sR2KbrkHZBlMedHJ1WtEx/h579vRjzt5I3PfpHuOsUwhhfAyYpuXml7S lniQ== 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=9ZD9hmm0eMLWMQPzAxSsp2AILdfV1wXh6Z5u54PMz6A=; b=GtdGotAUAk3RCX/QqAmsLZKnEFSqrHfBpD7oIivqkprb0fCV60cBHlGwpf3knskl8+ UW8K9B8+YAAjL64XVkfhTXYzarGpxV1Ewz3N+h34zANdt+Z4HgVQMmxOrI3Q4spie/Q3 jlaBhWpqToa+siW0DLNUSmCYpq3GfU3riUBCGAzZ/jFIWJ4JaCW29m1cINJDCryFsdGf GNOf0dDLp9nNeyz0J9OaYdBGkFcNp3qBm04xWsHh8P4nY085TcnkD4hRgWC2U7nLGU2v insJH8ghIonukv6Z+H9CNRMvTBryT3BXatWKc2mwDMylVLKMksdp+0u4TSRe4ti/DT2C ILaw== 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 a13si9038394otk.158.2020.03.31.03.55.35; Tue, 31 Mar 2020 03:55:47 -0700 (PDT) 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 S1730757AbgCaKwm (ORCPT + 99 others); Tue, 31 Mar 2020 06:52:42 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43589 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730410AbgCaKwl (ORCPT ); Tue, 31 Mar 2020 06:52:41 -0400 IronPort-SDR: WSr5aFtAVBAuO1ZWcPTOFCeH/XzbFvsNUj077Jakg7miE2nWDdGe0fSPZzWPJ6IG7vWk3GEjOC r+mqnvv+q/6lcRR+q4Si5wTYDxTCZHpBDTCaUIieJ7VWsvOyHgX1kJbWtLxWyMhD8EetqCzibN aiviAJQDioH5BiR4tEIeMXTy9br33pIEigoBzCjTr4UJdgwl3LrMHHpUpdbq8KuswscwcHrzuu NbT64ypXEnRZ9WvwqVYLNusiwtGvuWtaGjnPbJGn5oEfpe3t45c13ys89ociWElJJUL5U4DPih rgw= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330781" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:52:27 -0800 IronPort-SDR: xYj3WjZ7xzVpP3B4o0FJ2Bxp3/qRGU9qWd4U/9rbi0ZdfHQshd1hTq+dW7+P6i025nQ5szXVoB oTK7CsXGh4SyPDMgBv2yhgDxnxBe9wRBA2XMpTkGcqajiQX3gVeqPNDm9cpsLX+QkFFvBwoKHO +1KZfBpq837YmFiyikJzHyJyhtywwJ44/rTow5eJnNegNOQZGO5+IZ6sGqbDefSiPQm4B9F26r FzF0dywtIuOD8UBrOsQeEAWzO2pUu3zvZsM154AU8NYLNsJofPxM80GvKLhukznnzDRovaHARY E0s= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 24/55] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Tue, 31 Mar 2020 03:50:20 -0700 Message-ID: <20200331105051.58896-25-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331105051.58896-1-jiada_wang@mentor.com> References: <20200331105051.58896-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 Add config checksum attribute to sysfs Signed-off-by: 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 [jiada: Add commit description Rename mxt_config_crc_show to config_crc_show Replace DEVICE_ATTR with DEVICE_ATTR_RO] 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 dfc20c0ca0a5..67931cf64629 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 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 fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -3481,12 +3490,14 @@ static DEVICE_ATTR_RO(fw_version); static DEVICE_ATTR_RO(hw_version); static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); static DEVICE_ATTR_WO(update_cfg); +static DEVICE_ATTR_RO(config_crc); 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