All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] zForce upstreaming
@ 2016-05-04 10:24 Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 1/4] Input: zforce_ts: Reinitialize touch controller when BOOT_COMPLETE received Dirk Behme
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Dirk Behme @ 2016-05-04 10:24 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Oleksij Rempel

From: Oleksij Rempel <linux@rempel-privat.de>

Changelog:
v2
 - rename scan-freq-idle and scan-freq-finger
   to scan-idle-hz and scan-active-hz.
 - rebase with already acked "Input: zforce_ts: Fix dual touch recognition"
   from previous patchset.

v3
 - rename touch-size-min to touch-size-min-mm
 - fix typo
 - replace "zforce_ts: Reject open if initialization not finished" patch.
   Instead of reject open event, we will call zforce_start() from zforce_boot().

Knut Wohlrab (2):
  Input: zforce_ts: Add device tree support for scanning frequency
  Input: zforce_ts: Add support for minimum touch size limit

Marcel Grosshans (1):
  Input: zforce_ts: Reinitialize touch controller when  BOOT_COMPLETE
    received

Oleksij Rempel (1):
  Input: zforce_ts: allow open even if initialisation is not completed

 .../bindings/input/touchscreen/zforce_ts.txt       |   6 +
 drivers/input/touchscreen/zforce_ts.c              | 174 ++++++++++++++++++---
 include/linux/platform_data/zforce_ts.h            |   3 +
 3 files changed, 157 insertions(+), 26 deletions(-)

-- 
1.9.1


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

* [PATCH v3 1/4] Input: zforce_ts: Reinitialize touch controller when  BOOT_COMPLETE received
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
@ 2016-05-04 10:24 ` Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 2/4] Input: zforce_ts: allow open even if initialisation is not completed Dirk Behme
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Dirk Behme @ 2016-05-04 10:24 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Marcel Grosshans, Knut Wohlrab, Oleksij Rempel

From: Marcel Grosshans <MarcelViktor.Grosshans@de.bosch.com>

Unexpected power interruption or reset of the touch controller may disable
touch panel function. To avoid this situation, the touch controller is
completely reinitialized if BOOT_COMPLETE notification occures. To make
it possible we process reinitialization in a separate queue.

Signed-off-by: Marcel Grosshans <MarcelViktor.Grosshans@de.bosch.com>
Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/input/touchscreen/zforce_ts.c | 127 +++++++++++++++++++++++++++-------
 1 file changed, 102 insertions(+), 25 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 7b3845a..9839d86 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -31,6 +31,7 @@
 #include <linux/platform_data/zforce_ts.h>
 #include <linux/regulator/consumer.h>
 #include <linux/of.h>
+#include <linux/workqueue.h>
 
 #define WAIT_TIMEOUT		msecs_to_jiffies(1000)
 
@@ -98,6 +99,12 @@ struct zforce_point {
 	int prblty;
 };
 
+enum zforce_state {
+	ZF_STATE_UNINITIALZED = 0,
+	ZF_STATE_PROBE_COMPLETE,
+	ZF_STATE_DEV_OPENED,
+};
+
 /*
  * @client		the i2c_client
  * @input		the input device
@@ -138,6 +145,11 @@ struct zforce_ts {
 	struct mutex		command_mutex;
 	int			command_waiting;
 	int			command_result;
+
+	struct work_struct	ts_workq;
+	int			notification;
+
+	enum zforce_state	state;
 };
 
 static int zforce_command(struct zforce_ts *ts, u8 cmd)
@@ -188,6 +200,7 @@ static int zforce_send_wait(struct zforce_ts *ts, const char *buf, int len)
 		buf[1], buf[2]);
 
 	ts->command_waiting = buf[2];
+	reinit_completion(&ts->command_done);
 
 	mutex_lock(&ts->access_mutex);
 	ret = i2c_master_send(client, buf, len);
@@ -471,6 +484,15 @@ static void zforce_complete(struct zforce_ts *ts, int cmd, int result)
 		dev_dbg(&client->dev, "completing command 0x%x\n", cmd);
 		ts->command_result = result;
 		complete(&ts->command_done);
+	} else if (cmd == NOTIFICATION_BOOTCOMPLETE) {
+		dev_dbg(&client->dev, "got notification 0x%x\n", cmd);
+
+		/* abourt previous waiting command if any available */
+		ts->command_result = -ECONNABORTED;
+		ts->notification = cmd;
+		complete(&ts->command_done);
+
+		queue_work(system_long_wq, &ts->ts_workq);
 	} else {
 		dev_dbg(&client->dev, "command %d not for us\n", cmd);
 	}
@@ -596,11 +618,85 @@ static irqreturn_t zforce_irq_thread(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+/*
+ * This device is used in automotive environment. In this
+ * we should never fail. Some connection issues caused by vibration
+ * should be ignored and can be recoverable.
+ */
+static void zforce_boot(struct zforce_ts *ts)
+{
+	struct device *dev = &ts->client->dev;
+	int ret;
+
+	/* need to start device to get version information */
+	ret = zforce_command_wait(ts, COMMAND_INITIALIZE);
+	if (ret)
+		dev_err(dev, "unable to initialize, %d\n", ret);
+
+	switch (ts->state) {
+	case ZF_STATE_UNINITIALZED:
+		ret = zforce_command_wait(ts, COMMAND_STATUS);
+		if (ret)
+			dev_err(dev, "couldn't get status, %d\n", ret);
+		/* fallthrough, we need zforce_stop to complete. */
+	case ZF_STATE_PROBE_COMPLETE:
+		/* stop device and put it into sleep until it is opened */
+		ret = zforce_stop(ts);
+		if (ret)
+			dev_err(dev, "couldn't stop zforce, %d\n", ret);
+
+		ts->state = ZF_STATE_PROBE_COMPLETE;
+		break;
+	case ZF_STATE_DEV_OPENED:
+		ret = zforce_start(ts);
+		if (ret)
+			dev_err(dev, "Failed to restart, %d\n", ret);
+		break;
+	}
+}
+
+static void zforce_notification_queue(struct work_struct *work)
+{
+	struct zforce_ts *ts = container_of(work, struct zforce_ts, ts_workq);
+	struct i2c_client *client = ts->client;
+	struct input_dev *input = ts->input;
+
+	if (device_may_wakeup(&client->dev)) {
+		if (!ts->suspending)
+			pm_stay_awake(&client->dev);
+		else
+			pm_wakeup_event(&client->dev, 500);
+	}
+
+	mutex_lock(&input->mutex);
+
+	switch (ts->notification) {
+	case NOTIFICATION_BOOTCOMPLETE:
+		zforce_boot(ts);
+		break;
+	default:
+		dev_err(&client->dev,
+			"unknown notification: %#x\n", ts->notification);
+	}
+
+	mutex_unlock(&input->mutex);
+
+	if (!ts->suspending && device_may_wakeup(&client->dev))
+		pm_relax(&client->dev);
+}
+
 static int zforce_input_open(struct input_dev *dev)
 {
 	struct zforce_ts *ts = input_get_drvdata(dev);
+	int ret;
+
+	ret = zforce_start(ts);
+	if (ret)
+		return ret;
 
-	return zforce_start(ts);
+	ts->state = ZF_STATE_DEV_OPENED;
+
+	return 0;
 }
 
 static void zforce_input_close(struct input_dev *dev)
@@ -613,6 +709,8 @@ static void zforce_input_close(struct input_dev *dev)
 	if (ret)
 		dev_warn(&client->dev, "stopping zforce failed\n");
 
+	ts->state = ZF_STATE_PROBE_COMPLETE;
+
 	return;
 }
 
@@ -875,6 +973,7 @@ static int zforce_probe(struct i2c_client *client,
 	input_set_drvdata(ts->input, ts);
 
 	init_completion(&ts->command_done);
+	INIT_WORK(&ts->ts_workq, zforce_notification_queue);
 
 	/*
 	 * The zforce pulls the interrupt low when it has data ready.
@@ -894,33 +993,11 @@ static int zforce_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, ts);
 
+	ts->state = ZF_STATE_UNINITIALZED;
+
 	/* let the controller boot */
 	zforce_reset_deassert(ts);
 
-	ts->command_waiting = NOTIFICATION_BOOTCOMPLETE;
-	if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0)
-		dev_warn(&client->dev, "bootcomplete timed out\n");
-
-	/* need to start device to get version information */
-	ret = zforce_command_wait(ts, COMMAND_INITIALIZE);
-	if (ret) {
-		dev_err(&client->dev, "unable to initialize, %d\n", ret);
-		return ret;
-	}
-
-	/* this gets the firmware version among other information */
-	ret = zforce_command_wait(ts, COMMAND_STATUS);
-	if (ret < 0) {
-		dev_err(&client->dev, "couldn't get status, %d\n", ret);
-		zforce_stop(ts);
-		return ret;
-	}
-
-	/* stop device and put it into sleep until it is opened */
-	ret = zforce_stop(ts);
-	if (ret < 0)
-		return ret;
-
 	device_set_wakeup_capable(&client->dev, true);
 
 	ret = input_register_device(input_dev);
-- 
1.9.1


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

* [PATCH v3 2/4] Input: zforce_ts: allow open even if initialisation is not completed
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 1/4] Input: zforce_ts: Reinitialize touch controller when BOOT_COMPLETE received Dirk Behme
@ 2016-05-04 10:24 ` Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency Dirk Behme
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Dirk Behme @ 2016-05-04 10:24 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Oleksij Rempel, Oleksij Rempel, Knut Wohlrab

From: Oleksij Rempel <linux@rempel-privat.de>

Make sure zforce_start() is not called if FW init was not completed.

Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@de.bosch.com>
Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
---
 drivers/input/touchscreen/zforce_ts.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 9839d86..c912a0b 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -102,7 +102,6 @@ struct zforce_point {
 enum zforce_state {
 	ZF_STATE_UNINITIALZED = 0,
 	ZF_STATE_PROBE_COMPLETE,
-	ZF_STATE_DEV_OPENED,
 };
 
 /*
@@ -150,6 +149,7 @@ struct zforce_ts {
 	int			notification;
 
 	enum zforce_state	state;
+	atomic_t		opened;
 };
 
 static int zforce_command(struct zforce_ts *ts, u8 cmd)
@@ -647,12 +647,13 @@ static void zforce_boot(struct zforce_ts *ts)
 
 		ts->state = ZF_STATE_PROBE_COMPLETE;
 		break;
-	case ZF_STATE_DEV_OPENED:
-		ret = zforce_start(ts);
-		if (ret)
-			dev_err(dev, "Failed to restart, %d\n", ret);
-		break;
 	}
+
+	if (!atomic_read(&ts->opened))
+		return;
+
+	if (zforce_start(ts))
+		dev_err(dev, "Failed to restart, %d\n", ret);
 }
 
 static void zforce_notification_queue(struct work_struct *work)
@@ -690,11 +691,13 @@ static int zforce_input_open(struct input_dev *dev)
 	struct zforce_ts *ts = input_get_drvdata(dev);
 	int ret;
 
-	ret = zforce_start(ts);
-	if (ret)
-		return ret;
+	if (ts->state == ZF_STATE_PROBE_COMPLETE) {
+		ret = zforce_start(ts);
+		if (ret)
+			return ret;
+	}
 
-	ts->state = ZF_STATE_DEV_OPENED;
+	atomic_inc(&ts->opened);
 
 	return 0;
 }
@@ -709,7 +712,7 @@ static void zforce_input_close(struct input_dev *dev)
 	if (ret)
 		dev_warn(&client->dev, "stopping zforce failed\n");
 
-	ts->state = ZF_STATE_PROBE_COMPLETE;
+	atomic_dec(&ts->opened);
 
 	return;
 }
-- 
1.9.1


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

* [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 1/4] Input: zforce_ts: Reinitialize touch controller when BOOT_COMPLETE received Dirk Behme
  2016-05-04 10:24 ` [PATCH v3 2/4] Input: zforce_ts: allow open even if initialisation is not completed Dirk Behme
@ 2016-05-04 10:24 ` Dirk Behme
  2016-07-06 19:59   ` Dmitry Torokhov
  2016-05-04 10:24 ` [PATCH v3 4/4] Input: zforce_ts: Add support for minimum touch size limit Dirk Behme
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Dirk Behme @ 2016-05-04 10:24 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Knut Wohlrab, Oleksij Rempel

From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>

Add device tree support for idle and finger scanning frequency.

For usage details see documentation.

Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 .../devicetree/bindings/input/touchscreen/zforce_ts.txt   |  4 ++++
 drivers/input/touchscreen/zforce_ts.c                     | 15 ++++++++++++++-
 include/linux/platform_data/zforce_ts.h                   |  2 ++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
index e3c27c4..d8d57ba 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
@@ -11,6 +11,8 @@ Required properties:
 Optional properties:
 - irq-gpios : interrupt gpio the chip is connected to
 - vdd-supply: Regulator controlling the controller supply
+- scan-idle-hz: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz)
+- scan-active-hz: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz)
 
 Example:
 
@@ -28,6 +30,8 @@ Example:
 
 			x-size = <800>;
 			y-size = <600>;
+			scan-idle-hz = <50>;
+			scan-active-hz = <250>;
 		};
 
 		/* ... */
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index c912a0b..2e489fd 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -87,6 +87,9 @@
 
 #define SETCONFIG_DUALTOUCH		(1 << 0)
 
+#define SCAN_FREQ_DEFAULT_IDLE		10
+#define SCAN_FREQ_DEFAULT_FINGER	50
+
 struct zforce_point {
 	int coord_x;
 	int coord_y;
@@ -304,7 +307,9 @@ static int zforce_start(struct zforce_ts *ts)
 		goto error;
 	}
 
-	ret = zforce_scan_frequency(ts, 10, 50, 50);
+	ret = zforce_scan_frequency(ts, pdata->scan_freq_idle,
+				    pdata->scan_freq_finger,
+				    pdata->scan_freq_finger);
 	if (ret) {
 		dev_err(&client->dev, "Unable to set scan frequency, %d\n",
 			ret);
@@ -838,6 +843,14 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (of_property_read_u16(np, "scan-idle-hz",
+				 &pdata->scan_freq_idle))
+		pdata->scan_freq_idle = SCAN_FREQ_DEFAULT_IDLE;
+
+	if (of_property_read_u16(np, "scan-active-hz",
+				 &pdata->scan_freq_finger))
+		pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER;
+
 	return pdata;
 }
 
diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h
index 7bdece8..90a1181 100644
--- a/include/linux/platform_data/zforce_ts.h
+++ b/include/linux/platform_data/zforce_ts.h
@@ -18,6 +18,8 @@
 struct zforce_ts_platdata {
 	unsigned int x_max;
 	unsigned int y_max;
+	u16 scan_freq_idle;
+	u16 scan_freq_finger;
 };
 
 #endif /* _LINUX_INPUT_ZFORCE_TS_H */
-- 
1.9.1


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

* [PATCH v3 4/4] Input: zforce_ts: Add support for minimum touch size limit
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
                   ` (2 preceding siblings ...)
  2016-05-04 10:24 ` [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency Dirk Behme
@ 2016-05-04 10:24 ` Dirk Behme
  2016-05-19  5:26 ` [PATCH v3 0/4] zForce upstreaming Dirk Behme
  2016-06-10  7:43 ` AW: " FIXED-TERM Rempel Oleksij (CM/ESO3)
  5 siblings, 0 replies; 8+ messages in thread
From: Dirk Behme @ 2016-05-04 10:24 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Knut Wohlrab, Oleksij Rempel

From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>

The minimum touch size can be set to support more reliable touch
detection under difficult conditions (e.g. dust on touch panel surface).

For usage details see documentation.

Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 .../bindings/input/touchscreen/zforce_ts.txt       |  2 ++
 drivers/input/touchscreen/zforce_ts.c              | 29 ++++++++++++++++++++++
 include/linux/platform_data/zforce_ts.h            |  1 +
 3 files changed, 32 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
index d8d57ba..fed13a1 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
@@ -13,6 +13,7 @@ Optional properties:
 - vdd-supply: Regulator controlling the controller supply
 - scan-idle-hz: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz)
 - scan-active-hz: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz)
+- touch-size-min-mm: minimum touch size limit in mm (0 - 255 mm; 0 = no limit (default))
 
 Example:
 
@@ -32,6 +33,7 @@ Example:
 			y-size = <600>;
 			scan-idle-hz = <50>;
 			scan-active-hz = <250>;
+			touch-size-min-mm = <5>;
 		};
 
 		/* ... */
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 2e489fd..90bd9d9 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -54,6 +54,7 @@
 #define COMMAND_SETCONFIG	0x03
 #define COMMAND_DATAREQUEST	0x04
 #define COMMAND_SCANFREQ	0x08
+#define COMMAND_TOUCH_SIZE	0x09
 #define COMMAND_STATUS		0X1e
 
 /*
@@ -65,6 +66,7 @@
 #define RESPONSE_RESOLUTION	0x02
 #define RESPONSE_SETCONFIG	0x03
 #define RESPONSE_SCANFREQ	0x08
+#define RESPONSE_TOUCH_SIZE	0x09
 #define RESPONSE_STATUS		0X1e
 
 /*
@@ -276,6 +278,21 @@ static int zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger,
 	return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
 }
 
+static int zforce_touch_size_limit(struct zforce_ts *ts, u8 limit)
+{
+	struct i2c_client *client = ts->client;
+	u8 buf[] = { FRAME_START, 5, COMMAND_TOUCH_SIZE,
+		     0, 0, /* maximum size limit off */
+		     1, limit }; /* set minimum size limit */
+
+	if (!limit)
+		return 0;
+
+	dev_dbg(&client->dev, "set min. touch size limit to %d mm\n", limit);
+
+	return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
+}
+
 static int zforce_setconfig(struct zforce_ts *ts, char b1)
 {
 	struct i2c_client *client = ts->client;
@@ -316,6 +333,13 @@ static int zforce_start(struct zforce_ts *ts)
 		goto error;
 	}
 
+	ret = zforce_touch_size_limit(ts, pdata->touch_size_min);
+	if (ret) {
+		dev_err(&client->dev, "Unable to set min. touch size, %d\n",
+			ret);
+		goto error;
+	}
+
 	ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH);
 	if (ret) {
 		dev_err(&client->dev, "Unable to set config\n");
@@ -577,6 +601,7 @@ static irqreturn_t zforce_irq_thread(int irq, void *dev_id)
 		case RESPONSE_SETCONFIG:
 		case RESPONSE_RESOLUTION:
 		case RESPONSE_SCANFREQ:
+		case RESPONSE_TOUCH_SIZE:
 			zforce_complete(ts, payload[RESPONSE_ID],
 					payload[RESPONSE_DATA]);
 			break;
@@ -851,6 +876,10 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
 				 &pdata->scan_freq_finger))
 		pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER;
 
+	if (of_property_read_u8(np, "touch-size-min-mm",
+				&pdata->touch_size_min))
+		pdata->touch_size_min = 0;
+
 	return pdata;
 }
 
diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h
index 90a1181..75e1a49 100644
--- a/include/linux/platform_data/zforce_ts.h
+++ b/include/linux/platform_data/zforce_ts.h
@@ -20,6 +20,7 @@ struct zforce_ts_platdata {
 	unsigned int y_max;
 	u16 scan_freq_idle;
 	u16 scan_freq_finger;
+	u8 touch_size_min;
 };
 
 #endif /* _LINUX_INPUT_ZFORCE_TS_H */
-- 
1.9.1


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

* Re: [PATCH v3 0/4] zForce upstreaming
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
                   ` (3 preceding siblings ...)
  2016-05-04 10:24 ` [PATCH v3 4/4] Input: zforce_ts: Add support for minimum touch size limit Dirk Behme
@ 2016-05-19  5:26 ` Dirk Behme
  2016-06-10  7:43 ` AW: " FIXED-TERM Rempel Oleksij (CM/ESO3)
  5 siblings, 0 replies; 8+ messages in thread
From: Dirk Behme @ 2016-05-19  5:26 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Henrik Rydberg, Javier Martinez Canillas
  Cc: Oleksij Rempel

On 04.05.2016 12:24, Dirk Behme wrote:
> From: Oleksij Rempel <linux@rempel-privat.de>
>
> Changelog:
> v2
>  - rename scan-freq-idle and scan-freq-finger
>    to scan-idle-hz and scan-active-hz.
>  - rebase with already acked "Input: zforce_ts: Fix dual touch recognition"
>    from previous patchset.
>
> v3
>  - rename touch-size-min to touch-size-min-mm
>  - fix typo
>  - replace "zforce_ts: Reject open if initialization not finished" patch.
>    Instead of reject open event, we will call zforce_start() from zforce_boot().
>
> Knut Wohlrab (2):
>   Input: zforce_ts: Add device tree support for scanning frequency
>   Input: zforce_ts: Add support for minimum touch size limit
>
> Marcel Grosshans (1):
>   Input: zforce_ts: Reinitialize touch controller when  BOOT_COMPLETE
>     received
>
> Oleksij Rempel (1):
>   Input: zforce_ts: allow open even if initialisation is not completed
>
>  .../bindings/input/touchscreen/zforce_ts.txt       |   6 +
>  drivers/input/touchscreen/zforce_ts.c              | 174 ++++++++++++++++++---
>  include/linux/platform_data/zforce_ts.h            |   3 +
>  3 files changed, 157 insertions(+), 26 deletions(-)


Any further comments for this series? Or could it be applied, now?


Best regards

Dirk


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

* AW: [PATCH v3 0/4] zForce upstreaming
  2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
                   ` (4 preceding siblings ...)
  2016-05-19  5:26 ` [PATCH v3 0/4] zForce upstreaming Dirk Behme
@ 2016-06-10  7:43 ` FIXED-TERM Rempel Oleksij (CM/ESO3)
  5 siblings, 0 replies; 8+ messages in thread
From: FIXED-TERM Rempel Oleksij (CM/ESO3) @ 2016-06-10  7:43 UTC (permalink / raw)
  To: Behme Dirk (CM/ESO2),
	linux-input, Dmitry Torokhov, Henrik Rydberg,
	Javier Martinez Canillas
  Cc: Oleksij Rempel

ping

Mit freundlichen Grüßen / Best regards

Oleksij Rempel
CM/ESO3  

Tel. +49(5121)49-0 


-----Ursprüngliche Nachricht-----
Von: linux-input-owner@vger.kernel.org [mailto:linux-input-owner@vger.kernel.org] Im Auftrag von Dirk Behme
Gesendet: Mittwoch, 4. Mai 2016 12:25
An: linux-input@vger.kernel.org; Dmitry Torokhov <dmitry.torokhov@gmail.com>; Henrik Rydberg <rydberg@bitmath.org>; Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Oleksij Rempel <linux@rempel-privat.de>
Betreff: [PATCH v3 0/4] zForce upstreaming

From: Oleksij Rempel <linux@rempel-privat.de>

Changelog:
v2
 - rename scan-freq-idle and scan-freq-finger
   to scan-idle-hz and scan-active-hz.
 - rebase with already acked "Input: zforce_ts: Fix dual touch recognition"
   from previous patchset.

v3
 - rename touch-size-min to touch-size-min-mm
 - fix typo
 - replace "zforce_ts: Reject open if initialization not finished" patch.
   Instead of reject open event, we will call zforce_start() from zforce_boot().

Knut Wohlrab (2):
  Input: zforce_ts: Add device tree support for scanning frequency
  Input: zforce_ts: Add support for minimum touch size limit

Marcel Grosshans (1):
  Input: zforce_ts: Reinitialize touch controller when  BOOT_COMPLETE
    received

Oleksij Rempel (1):
  Input: zforce_ts: allow open even if initialisation is not completed

 .../bindings/input/touchscreen/zforce_ts.txt       |   6 +
 drivers/input/touchscreen/zforce_ts.c              | 174 ++++++++++++++++++---
 include/linux/platform_data/zforce_ts.h            |   3 +
 3 files changed, 157 insertions(+), 26 deletions(-)

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency
  2016-05-04 10:24 ` [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency Dirk Behme
@ 2016-07-06 19:59   ` Dmitry Torokhov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2016-07-06 19:59 UTC (permalink / raw)
  To: Dirk Behme, Rob Herring
  Cc: linux-input, Henrik Rydberg, Javier Martinez Canillas,
	Knut Wohlrab, Oleksij Rempel

On Wed, May 04, 2016 at 12:24:40PM +0200, Dirk Behme wrote:
> From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
> 
> Add device tree support for idle and finger scanning frequency.
> 
> For usage details see documentation.
> 
> Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  .../devicetree/bindings/input/touchscreen/zforce_ts.txt   |  4 ++++
>  drivers/input/touchscreen/zforce_ts.c                     | 15 ++++++++++++++-
>  include/linux/platform_data/zforce_ts.h                   |  2 ++
>  3 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> index e3c27c4..d8d57ba 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> @@ -11,6 +11,8 @@ Required properties:
>  Optional properties:
>  - irq-gpios : interrupt gpio the chip is connected to
>  - vdd-supply: Regulator controlling the controller supply
> +- scan-idle-hz: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz)
> +- scan-active-hz: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz)
>  
>  Example:
>  
> @@ -28,6 +30,8 @@ Example:
>  
>  			x-size = <800>;
>  			y-size = <600>;
> +			scan-idle-hz = <50>;
> +			scan-active-hz = <250>;

Since you are using of_property_read_u16() to fetch this data you need
to specify size in dts. But I think DT folks prefer we use
of_property_read_u32() and validate the range instead. Rob?

Thanks.

>  		};
>  
>  		/* ... */
> diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
> index c912a0b..2e489fd 100644
> --- a/drivers/input/touchscreen/zforce_ts.c
> +++ b/drivers/input/touchscreen/zforce_ts.c
> @@ -87,6 +87,9 @@
>  
>  #define SETCONFIG_DUALTOUCH		(1 << 0)
>  
> +#define SCAN_FREQ_DEFAULT_IDLE		10
> +#define SCAN_FREQ_DEFAULT_FINGER	50
> +
>  struct zforce_point {
>  	int coord_x;
>  	int coord_y;
> @@ -304,7 +307,9 @@ static int zforce_start(struct zforce_ts *ts)
>  		goto error;
>  	}
>  
> -	ret = zforce_scan_frequency(ts, 10, 50, 50);
> +	ret = zforce_scan_frequency(ts, pdata->scan_freq_idle,
> +				    pdata->scan_freq_finger,
> +				    pdata->scan_freq_finger);
>  	if (ret) {
>  		dev_err(&client->dev, "Unable to set scan frequency, %d\n",
>  			ret);
> @@ -838,6 +843,14 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
>  		return ERR_PTR(-EINVAL);
>  	}
>  
> +	if (of_property_read_u16(np, "scan-idle-hz",
> +				 &pdata->scan_freq_idle))
> +		pdata->scan_freq_idle = SCAN_FREQ_DEFAULT_IDLE;
> +
> +	if (of_property_read_u16(np, "scan-active-hz",
> +				 &pdata->scan_freq_finger))
> +		pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER;
> +
>  	return pdata;
>  }
>  
> diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h
> index 7bdece8..90a1181 100644
> --- a/include/linux/platform_data/zforce_ts.h
> +++ b/include/linux/platform_data/zforce_ts.h
> @@ -18,6 +18,8 @@
>  struct zforce_ts_platdata {
>  	unsigned int x_max;
>  	unsigned int y_max;
> +	u16 scan_freq_idle;
> +	u16 scan_freq_finger;
>  };
>  
>  #endif /* _LINUX_INPUT_ZFORCE_TS_H */
> -- 
> 1.9.1
> 

-- 
Dmitry

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

end of thread, other threads:[~2016-07-06 19:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 10:24 [PATCH v3 0/4] zForce upstreaming Dirk Behme
2016-05-04 10:24 ` [PATCH v3 1/4] Input: zforce_ts: Reinitialize touch controller when BOOT_COMPLETE received Dirk Behme
2016-05-04 10:24 ` [PATCH v3 2/4] Input: zforce_ts: allow open even if initialisation is not completed Dirk Behme
2016-05-04 10:24 ` [PATCH v3 3/4] Input: zforce_ts: Add device tree support for scanning frequency Dirk Behme
2016-07-06 19:59   ` Dmitry Torokhov
2016-05-04 10:24 ` [PATCH v3 4/4] Input: zforce_ts: Add support for minimum touch size limit Dirk Behme
2016-05-19  5:26 ` [PATCH v3 0/4] zForce upstreaming Dirk Behme
2016-06-10  7:43 ` AW: " FIXED-TERM Rempel Oleksij (CM/ESO3)

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.