All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Oliver Graute <oliver.graute@kococonnector.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Stephan Gerhold <stephan@gerhold.net>,
	linux-input@vger.kernel.org
Subject: [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs
Date: Thu,  5 May 2022 17:56:33 +0200	[thread overview]
Message-ID: <20220505155635.419653-5-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20220505155635.419653-1-dario.binacchi@amarulasolutions.com>

The model name was printed only if debug mode was enabled. Now you can
always get it from sysfs.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
---

(no changes since v1)

 drivers/input/touchscreen/edt-ft5x06.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 843e8b0522f7..89157deebfcb 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -529,6 +529,17 @@ static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD,
 static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE,
 		M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255);
 
+static ssize_t model_show(struct device *dev, struct device_attribute *attr,
+			  char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
+
+	return scnprintf(buf, PAGE_SIZE, "%s\n", tsdata->name);
+}
+
+static DEVICE_ATTR_RO(model);
+
 static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_gain.dattr.attr,
 	&edt_ft5x06_attr_offset.dattr.attr,
@@ -536,6 +547,7 @@ static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_offset_y.dattr.attr,
 	&edt_ft5x06_attr_threshold.dattr.attr,
 	&edt_ft5x06_attr_report_rate.dattr.attr,
+	&dev_attr_model.attr,
 	NULL
 };
 
-- 
2.32.0


  parent reply	other threads:[~2022-05-05 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 15:56 [RESEND PATCH v4 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
2022-05-05 15:56 ` [RESEND PATCH v4 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate-hz Dario Binacchi
2022-05-05 15:56 ` [RESEND PATCH v4 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Dario Binacchi
2022-05-05 15:56 ` [RESEND PATCH v4 3/6] Input: edt-ft5x06 - set report rate by dts property Dario Binacchi
2022-05-05 15:56 ` Dario Binacchi [this message]
2022-05-05 15:56 ` [RESEND PATCH v4 5/6] Input: edt-ft5x06 - show firmware version by sysfs Dario Binacchi
2022-05-05 15:56 ` [RESEND PATCH v4 6/6] Input: edt-ft5x06 - show crc and header errors " Dario Binacchi
  -- strict thread matches above, loose matches on Subject: below --
2022-06-21 12:39 [RESEND PATCH v4 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
2022-06-21 12:39 ` [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi
2022-06-29  5:07   ` Dmitry Torokhov
2022-06-07  9:55 [RESEND PATCH v4 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
2022-06-07  9:55 ` [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi
2022-04-21 18:59 [RESEND PATCH v4 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
2022-04-21 19:00 ` [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi

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=20220505155635.419653-5-dario.binacchi@amarulasolutions.com \
    --to=dario.binacchi@amarulasolutions.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@amarulasolutions.com \
    --cc=oliver.graute@kococonnector.com \
    --cc=stephan@gerhold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.