From patchwork Wed Dec 2 20:42:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 7751751 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A4BCBEEE1 for ; Wed, 2 Dec 2015 20:53:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43D42203F1 for ; Wed, 2 Dec 2015 20:53:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F18F20534 for ; Wed, 2 Dec 2015 20:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756118AbbLBUvS (ORCPT ); Wed, 2 Dec 2015 15:51:18 -0500 Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:21975 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754157AbbLBUvR (ORCPT ); Wed, 2 Dec 2015 15:51:17 -0500 Received: from localhost.localdomain (unknown [80.229.148.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by hermes.kdh.itdev.co.uk (Postfix) with ESMTPSA id B1BB3809A4; Wed, 2 Dec 2015 20:42:38 +0000 (GMT) From: Nick Dyer To: Dmitry Torokhov Cc: Yufeng Shen , Benson Leung , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Bowens , Javier Martinez Canillas , Chris Healy , Nick Dyer Subject: [PATCH RFC 8/8] Input: atmel_mxt_ts - create debugfs info file Date: Wed, 2 Dec 2015 20:42:31 +0000 Message-Id: <1449088951-7069-9-git-send-email-nick.dyer@itdev.co.uk> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449088951-7069-1-git-send-email-nick.dyer@itdev.co.uk> References: <1449088951-7069-1-git-send-email-nick.dyer@itdev.co.uk> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a file in debugfs directory with info about the chip. Signed-off-by: Nick Dyer --- Documentation/ABI/testing/debugfs-heatmap | 14 ++++++++++++++ drivers/input/touchscreen/atmel_mxt_ts.c | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/Documentation/ABI/testing/debugfs-heatmap b/Documentation/ABI/testing/debugfs-heatmap index 9246340..95668a5 100644 --- a/Documentation/ABI/testing/debugfs-heatmap +++ b/Documentation/ABI/testing/debugfs-heatmap @@ -6,6 +6,13 @@ Description: A directory will be created under heatmap for each device which provides heatmap data. +What: /sys/kernel/debug/heatmap-dev_driver_string-dev_name/info +Date: +KernelVersion: +Contact: +Description: + Info relating to the device, eg hardware/firmware version + What: /sys/kernel/debug/heatmap-dev_driver_string-dev_name/datatype/ Date: KernelVersion: @@ -48,6 +55,13 @@ Contact: Description: Display name for the data. +What: /sys/kernel/debug/heatmap-xxx/datatype/input_name +Date: +KernelVersion: +Contact: +Description: + The name of the corresponding input device, if relevant. + What: /sys/kernel/debug/heatmap-xxx/datatype/data Date: KernelVersion: diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index dbe9ebb..34f3d86 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -277,7 +277,10 @@ struct mxt_dbg { struct dentry *debugfs_dir; struct dentry *deltas_file; struct dentry *refs_file; + struct debugfs_blob_wrapper input_name_wrapper; struct mxt_debug_datatype_meta dt_meta[ARRAY_SIZE(datatypes)]; + char info[50]; + struct debugfs_blob_wrapper info_wrapper; }; #endif @@ -2319,6 +2322,18 @@ static void mxt_debugfs_init(struct mxt_data *data) return; } + dbg->info_wrapper.data = dbg->info; + dbg->info_wrapper.size = sizeof(dbg->info); + scnprintf(dbg->info, sizeof(dbg->info), + "Family: %u Variant: %u Firmware V%u.%u.%02X", + info->family_id, info->variant_id, info->version >> 4, + info->version & 0xf, info->build); + + dent = debugfs_create_blob("info", S_IRUGO, dbg->debugfs_dir, + &dbg->info_wrapper); + if (!dent) + goto error; + /* Calculate size of data and allocate buffer */ dbg->t37_nodes = data->xsize * data->ysize; @@ -2383,6 +2398,13 @@ static void mxt_debugfs_init(struct mxt_data *data) if (!dent) goto error; + dbg->input_name_wrapper.data = (void *)data->input_dev->name; + dbg->input_name_wrapper.size = strlen(data->input_dev->name); + dent = debugfs_create_blob("input_name", S_IRUGO, + dir, &dbg->input_name_wrapper); + if (!dent) + goto error; + dtm->dent = dent; dent->d_inode->i_size = dbg->t37_nodes * sizeof(u16); }