All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings
@ 2021-08-03  8:48 Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c Alistair Francis
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis,
	Rob Herring

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Acked-by: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 07fb0d25fc15..71da86e7b3a2 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1250,6 +1250,8 @@ patternProperties:
     description: Vision Optical Technology Co., Ltd.
   "^vxt,.*":
     description: VXT Ltd
+  "^wacom,.*":
+    description: Wacom Co., Ltd
   "^wand,.*":
     description: Wandbord (Technexion)
   "^waveshare,.*":
-- 
2.31.1


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

* [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
@ 2021-08-03  8:48 ` Alistair Francis
  2021-08-11 18:06   ` Rob Herring
  2021-08-03  8:48 ` [PATCH v8 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Alistair Francis
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 .../input/touchscreen/wacom,generic.yaml      | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml

diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml
new file mode 100644
index 000000000000..a8a7f362b0ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/wacom,generic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wacom I2C Controller
+
+maintainers:
+  - Alistair Francis <alistair@alistair23.me>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: wacom,i2c-30
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply:
+    description: Power Supply
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include "dt-bindings/interrupt-controller/irq.h"
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        digitiser@9 {
+                compatible = "wacom,i2c-30";
+                reg = <0x9>;
+                interrupt-parent = <&gpio1>;
+                interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+                vdd-supply = <&reg_touch>;
+        };
+    };
-- 
2.31.1


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

* [PATCH v8 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c Alistair Francis
@ 2021-08-03  8:48 ` Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties Alistair Francis
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Allow the wacom-i2c device to be exposed via device tree.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index 22826c387da5..6053595f2b30 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 #define WACOM_CMD_QUERY0	0x04
@@ -241,10 +242,17 @@ static const struct i2c_device_id wacom_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, wacom_i2c_id);
 
+static const struct of_device_id wacom_i2c_of_match_table[] = {
+	{ .compatible = "wacom,i2c-30" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table);
+
 static struct i2c_driver wacom_i2c_driver = {
 	.driver	= {
 		.name	= "wacom_i2c",
 		.pm	= &wacom_i2c_pm,
+		.of_match_table = wacom_i2c_of_match_table,
 	},
 
 	.probe		= wacom_i2c_probe,
-- 
2.31.1


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

* [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Alistair Francis
@ 2021-08-03  8:48 ` Alistair Francis
  2021-08-03 14:45     ` kernel test robot
  2021-08-03  8:48 ` [PATCH v8 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Alistair Francis
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Connect touchscreen properties to the wacom_i2c.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 28 ++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index 6053595f2b30..b47bc08efdd1 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -11,6 +11,7 @@
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/irq.h>
+#include <linux/input/touchscreen.h>
 #include <linux/interrupt.h>
 #include <linux/of.h>
 #include <asm/unaligned.h>
@@ -33,6 +34,8 @@ struct wacom_features {
 struct wacom_i2c {
 	struct i2c_client *client;
 	struct input_dev *input;
+	struct touchscreen_properties props;
+	struct wacom_features features;
 	u8 data[WACOM_QUERY_SIZE];
 	bool prox;
 	int tool;
@@ -90,6 +93,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
 {
 	struct wacom_i2c *wac_i2c = dev_id;
 	struct input_dev *input = wac_i2c->input;
+	struct wacom_features *features = &wac_i2c->features;
 	u8 *data = wac_i2c->data;
 	unsigned int x, y, pressure;
 	unsigned char tsw, f1, f2, ers;
@@ -114,12 +118,12 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
 
 	wac_i2c->prox = data[3] & 0x20;
 
+	touchscreen_report_pos(input, &wac_i2c->props, features->x_max,
+			       features->y_max, true);
 	input_report_key(input, BTN_TOUCH, tsw || ers);
 	input_report_key(input, wac_i2c->tool, wac_i2c->prox);
 	input_report_key(input, BTN_STYLUS, f1);
 	input_report_key(input, BTN_STYLUS2, f2);
-	input_report_abs(input, ABS_X, x);
-	input_report_abs(input, ABS_Y, y);
 	input_report_abs(input, ABS_PRESSURE, pressure);
 	input_sync(input);
 
@@ -151,7 +155,7 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	struct device *dev = &client->dev;
 	struct wacom_i2c *wac_i2c;
 	struct input_dev *input;
-	struct wacom_features features = { 0 };
+	struct wacom_features *features;
 	int error;
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
@@ -159,14 +163,15 @@ static int wacom_i2c_probe(struct i2c_client *client,
 		return -EIO;
 	}
 
-	error = wacom_query_device(client, &features);
-	if (error)
-		return error;
-
 	wac_i2c = devm_kzalloc(dev, sizeof(*wac_i2c), GFP_KERNEL);
 	if (!wac_i2c)
 		return -ENOMEM;
 
+	features = &wac_i2c->features;
+	error = wacom_query_device(client, features);
+	if (error)
+		return error;
+
 	wac_i2c->client = client;
 
 	input = devm_input_allocate_device(dev);
@@ -178,7 +183,7 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	input->name = "Wacom I2C Digitizer";
 	input->id.bustype = BUS_I2C;
 	input->id.vendor = 0x56a;
-	input->id.version = features.fw_version;
+	input->id.version = features->fw_version;
 	input->open = wacom_i2c_open;
 	input->close = wacom_i2c_close;
 
@@ -190,10 +195,11 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	__set_bit(BTN_STYLUS2, input->keybit);
 	__set_bit(BTN_TOUCH, input->keybit);
 
-	input_set_abs_params(input, ABS_X, 0, features.x_max, 0, 0);
-	input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0);
+	touchscreen_parse_properties(input, true, &wac_i2c->props);
+	input_set_abs_params(input, ABS_X, 0, features->x_max, 0, 0);
+	input_set_abs_params(input, ABS_Y, 0, features->y_max, 0, 0);
 	input_set_abs_params(input, ABS_PRESSURE,
-			     0, features.pressure_max, 0, 0);
+			     0, features->pressure_max, 0, 0);
 
 	input_set_drvdata(input, wac_i2c);
 
-- 
2.31.1


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

* [PATCH v8 5/9] Input: wacom_i2c - Add support for distance and tilt x/y
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
                   ` (2 preceding siblings ...)
  2021-08-03  8:48 ` [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties Alistair Francis
@ 2021-08-03  8:48 ` Alistair Francis
  2021-08-03  8:48 ` [PATCH v8 6/9] Input: wacom_i2c - Clean up the query device fields Alistair Francis
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

This is based on the out of tree rM2 driver.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 34 +++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index b47bc08efdd1..e2449a4fa2e3 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -22,12 +22,18 @@
 #define WACOM_CMD_QUERY3	0x02
 #define WACOM_CMD_THROW0	0x05
 #define WACOM_CMD_THROW1	0x00
-#define WACOM_QUERY_SIZE	19
+#define WACOM_QUERY_SIZE	22
+
+#define WACOM_DISTANCE_TILT_VERSION	0x30
 
 struct wacom_features {
 	int x_max;
 	int y_max;
 	int pressure_max;
+	int distance_max;
+	int distance_physical_max;
+	int tilt_x_max;
+	int tilt_y_max;
 	char fw_version;
 };
 
@@ -80,6 +86,17 @@ static int wacom_query_device(struct i2c_client *client,
 	features->y_max = get_unaligned_le16(&data[5]);
 	features->pressure_max = get_unaligned_le16(&data[11]);
 	features->fw_version = get_unaligned_le16(&data[13]);
+	if (features->fw_version >= WACOM_DISTANCE_TILT_VERSION) {
+		features->distance_max = data[15];
+		features->distance_physical_max = data[16];
+		features->tilt_x_max = get_unaligned_le16(&data[17]);
+		features->tilt_y_max = get_unaligned_le16(&data[19]);
+	} else {
+		features->distance_max = -1;
+		features->distance_physical_max = -1;
+		features->tilt_x_max = -1;
+		features->tilt_y_max = -1;
+	}
 
 	dev_dbg(&client->dev,
 		"x_max:%d, y_max:%d, pressure:%d, fw:%d\n",
@@ -97,6 +114,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
 	u8 *data = wac_i2c->data;
 	unsigned int x, y, pressure;
 	unsigned char tsw, f1, f2, ers;
+	short tilt_x, tilt_y, distance;
 	int error;
 
 	error = i2c_master_recv(wac_i2c->client,
@@ -111,6 +129,11 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
 	x = le16_to_cpup((__le16 *)&data[4]);
 	y = le16_to_cpup((__le16 *)&data[6]);
 	pressure = le16_to_cpup((__le16 *)&data[8]);
+	distance = data[10];
+
+	/* Signed */
+	tilt_x = le16_to_cpup((__le16 *)&data[11]);
+	tilt_y = le16_to_cpup((__le16 *)&data[13]);
 
 	if (!wac_i2c->prox)
 		wac_i2c->tool = (data[3] & 0x0c) ?
@@ -125,6 +148,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
 	input_report_key(input, BTN_STYLUS, f1);
 	input_report_key(input, BTN_STYLUS2, f2);
 	input_report_abs(input, ABS_PRESSURE, pressure);
+	input_report_abs(input, ABS_DISTANCE, distance);
+	input_report_abs(input, ABS_TILT_X, tilt_x);
+	input_report_abs(input, ABS_TILT_Y, tilt_y);
 	input_sync(input);
 
 out:
@@ -200,7 +226,11 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	input_set_abs_params(input, ABS_Y, 0, features->y_max, 0, 0);
 	input_set_abs_params(input, ABS_PRESSURE,
 			     0, features->pressure_max, 0, 0);
-
+	input_set_abs_params(input, ABS_DISTANCE, 0, features->distance_max, 0, 0);
+	input_set_abs_params(input, ABS_TILT_X, -features->tilt_x_max,
+			     features->tilt_x_max, 0, 0);
+	input_set_abs_params(input, ABS_TILT_Y, -features->tilt_y_max,
+			     features->tilt_y_max, 0, 0);
 	input_set_drvdata(input, wac_i2c);
 
 	error = devm_request_threaded_irq(dev, client->irq, NULL, wacom_i2c_irq,
-- 
2.31.1


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

* [PATCH v8 6/9] Input: wacom_i2c - Clean up the query device fields
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
                   ` (3 preceding siblings ...)
  2021-08-03  8:48 ` [PATCH v8 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Alistair Francis
@ 2021-08-03  8:48 ` Alistair Francis
  2021-08-03  8:49 ` [PATCH v8 7/9] Input: wacom_i2c - Add support for vdd regulator Alistair Francis
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:48 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Improve the query device fields to be more verbose.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 64 ++++++++++++++++++---------
 1 file changed, 44 insertions(+), 20 deletions(-)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index e2449a4fa2e3..49d1c15e623c 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -13,15 +13,32 @@
 #include <linux/irq.h>
 #include <linux/input/touchscreen.h>
 #include <linux/interrupt.h>
+#include <linux/reset.h>
 #include <linux/of.h>
 #include <asm/unaligned.h>
 
-#define WACOM_CMD_QUERY0	0x04
-#define WACOM_CMD_QUERY1	0x00
-#define WACOM_CMD_QUERY2	0x33
-#define WACOM_CMD_QUERY3	0x02
-#define WACOM_CMD_THROW0	0x05
-#define WACOM_CMD_THROW1	0x00
+// Registers
+#define WACOM_COMMAND_LSB   0x04
+#define WACOM_COMMAND_MSB   0x00
+
+#define WACOM_DATA_LSB      0x05
+#define WACOM_DATA_MSB      0x00
+
+// Report types
+#define REPORT_FEATURE      0x30
+
+// Requests / operations
+#define OPCODE_GET_REPORT   0x02
+
+// Power settings
+#define POWER_ON            0x00
+#define POWER_SLEEP         0x01
+
+// Input report ids
+#define WACOM_PEN_DATA_REPORT           2
+#define WACOM_SHINONOME_REPORT          26
+
+#define WACOM_QUERY_REPORT	3
 #define WACOM_QUERY_SIZE	22
 
 #define WACOM_DISTANCE_TILT_VERSION	0x30
@@ -51,27 +68,30 @@ static int wacom_query_device(struct i2c_client *client,
 			      struct wacom_features *features)
 {
 	int ret;
-	u8 cmd1[] = { WACOM_CMD_QUERY0, WACOM_CMD_QUERY1,
-			WACOM_CMD_QUERY2, WACOM_CMD_QUERY3 };
-	u8 cmd2[] = { WACOM_CMD_THROW0, WACOM_CMD_THROW1 };
 	u8 data[WACOM_QUERY_SIZE];
+
+	u8 get_query_data_cmd[] = {
+		WACOM_COMMAND_LSB,
+		WACOM_COMMAND_MSB,
+		REPORT_FEATURE | WACOM_QUERY_REPORT,
+		OPCODE_GET_REPORT,
+		WACOM_DATA_LSB,
+		WACOM_DATA_MSB,
+	};
+
 	struct i2c_msg msgs[] = {
+		// Request reading of feature ReportID: 3 (Pen Query Data)
 		{
 			.addr = client->addr,
 			.flags = 0,
-			.len = sizeof(cmd1),
-			.buf = cmd1,
-		},
-		{
-			.addr = client->addr,
-			.flags = 0,
-			.len = sizeof(cmd2),
-			.buf = cmd2,
+			.len = sizeof(get_query_data_cmd),
+			.buf = get_query_data_cmd,
 		},
+		// Read 21 bytes
 		{
 			.addr = client->addr,
 			.flags = I2C_M_RD,
-			.len = sizeof(data),
+			.len = WACOM_QUERY_SIZE - 1,
 			.buf = data,
 		},
 	};
@@ -99,9 +119,13 @@ static int wacom_query_device(struct i2c_client *client,
 	}
 
 	dev_dbg(&client->dev,
-		"x_max:%d, y_max:%d, pressure:%d, fw:%d\n",
+		"x_max:%d, y_max:%d, pressure:%d, fw:%d, "
+		"distance: %d, phys distance: %d, "
+		"tilt_x_max: %d, tilt_y_max: %d\n",
 		features->x_max, features->y_max,
-		features->pressure_max, features->fw_version);
+		features->pressure_max, features->fw_version,
+		features->distance_max, features->distance_physical_max,
+		features->tilt_x_max, features->tilt_y_max);
 
 	return 0;
 }
-- 
2.31.1


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

* [PATCH v8 7/9] Input: wacom_i2c - Add support for vdd regulator
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
                   ` (4 preceding siblings ...)
  2021-08-03  8:48 ` [PATCH v8 6/9] Input: wacom_i2c - Clean up the query device fields Alistair Francis
@ 2021-08-03  8:49 ` Alistair Francis
  2021-08-03  8:49 ` [PATCH v8 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Alistair Francis
  2021-08-03  8:49 ` [PATCH v8 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:49 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Add support for a VDD regulator. This allows the kernel to prove the
Wacom-I2C device on the rM2.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/input/touchscreen/wacom_i2c.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index 49d1c15e623c..df77b17835e4 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -13,6 +13,7 @@
 #include <linux/irq.h>
 #include <linux/input/touchscreen.h>
 #include <linux/interrupt.h>
+#include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 #include <linux/of.h>
 #include <asm/unaligned.h>
@@ -59,6 +60,7 @@ struct wacom_i2c {
 	struct input_dev *input;
 	struct touchscreen_properties props;
 	struct wacom_features features;
+	struct regulator *vdd;
 	u8 data[WACOM_QUERY_SIZE];
 	bool prox;
 	int tool;
@@ -222,11 +224,24 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
+	wac_i2c->vdd = regulator_get(&client->dev, "vdd");
+	if (IS_ERR(wac_i2c->vdd))
+		return PTR_ERR(wac_i2c->vdd);
+
+	error = regulator_enable(wac_i2c->vdd);
+	if (error) {
+		regulator_put(wac_i2c->vdd);
+		return error;
+	}
+
 	wac_i2c->client = client;
 
 	input = devm_input_allocate_device(dev);
-	if (!input)
+	if (!input) {
+		regulator_disable(wac_i2c->vdd);
+		regulator_put(wac_i2c->vdd);
 		return -ENOMEM;
+	}
 
 	wac_i2c->input = input;
 
@@ -261,6 +276,8 @@ static int wacom_i2c_probe(struct i2c_client *client,
 					  IRQF_ONESHOT, "wacom_i2c", wac_i2c);
 	if (error) {
 		dev_err(dev, "Failed to request IRQ: %d\n", error);
+		regulator_disable(wac_i2c->vdd);
+		regulator_put(wac_i2c->vdd);
 		return error;
 	}
 
@@ -270,6 +287,8 @@ static int wacom_i2c_probe(struct i2c_client *client,
 	error = input_register_device(wac_i2c->input);
 	if (error) {
 		dev_err(dev, "Failed to register input device: %d\n", error);
+		regulator_disable(wac_i2c->vdd);
+		regulator_put(wac_i2c->vdd);
 		return error;
 	}
 
-- 
2.31.1


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

* [PATCH v8 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
                   ` (5 preceding siblings ...)
  2021-08-03  8:49 ` [PATCH v8 7/9] Input: wacom_i2c - Add support for vdd regulator Alistair Francis
@ 2021-08-03  8:49 ` Alistair Francis
  2021-08-03  8:49 ` [PATCH v8 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:49 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Enable the Wacom I2C in the imx defconfig as it is used by the
reMarkable2 tablet.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 079fcd8d1d11..477dac1edc75 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -176,6 +176,7 @@ CONFIG_TOUCHSCREEN_DA9052=y
 CONFIG_TOUCHSCREEN_EGALAX=y
 CONFIG_TOUCHSCREEN_GOODIX=y
 CONFIG_TOUCHSCREEN_ILI210X=y
+CONFIG_TOUCHSCREEN_WACOM_I2C=y
 CONFIG_TOUCHSCREEN_MAX11801=y
 CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
 CONFIG_TOUCHSCREEN_EDT_FT5X06=y
-- 
2.31.1


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

* [PATCH v8 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device
  2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
                   ` (6 preceding siblings ...)
  2021-08-03  8:49 ` [PATCH v8 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Alistair Francis
@ 2021-08-03  8:49 ` Alistair Francis
  7 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2021-08-03  8:49 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-imx, kernel, pinglinux,
	tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: linux-kernel, alistair23, robh+dt, devicetree, Alistair Francis

Enable the wacom_i2c touchscreen for the reMarkable2.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 arch/arm/boot/dts/imx7d-remarkable2.dts | 61 +++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts
index 89cbf13097a4..cc33b53ae6ba 100644
--- a/arch/arm/boot/dts/imx7d-remarkable2.dts
+++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
@@ -34,6 +34,19 @@ reg_brcm: regulator-brcm {
 		startup-delay-us = <150>;
 	};
 
+	reg_digitizer: regulator-digitizer {
+		compatible = "regulator-fixed";
+		regulator-name = "VDD_3V3_DIGITIZER";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&pinctrl_digitizer_reg>;
+		pinctrl-1 = <&pinctrl_digitizer_reg>;
+		gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		startup-delay-us = <100000>; /* 100 ms */
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
@@ -51,6 +64,28 @@ &clks {
 	assigned-clock-rates = <0>, <32768>;
 };
 
+&i2c1 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+
+	wacom_digitizer: digitizer@9 {
+		compatible = "wacom,i2c-30";
+		reg = <0x09>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_wacom>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+		flip-tilt-x;
+		flip-tilt-y;
+		flip-pos-x;
+		flip-pos-y;
+		flip-distance;
+		vdd-supply = <&reg_digitizer>;
+	};
+};
+
 &snvs_pwrkey {
 	status = "okay";
 };
@@ -117,6 +152,25 @@ &wdog1 {
 	fsl,ext-reset-output;
 };
 
+&iomuxc_lpsr {
+	pinctrl_digitizer_reg: digitizerreggrp {
+		fsl,pins = <
+			/* DIGITIZER_PWR_EN */
+			MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x14
+		>;
+	};
+
+	pinctrl_wacom: wacomgrp {
+		fsl,pins = <
+			/*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x00000014 /* FWE */
+			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x00000074 /* PDCTB */
+			MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1	0x00000034 /* WACOM INT */
+			/*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x00000014 /* WACOM PWR ENABLE */
+			/*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x00000074 /* WACOM RESET */
+		>;
+	};
+};
+
 &iomuxc {
 	pinctrl_brcm_reg: brcmreggrp {
 		fsl,pins = <
@@ -125,6 +179,13 @@ MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13	0x14
 		>;
 	};
 
+	pinctrl_i2c1: i2c1grp {
+		fsl,pins = <
+			MX7D_PAD_I2C1_SDA__I2C1_SDA		0x4000007f
+			MX7D_PAD_I2C1_SCL__I2C1_SCL		0x4000007f
+		>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		fsl,pins = <
 			MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX	0x79
-- 
2.31.1


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

* Re: [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties
  2021-08-03  8:48 ` [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties Alistair Francis
@ 2021-08-03 14:45     ` kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2021-08-03 14:45 UTC (permalink / raw)
  To: Alistair Francis, dmitry.torokhov, linux-input, linux-imx, kernel,
	pinglinux, tatsunosuke.tobita, junkpainting, ping.cheng
  Cc: kbuild-all, linux-kernel, alistair23

[-- Attachment #1: Type: text/plain, Size: 5999 bytes --]

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20210802]
[also build test WARNING on v5.14-rc4]
[cannot apply to input/next robh/for-next hid/for-next linus/master v5.14-rc4 v5.14-rc3 v5.14-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alistair-Francis/dt-bindings-Add-Wacom-to-vendor-bindings/20210803-165202
base:    3a928c58ca10d61051e6a2be65a81418615ef92c
config: nds32-randconfig-p002-20210803 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e05730114340bbb6573b02263781927ae727f53e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/dt-bindings-Add-Wacom-to-vendor-bindings/20210803-165202
        git checkout e05730114340bbb6573b02263781927ae727f53e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/input/touchscreen/wacom_i2c.c: In function 'wacom_i2c_irq':
>> drivers/input/touchscreen/wacom_i2c.c:98:18: warning: variable 'y' set but not used [-Wunused-but-set-variable]
      98 |  unsigned int x, y, pressure;
         |                  ^
>> drivers/input/touchscreen/wacom_i2c.c:98:15: warning: variable 'x' set but not used [-Wunused-but-set-variable]
      98 |  unsigned int x, y, pressure;
         |               ^


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> kernel/trace/trace_osnoise.c:1612:8: warning: snprintf format string requires 2 parameters but only 1 is given. [wrongPrintfScanfArgNum]
    len = snprintf(NULL, 0, "%*pbln", cpumask_pr_args(&osnoise_cpumask)) + 1;
          ^
   kernel/trace/trace_osnoise.c:1619:8: warning: snprintf format string requires 2 parameters but only 1 is given. [wrongPrintfScanfArgNum]
    len = snprintf(mask_str, len, "%*pbln", cpumask_pr_args(&osnoise_cpumask));
          ^

vim +/y +98 drivers/input/touchscreen/wacom_i2c.c

5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   91  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   92  static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   93  {
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   94  	struct wacom_i2c *wac_i2c = dev_id;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   95  	struct input_dev *input = wac_i2c->input;
e05730114340bb Alistair Francis   2021-08-03   96  	struct wacom_features *features = &wac_i2c->features;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   97  	u8 *data = wac_i2c->data;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  @98  	unsigned int x, y, pressure;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   99  	unsigned char tsw, f1, f2, ers;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  100  	int error;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  101  
d568778298f583 Dmitry Torokhov    2012-04-10  102  	error = i2c_master_recv(wac_i2c->client,
d568778298f583 Dmitry Torokhov    2012-04-10  103  				wac_i2c->data, sizeof(wac_i2c->data));
d568778298f583 Dmitry Torokhov    2012-04-10  104  	if (error < 0)
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  105  		goto out;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  106  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  107  	tsw = data[3] & 0x01;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  108  	ers = data[3] & 0x04;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  109  	f1 = data[3] & 0x02;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  110  	f2 = data[3] & 0x10;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  111  	x = le16_to_cpup((__le16 *)&data[4]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  112  	y = le16_to_cpup((__le16 *)&data[6]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  113  	pressure = le16_to_cpup((__le16 *)&data[8]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  114  
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  115  	if (!wac_i2c->prox)
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  116  		wac_i2c->tool = (data[3] & 0x0c) ?
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  117  			BTN_TOOL_RUBBER : BTN_TOOL_PEN;
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  118  
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  119  	wac_i2c->prox = data[3] & 0x20;
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  120  
e05730114340bb Alistair Francis   2021-08-03  121  	touchscreen_report_pos(input, &wac_i2c->props, features->x_max,
e05730114340bb Alistair Francis   2021-08-03  122  			       features->y_max, true);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  123  	input_report_key(input, BTN_TOUCH, tsw || ers);
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  124  	input_report_key(input, wac_i2c->tool, wac_i2c->prox);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  125  	input_report_key(input, BTN_STYLUS, f1);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  126  	input_report_key(input, BTN_STYLUS2, f2);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  127  	input_report_abs(input, ABS_PRESSURE, pressure);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  128  	input_sync(input);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  129  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  130  out:
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  131  	return IRQ_HANDLED;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  132  }
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  133  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31318 bytes --]

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

* Re: [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties
@ 2021-08-03 14:45     ` kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2021-08-03 14:45 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6098 bytes --]

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20210802]
[also build test WARNING on v5.14-rc4]
[cannot apply to input/next robh/for-next hid/for-next linus/master v5.14-rc4 v5.14-rc3 v5.14-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alistair-Francis/dt-bindings-Add-Wacom-to-vendor-bindings/20210803-165202
base:    3a928c58ca10d61051e6a2be65a81418615ef92c
config: nds32-randconfig-p002-20210803 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e05730114340bbb6573b02263781927ae727f53e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/dt-bindings-Add-Wacom-to-vendor-bindings/20210803-165202
        git checkout e05730114340bbb6573b02263781927ae727f53e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/input/touchscreen/wacom_i2c.c: In function 'wacom_i2c_irq':
>> drivers/input/touchscreen/wacom_i2c.c:98:18: warning: variable 'y' set but not used [-Wunused-but-set-variable]
      98 |  unsigned int x, y, pressure;
         |                  ^
>> drivers/input/touchscreen/wacom_i2c.c:98:15: warning: variable 'x' set but not used [-Wunused-but-set-variable]
      98 |  unsigned int x, y, pressure;
         |               ^


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> kernel/trace/trace_osnoise.c:1612:8: warning: snprintf format string requires 2 parameters but only 1 is given. [wrongPrintfScanfArgNum]
    len = snprintf(NULL, 0, "%*pbln", cpumask_pr_args(&osnoise_cpumask)) + 1;
          ^
   kernel/trace/trace_osnoise.c:1619:8: warning: snprintf format string requires 2 parameters but only 1 is given. [wrongPrintfScanfArgNum]
    len = snprintf(mask_str, len, "%*pbln", cpumask_pr_args(&osnoise_cpumask));
          ^

vim +/y +98 drivers/input/touchscreen/wacom_i2c.c

5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   91  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   92  static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   93  {
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   94  	struct wacom_i2c *wac_i2c = dev_id;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   95  	struct input_dev *input = wac_i2c->input;
e05730114340bb Alistair Francis   2021-08-03   96  	struct wacom_features *features = &wac_i2c->features;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   97  	u8 *data = wac_i2c->data;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  @98  	unsigned int x, y, pressure;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25   99  	unsigned char tsw, f1, f2, ers;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  100  	int error;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  101  
d568778298f583 Dmitry Torokhov    2012-04-10  102  	error = i2c_master_recv(wac_i2c->client,
d568778298f583 Dmitry Torokhov    2012-04-10  103  				wac_i2c->data, sizeof(wac_i2c->data));
d568778298f583 Dmitry Torokhov    2012-04-10  104  	if (error < 0)
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  105  		goto out;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  106  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  107  	tsw = data[3] & 0x01;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  108  	ers = data[3] & 0x04;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  109  	f1 = data[3] & 0x02;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  110  	f2 = data[3] & 0x10;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  111  	x = le16_to_cpup((__le16 *)&data[4]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  112  	y = le16_to_cpup((__le16 *)&data[6]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  113  	pressure = le16_to_cpup((__le16 *)&data[8]);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  114  
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  115  	if (!wac_i2c->prox)
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  116  		wac_i2c->tool = (data[3] & 0x0c) ?
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  117  			BTN_TOOL_RUBBER : BTN_TOOL_PEN;
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  118  
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  119  	wac_i2c->prox = data[3] & 0x20;
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  120  
e05730114340bb Alistair Francis   2021-08-03  121  	touchscreen_report_pos(input, &wac_i2c->props, features->x_max,
e05730114340bb Alistair Francis   2021-08-03  122  			       features->y_max, true);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  123  	input_report_key(input, BTN_TOUCH, tsw || ers);
8855f30cd2b680 Tatsunosuke Tobita 2013-06-18  124  	input_report_key(input, wac_i2c->tool, wac_i2c->prox);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  125  	input_report_key(input, BTN_STYLUS, f1);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  126  	input_report_key(input, BTN_STYLUS2, f2);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  127  	input_report_abs(input, ABS_PRESSURE, pressure);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  128  	input_sync(input);
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  129  
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  130  out:
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  131  	return IRQ_HANDLED;
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  132  }
5a966261c0dfb8 Tatsunosuke Tobita 2012-03-25  133  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31318 bytes --]

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

* Re: [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c
  2021-08-03  8:48 ` [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c Alistair Francis
@ 2021-08-11 18:06   ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2021-08-11 18:06 UTC (permalink / raw)
  To: Alistair Francis
  Cc: kernel, pinglinux, robh+dt, junkpainting, linux-input, ping.cheng,
	dmitry.torokhov, alistair23, tatsunosuke.tobita, devicetree,
	linux-kernel, linux-imx

On Tue, 03 Aug 2021 18:48:55 +1000, Alistair Francis wrote:
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
> ---
>  .../input/touchscreen/wacom,generic.yaml      | 48 +++++++++++++++++++
>  1 file changed, 48 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2021-08-11 18:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03  8:48 [PATCH v8 1/9] dt-bindings: Add Wacom to vendor bindings Alistair Francis
2021-08-03  8:48 ` [PATCH v8 2/9] dt-bindings: touchscreen: Initial commit of wacom,i2c Alistair Francis
2021-08-11 18:06   ` Rob Herring
2021-08-03  8:48 ` [PATCH v8 3/9] Input: wacom_i2c - Add device tree support to wacom_i2c Alistair Francis
2021-08-03  8:48 ` [PATCH v8 4/9] Input: wacom_i2c - Add touchscren properties Alistair Francis
2021-08-03 14:45   ` kernel test robot
2021-08-03 14:45     ` kernel test robot
2021-08-03  8:48 ` [PATCH v8 5/9] Input: wacom_i2c - Add support for distance and tilt x/y Alistair Francis
2021-08-03  8:48 ` [PATCH v8 6/9] Input: wacom_i2c - Clean up the query device fields Alistair Francis
2021-08-03  8:49 ` [PATCH v8 7/9] Input: wacom_i2c - Add support for vdd regulator Alistair Francis
2021-08-03  8:49 ` [PATCH v8 8/9] ARM: imx_v6_v7_defconfig: Enable Wacom I2C Alistair Francis
2021-08-03  8:49 ` [PATCH v8 9/9] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis

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.