linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration
@ 2022-02-17 16:55 Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate Dario Binacchi
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Dmitry Torokhov, Marco Felsch, Michael Trimarchi,
	Oliver Graute, Rob Herring, Stephan Gerhold, devicetree,
	linux-input

The series was born from the analysis and mitigation of a crc problem
raised by an M06 type device. The added sysfs attributes were helpful
in debugging the problem. Patches that change the report rate on driver
probing, mitigated crc errors on kernel bootup. The patch to get/set
report rate by sysfs for an M12 device, has been tested.

Changes in v2:
- Add Oliver Graute's 'Acked-by' tag to:
  * Input: edt-ft5x06 - show model name by sysfs
  * Input: edt-ft5x06 - show firmware version by sysfs
- Fix yaml file. Tested with `make DT_CHECKER_FLAGS=-m dt_binding_check'.

Dario Binacchi (6):
  dt-bindings: input: touchscreen: edt-ft5x06: add report-rate
  Input: edt-ft5x06 - get/set M12 report rate by sysfs
  Input: edt-ft5x06 - set report rate by dts property
  Input: edt-ft5x06 - show model name by sysfs
  Input: edt-ft5x06 - show firmware version by sysfs
  Input: edt-ft5x06 - show crc and header errors by sysfs

 .../input/touchscreen/edt-ft5x06.yaml         |  8 ++
 drivers/input/touchscreen/edt-ft5x06.c        | 81 +++++++++++++++++--
 2 files changed, 81 insertions(+), 8 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  2022-02-24 22:27   ` Rob Herring
  2022-02-17 16:55 ` [PATCH v2 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Dario Binacchi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Dmitry Torokhov, Rob Herring,
	Stephan Gerhold, devicetree, linux-input

It allows to change the M06/M12 default scan rate.

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>
---

(no changes since v1)

 .../devicetree/bindings/input/touchscreen/edt-ft5x06.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
index 2e8da7470513..aa8517c6f65b 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
+++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
@@ -85,6 +85,14 @@ properties:
     minimum: 0
     maximum: 80
 
+  report-rate:
+    description: Allows setting the scan rate.
+                 M06 supports range from 3 (30 Hz) to 14 (140 Hz).
+                 M12 supports range from 1 (1 Hz) to 255 (255 Hz).
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 1
+    maximum: 255
+
   touchscreen-size-x: true
   touchscreen-size-y: true
   touchscreen-fuzz-x: true
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 3/6] Input: edt-ft5x06 - set report rate by dts property Dario Binacchi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Dmitry Torokhov, Marco Felsch,
	Oliver Graute, Stephan Gerhold, linux-input

Add support for reading/writing scan rate (SC) register for M12 by
sysfs. The register value is equal to the SC (Hz), unlike M06, where
instead it is equal to SC / 10.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Tested-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

(no changes since v1)

 drivers/input/touchscreen/edt-ft5x06.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index bb2e1cbffba7..77f061af5c61 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -47,6 +47,8 @@
 #define M09_REGISTER_NUM_X		0x94
 #define M09_REGISTER_NUM_Y		0x95
 
+#define M12_REGISTER_REPORT_RATE	0x88
+
 #define EV_REGISTER_THRESHOLD		0x40
 #define EV_REGISTER_GAIN		0x41
 #define EV_REGISTER_OFFSET_Y		0x45
@@ -523,9 +525,9 @@ static EDT_ATTR(offset_y, S_IWUSR | S_IRUGO, NO_REGISTER, NO_REGISTER,
 /* m06: range 20 to 80, m09: range 0 to 30, m12: range 1 to 255... */
 static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD,
 		M09_REGISTER_THRESHOLD, EV_REGISTER_THRESHOLD, 0, 255);
-/* m06: range 3 to 14, m12: (0x64: 100Hz) */
+/* m06: range 3 to 14, m12: range 1 to 255 */
 static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE,
-		NO_REGISTER, NO_REGISTER, 0, 255);
+		M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255);
 
 static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_gain.dattr.attr,
@@ -1030,7 +1032,8 @@ static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata)
 	case EDT_M09:
 	case EDT_M12:
 		reg_addr->reg_threshold = M09_REGISTER_THRESHOLD;
-		reg_addr->reg_report_rate = NO_REGISTER;
+		reg_addr->reg_report_rate = tsdata->version == EDT_M12 ?
+			M12_REGISTER_REPORT_RATE : NO_REGISTER;
 		reg_addr->reg_gain = M09_REGISTER_GAIN;
 		reg_addr->reg_offset = M09_REGISTER_OFFSET;
 		reg_addr->reg_offset_x = NO_REGISTER;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/6] Input: edt-ft5x06 - set report rate by dts property
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Dmitry Torokhov,
	Oliver Graute, Stephan Gerhold, linux-input

It allows to change the M06/M12 default scan rate on driver probing.

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>
---

(no changes since v1)

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

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 77f061af5c61..b3e492cfc41c 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1213,6 +1213,14 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 	edt_ft5x06_ts_get_defaults(&client->dev, tsdata);
 	edt_ft5x06_ts_get_parameters(tsdata);
 
+	if (tsdata->reg_addr.reg_report_rate != NO_REGISTER &&
+	    !of_property_read_u32(client->dev.of_node, "report-rate",
+				  (u32 *)&tsdata->report_rate)) {
+		edt_ft5x06_register_write(tsdata,
+					  tsdata->reg_addr.reg_report_rate,
+					  tsdata->report_rate);
+	}
+
 	dev_dbg(&client->dev,
 		"Model \"%s\", Rev. \"%s\", %dx%d sensors\n",
 		tsdata->name, fw_version, tsdata->num_x, tsdata->num_y);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/6] Input: edt-ft5x06 - show model name by sysfs
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
                   ` (2 preceding siblings ...)
  2022-02-17 16:55 ` [PATCH v2 3/6] Input: edt-ft5x06 - set report rate by dts property Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 5/6] Input: edt-ft5x06 - show firmware version " Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 6/6] Input: edt-ft5x06 - show crc and header errors " Dario Binacchi
  5 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Oliver Graute,
	Dmitry Torokhov, Marco Felsch, Stephan Gerhold, linux-input

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 b3e492cfc41c..eb1231d1c0b4 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 5/6] Input: edt-ft5x06 - show firmware version by sysfs
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
                   ` (3 preceding siblings ...)
  2022-02-17 16:55 ` [PATCH v2 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  2022-02-17 16:55 ` [PATCH v2 6/6] Input: edt-ft5x06 - show crc and header errors " Dario Binacchi
  5 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Oliver Graute,
	Dmitry Torokhov, Stephan Gerhold, linux-input

The firmware version 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 | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index eb1231d1c0b4..2c946c155108 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -129,6 +129,7 @@ struct edt_ft5x06_ts_data {
 	int max_support_points;
 
 	char name[EDT_NAME_LEN];
+	char fw_version[EDT_NAME_LEN];
 
 	struct edt_reg_addr reg_addr;
 	enum edt_ver version;
@@ -540,6 +541,17 @@ static ssize_t model_show(struct device *dev, struct device_attribute *attr,
 
 static DEVICE_ATTR_RO(model);
 
+static ssize_t fw_version_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->fw_version);
+}
+
+static DEVICE_ATTR_RO(fw_version);
+
 static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_gain.dattr.attr,
 	&edt_ft5x06_attr_offset.dattr.attr,
@@ -548,6 +560,7 @@ static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_threshold.dattr.attr,
 	&edt_ft5x06_attr_report_rate.dattr.attr,
 	&dev_attr_model.attr,
+	&dev_attr_fw_version.attr,
 	NULL
 };
 
@@ -834,13 +847,13 @@ static void edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata)
 #endif /* CONFIG_DEBUGFS */
 
 static int edt_ft5x06_ts_identify(struct i2c_client *client,
-					struct edt_ft5x06_ts_data *tsdata,
-					char *fw_version)
+				  struct edt_ft5x06_ts_data *tsdata)
 {
 	u8 rdbuf[EDT_NAME_LEN];
 	char *p;
 	int error;
 	char *model_name = tsdata->name;
+	char *fw_version = tsdata->fw_version;
 
 	/* see what we find if we assume it is a M06 *
 	 * if we get less than EDT_NAME_LEN, we don't want
@@ -1096,7 +1109,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 	struct input_dev *input;
 	unsigned long irq_flags;
 	int error;
-	char fw_version[EDT_NAME_LEN];
 
 	dev_dbg(&client->dev, "probing for EDT FT5x06 I2C\n");
 
@@ -1209,7 +1221,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 	tsdata->input = input;
 	tsdata->factory_mode = false;
 
-	error = edt_ft5x06_ts_identify(client, tsdata, fw_version);
+	error = edt_ft5x06_ts_identify(client, tsdata);
 	if (error) {
 		dev_err(&client->dev, "touchscreen probe failed\n");
 		return error;
@@ -1235,7 +1247,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 
 	dev_dbg(&client->dev,
 		"Model \"%s\", Rev. \"%s\", %dx%d sensors\n",
-		tsdata->name, fw_version, tsdata->num_x, tsdata->num_y);
+		tsdata->name, tsdata->fw_version, tsdata->num_x, tsdata->num_y);
 
 	input->name = tsdata->name;
 	input->id.bustype = BUS_I2C;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 6/6] Input: edt-ft5x06 - show crc and header errors by sysfs
  2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
                   ` (4 preceding siblings ...)
  2022-02-17 16:55 ` [PATCH v2 5/6] Input: edt-ft5x06 - show firmware version " Dario Binacchi
@ 2022-02-17 16:55 ` Dario Binacchi
  5 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-02-17 16:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Michael Trimarchi, Dmitry Torokhov,
	Oliver Graute, Stephan Gerhold, linux-input

M06 sends packets with header and crc for data verification. Now you can
check at runtime how many packets have been dropped.

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>

---

Changes in v2:
- Add Oliver Graute's 'Acked-by' tag to:
  * Input: edt-ft5x06 - show model name by sysfs
  * Input: edt-ft5x06 - show firmware version by sysfs
- Fix yaml file. Tested with `make DT_CHECKER_FLAGS=-m dt_binding_check'.

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

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 2c946c155108..376aa4405104 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -133,6 +133,8 @@ struct edt_ft5x06_ts_data {
 
 	struct edt_reg_addr reg_addr;
 	enum edt_ver version;
+	unsigned int crc_errors;
+	unsigned int header_errors;
 };
 
 struct edt_i2c_chip_data {
@@ -181,6 +183,7 @@ static bool edt_ft5x06_ts_check_crc(struct edt_ft5x06_ts_data *tsdata,
 		crc ^= buf[i];
 
 	if (crc != buf[buflen-1]) {
+		tsdata->crc_errors++;
 		dev_err_ratelimited(&tsdata->client->dev,
 				    "crc error: 0x%02x expected, got 0x%02x\n",
 				    crc, buf[buflen-1]);
@@ -238,6 +241,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
 	if (tsdata->version == EDT_M06) {
 		if (rdbuf[0] != 0xaa || rdbuf[1] != 0xaa ||
 			rdbuf[2] != datalen) {
+			tsdata->header_errors++;
 			dev_err_ratelimited(dev,
 					"Unexpected header: %02x%02x%02x!\n",
 					rdbuf[0], rdbuf[1], rdbuf[2]);
@@ -552,6 +556,30 @@ static ssize_t fw_version_show(struct device *dev,
 
 static DEVICE_ATTR_RO(fw_version);
 
+/* m06 only */
+static ssize_t header_errors_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, "%d\n", tsdata->header_errors);
+}
+
+static DEVICE_ATTR_RO(header_errors);
+
+/* m06 only */
+static ssize_t crc_errors_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, "%d\n", tsdata->crc_errors);
+}
+
+static DEVICE_ATTR_RO(crc_errors);
+
 static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_gain.dattr.attr,
 	&edt_ft5x06_attr_offset.dattr.attr,
@@ -561,6 +589,8 @@ static struct attribute *edt_ft5x06_attrs[] = {
 	&edt_ft5x06_attr_report_rate.dattr.attr,
 	&dev_attr_model.attr,
 	&dev_attr_fw_version.attr,
+	&dev_attr_header_errors.attr,
+	&dev_attr_crc_errors.attr,
 	NULL
 };
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate
  2022-02-17 16:55 ` [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate Dario Binacchi
@ 2022-02-24 22:27   ` Rob Herring
  2022-03-13 16:32     ` Dario Binacchi
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2022-02-24 22:27 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: linux-kernel, Michael Trimarchi, Dmitry Torokhov,
	Stephan Gerhold, devicetree, linux-input

On Thu, Feb 17, 2022 at 05:55:53PM +0100, Dario Binacchi wrote:
> It allows to change the M06/M12 default scan rate.
> 
> 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>
> ---
> 
> (no changes since v1)
> 
>  .../devicetree/bindings/input/touchscreen/edt-ft5x06.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> index 2e8da7470513..aa8517c6f65b 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> @@ -85,6 +85,14 @@ properties:
>      minimum: 0
>      maximum: 80
>  
> +  report-rate:

Use property unit suffix: report-rate-hz

This should probably be moved to touchscreen.yaml as it seems common.

> +    description: Allows setting the scan rate.
> +                 M06 supports range from 3 (30 Hz) to 14 (140 Hz).

You're using 3 or 30 in this case? Should be 30, but it's not clear. I'd 
just list the range in Hz and leave the conversion detail to the driver.

> +                 M12 supports range from 1 (1 Hz) to 255 (255 Hz).

Use '|' if formatting (newline) is significant.

> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 255
> +
>    touchscreen-size-x: true
>    touchscreen-size-y: true
>    touchscreen-fuzz-x: true
> -- 
> 2.32.0
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate
  2022-02-24 22:27   ` Rob Herring
@ 2022-03-13 16:32     ` Dario Binacchi
  0 siblings, 0 replies; 9+ messages in thread
From: Dario Binacchi @ 2022-03-13 16:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel, Michael Trimarchi, Dmitry Torokhov,
	Stephan Gerhold, devicetree, linux-input

Hi Rob,

On Thu, Feb 24, 2022 at 11:27 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Feb 17, 2022 at 05:55:53PM +0100, Dario Binacchi wrote:
> > It allows to change the M06/M12 default scan rate.
> >
> > 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>
> > ---
> >
> > (no changes since v1)
> >
> >  .../devicetree/bindings/input/touchscreen/edt-ft5x06.yaml | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> > index 2e8da7470513..aa8517c6f65b 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> > @@ -85,6 +85,14 @@ properties:
> >      minimum: 0
> >      maximum: 80
> >
> > +  report-rate:
>
> Use property unit suffix: report-rate-hz
>
> This should probably be moved to touchscreen.yaml as it seems common.

I did some checks but IMHO I think it's better to consider it as a
property of the
driver.

Thanks and regards
Dario

>
> > +    description: Allows setting the scan rate.
> > +                 M06 supports range from 3 (30 Hz) to 14 (140 Hz).
>
> You're using 3 or 30 in this case? Should be 30, but it's not clear. I'd
> just list the range in Hz and leave the conversion detail to the driver.
>
> > +                 M12 supports range from 1 (1 Hz) to 255 (255 Hz).
>
> Use '|' if formatting (newline) is significant.
>
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    minimum: 1
> > +    maximum: 255
> > +
> >    touchscreen-size-x: true
> >    touchscreen-size-y: true
> >    touchscreen-fuzz-x: true
> > --
> > 2.32.0
> >
> >



-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-03-13 16:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 16:55 [PATCH v2 0/6] Input: edt-ft5x06 - Improve configuration Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 1/6] dt-bindings: input: touchscreen: edt-ft5x06: add report-rate Dario Binacchi
2022-02-24 22:27   ` Rob Herring
2022-03-13 16:32     ` Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 3/6] Input: edt-ft5x06 - set report rate by dts property Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 4/6] Input: edt-ft5x06 - show model name by sysfs Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 5/6] Input: edt-ft5x06 - show firmware version " Dario Binacchi
2022-02-17 16:55 ` [PATCH v2 6/6] Input: edt-ft5x06 - show crc and header errors " Dario Binacchi

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).