linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Dyer <nick.dyer@itdev.co.uk>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Yufeng Shen <miletus@google.com>,
	Benson Leung <bleung@chromium.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alan Bowens <Alan.Bowens@atmel.com>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Chris Healy <cphealy@gmail.com>,
	Nick Dyer <nick.dyer@itdev.co.uk>
Subject: [PATCH RFC 8/8] Input: atmel_mxt_ts - create debugfs info file
Date: Wed,  2 Dec 2015 20:42:31 +0000	[thread overview]
Message-ID: <1449088951-7069-9-git-send-email-nick.dyer@itdev.co.uk> (raw)
In-Reply-To: <1449088951-7069-1-git-send-email-nick.dyer@itdev.co.uk>

Add a file in debugfs directory with info about the chip.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
---
 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);
 	}
-- 
2.5.0


  parent reply	other threads:[~2015-12-02 20:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 20:42 [PATCH RFC 0/8] Input: atmel_mxt_ts - raw data via debugfs Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 1/8] Input: atmel_mxt_ts - improve touchscreen size/orientation handling Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 2/8] Input: atmel_mxt_ts - add diagnostic data retrieval via debugfs Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 3/8] Input: atmel_mxt_ts - read touchscreen position in matrix Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 4/8] Input: atmel_mxt_ts - handle diagnostic data orientation Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 5/8] Input: atmel_mxt_ts - add diagnostic data support for mXT1386 Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 6/8] Input: atmel_mxt_ts - Add support for reference data Nick Dyer
2015-12-02 20:42 ` [PATCH RFC 7/8] Input: atmel_mxt_ts - add metadata to debugfs Nick Dyer
2015-12-02 20:42 ` Nick Dyer [this message]
2015-12-17 17:22 ` [PATCH RFC 0/8] Input: atmel_mxt_ts - raw data via debugfs Nick Dyer
2016-01-11 23:24   ` Dmitry Torokhov
2016-01-12  8:10     ` Benjamin Tissoires
2016-01-13 17:20       ` Nick Dyer
2016-01-13 18:40         ` Dmitry Torokhov
     [not found]           ` <CAFXsbZrJg75Z1jRYmzac9grr5Oqqtq4gW9Cs8aDh15wvBjrKNg@mail.gmail.com>
2016-01-13 20:42             ` Henrik Rydberg
2016-02-08 21:38               ` Nick Dyer
2016-03-10 14:08           ` Nick Dyer
2016-01-13 18:35       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449088951-7069-9-git-send-email-nick.dyer@itdev.co.uk \
    --to=nick.dyer@itdev.co.uk \
    --cc=Alan.Bowens@atmel.com \
    --cc=bleung@chromium.org \
    --cc=cphealy@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=javier@osg.samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miletus@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).