Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/4] EDT-FT5x06 Fixes and improvments
@ 2020-02-27 11:28 Marco Felsch
  2020-02-27 11:28 ` [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access Marco Felsch
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Marco Felsch @ 2020-02-27 11:28 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: linux-input, kernel

Hi,

first this series fixes a possible undefined register access for
ev-ft5726 devices.

This series also includes the v4 of the improved pm ops. Please check
my notes I made on the patch.

Last but least it adds the support for async probe which is important
for fast booting because devices having a reset-pin specified sleeps
300ms..

Regards,
  Marco

Ahmad Fatoum (1):
  Input: edt-ft5x06 - prefer asynchronous probe

Marco Felsch (3):
  Input: edt-ft5x06 - fix get_default register write access
  Input: edt-ft5x06 - move parameter restore into helper
  Input: edt-ft5x06 - improve power management operations

 drivers/input/touchscreen/edt-ft5x06.c | 179 ++++++++++++++++++++++---
 1 file changed, 157 insertions(+), 22 deletions(-)

-- 
2.20.1


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

* [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access
  2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
@ 2020-02-27 11:28 ` Marco Felsch
  2020-05-09 19:05   ` Dmitry Torokhov
  2020-02-27 11:28 ` [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper Marco Felsch
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-02-27 11:28 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: linux-input, kernel

Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
ev-ft5726") offset-x and offset-y is supported. Devices using those
offset parameters don't support the offset parameter so we need to add
the NO_REGISTER check for edt_ft5x06_ts_get_defaults().

Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/input/touchscreen/edt-ft5x06.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index d2587724c52a..9b8450794a8a 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -938,19 +938,25 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
 
 	error = device_property_read_u32(dev, "offset", &val);
 	if (!error) {
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
+		if (reg_addr->reg_offset != NO_REGISTER)
+			edt_ft5x06_register_write(tsdata,
+						  reg_addr->reg_offset, val);
 		tsdata->offset = val;
 	}
 
 	error = device_property_read_u32(dev, "offset-x", &val);
 	if (!error) {
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x, val);
+		if (reg_addr->reg_offset_x != NO_REGISTER)
+			edt_ft5x06_register_write(tsdata,
+						  reg_addr->reg_offset_x, val);
 		tsdata->offset_x = val;
 	}
 
 	error = device_property_read_u32(dev, "offset-y", &val);
 	if (!error) {
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y, val);
+		if (reg_addr->reg_offset_y != NO_REGISTER)
+			edt_ft5x06_register_write(tsdata,
+						  reg_addr->reg_offset_y, val);
 		tsdata->offset_y = val;
 	}
 }
-- 
2.20.1


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

* [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper
  2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
  2020-02-27 11:28 ` [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access Marco Felsch
@ 2020-02-27 11:28 ` Marco Felsch
  2020-05-09 19:06   ` Dmitry Torokhov
  2020-02-27 11:28 ` [PATCH 3/4] Input: edt-ft5x06 - improve power management operations Marco Felsch
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-02-27 11:28 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: linux-input, kernel

We need to restore the parameters if we switch between the
factory/work mode and during the resume process if we switched off the
power-supply. Therefore refactor edt_ft5x06_work_mode() and move the
"restore the parameters" into a helper routine so we can reuse it later.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/input/touchscreen/edt-ft5x06.c | 43 ++++++++++++++------------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 9b8450794a8a..bb9107093796 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -527,6 +527,29 @@ static const struct attribute_group edt_ft5x06_attr_group = {
 	.attrs = edt_ft5x06_attrs,
 };
 
+static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata)
+{
+	struct edt_reg_addr *reg_addr = &tsdata->reg_addr;
+
+	edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold,
+				  tsdata->threshold);
+	edt_ft5x06_register_write(tsdata, reg_addr->reg_gain,
+				  tsdata->gain);
+	if (reg_addr->reg_offset != NO_REGISTER)
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset,
+					  tsdata->offset);
+	if (reg_addr->reg_offset_x != NO_REGISTER)
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x,
+					  tsdata->offset_x);
+	if (reg_addr->reg_offset_y != NO_REGISTER)
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y,
+					  tsdata->offset_y);
+	if (reg_addr->reg_report_rate != NO_REGISTER)
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_report_rate,
+				  tsdata->report_rate);
+
+}
+
 #ifdef CONFIG_DEBUG_FS
 static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata)
 {
@@ -592,7 +615,6 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata)
 {
 	struct i2c_client *client = tsdata->client;
 	int retries = EDT_SWITCH_MODE_RETRIES;
-	struct edt_reg_addr *reg_addr = &tsdata->reg_addr;
 	int ret;
 	int error;
 
@@ -624,24 +646,7 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata)
 	kfree(tsdata->raw_buffer);
 	tsdata->raw_buffer = NULL;
 
-	/* restore parameters */
-	edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold,
-				  tsdata->threshold);
-	edt_ft5x06_register_write(tsdata, reg_addr->reg_gain,
-				  tsdata->gain);
-	if (reg_addr->reg_offset != NO_REGISTER)
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset,
-					  tsdata->offset);
-	if (reg_addr->reg_offset_x != NO_REGISTER)
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x,
-					  tsdata->offset_x);
-	if (reg_addr->reg_offset_y != NO_REGISTER)
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y,
-					  tsdata->offset_y);
-	if (reg_addr->reg_report_rate != NO_REGISTER)
-		edt_ft5x06_register_write(tsdata, reg_addr->reg_report_rate,
-				  tsdata->report_rate);
-
+	edt_ft5x06_restore_reg_parameters(tsdata);
 	enable_irq(client->irq);
 
 	return 0;
-- 
2.20.1


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

* [PATCH 3/4] Input: edt-ft5x06 - improve power management operations
  2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
  2020-02-27 11:28 ` [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access Marco Felsch
  2020-02-27 11:28 ` [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper Marco Felsch
@ 2020-02-27 11:28 ` Marco Felsch
  2020-05-09 21:21   ` Dmitry Torokhov
  2020-02-27 11:28 ` [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe Marco Felsch
  2020-03-09  6:44 ` [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
  4 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-02-27 11:28 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: linux-input, kernel

It is possible to bring the device into a deep sleep state. To exit this
state the reset or wakeup pin must be toggeled as documented in [1].
Because of the poor documentation I used the several downstream kernels
[2] and other applications notes [3] to indentify the related registers.

Furthermore I added the support to disable the device completely which
is obviously the most effective power-saving mechanism. This mechanism
needs the reset pin to ensure the power-up/down sequence.

We can't apply any of these power-saving mechanism if both pins are
missing (not connected) or if it is a wakeup device.

[1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf
    https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x06.pdf
[2] https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/input/touchscreen/ft5x_ts.c
    https://github.com/Pablito2020/focaltech-touch-driver/blob/master/ft5336_driver.c
[3] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x16_registers.pdf

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
v4:
- improve suspend modi handling
- restore configuration if poweroff suspend mode was selected
- check return values during resume
- add comments about the delays
- adapt commit message

v3:
- drop enable/disable_irq_wake()

v2:
- adapt commit message
- don't return errors during suspend/resume
- replace dev_err() by dev_warn()
- add support to disable the regulator too

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

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index bb9107093796..0babe6a25fe3 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -38,6 +38,9 @@
 #define WORK_REGISTER_NUM_X		0x33
 #define WORK_REGISTER_NUM_Y		0x34
 
+#define PMOD_REGISTER_ACTIVE		0x00
+#define PMOD_REGISTER_HIBERNATE		0x03
+
 #define M09_REGISTER_THRESHOLD		0x80
 #define M09_REGISTER_GAIN		0x92
 #define M09_REGISTER_OFFSET		0x93
@@ -53,6 +56,7 @@
 
 #define WORK_REGISTER_OPMODE		0x3c
 #define FACTORY_REGISTER_OPMODE		0x01
+#define PMOD_REGISTER_OPMODE		0xa5
 
 #define TOUCH_EVENT_DOWN		0x00
 #define TOUCH_EVENT_UP			0x01
@@ -65,6 +69,12 @@
 #define EDT_RAW_DATA_RETRIES		100
 #define EDT_RAW_DATA_DELAY		1000 /* usec */
 
+enum edt_pmode {
+	EDT_PMODE_NOT_SUPPORTED,
+	EDT_PMODE_HIBERNATE,
+	EDT_PMODE_POWEROFF,
+};
+
 enum edt_ver {
 	EDT_M06,
 	EDT_M09,
@@ -103,6 +113,7 @@ struct edt_ft5x06_ts_data {
 
 	struct mutex mutex;
 	bool factory_mode;
+	enum edt_pmode suspend_mode;
 	int threshold;
 	int gain;
 	int offset;
@@ -1125,6 +1136,19 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		return error;
 	}
 
+	/*
+	 * Check which sleep modes we can support. Power-off requieres the
+	 * reset-pin to ensure correct power-down/power-up behaviour. Start with
+	 * the EDT_PMODE_POWEROFF test since this is the deepest possible sleep
+	 * mode.
+	 */
+	if (tsdata->reset_gpio)
+		tsdata->suspend_mode = EDT_PMODE_POWEROFF;
+	else if (tsdata->wake_gpio)
+		tsdata->suspend_mode = EDT_PMODE_HIBERNATE;
+	else
+		tsdata->suspend_mode = EDT_PMODE_NOT_SUPPORTED;
+
 	if (tsdata->wake_gpio) {
 		usleep_range(5000, 6000);
 		gpiod_set_value_cansleep(tsdata->wake_gpio, 1);
@@ -1238,6 +1262,104 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
 	return 0;
 }
 
+static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
+	struct gpio_desc *reset_gpio = tsdata->reset_gpio;
+	int ret;
+
+	if (device_may_wakeup(dev))
+		return 0;
+
+	if (tsdata->suspend_mode == EDT_PMODE_NOT_SUPPORTED)
+		return 0;
+
+	/* Enter hibernate mode. */
+	ret = edt_ft5x06_register_write(tsdata, PMOD_REGISTER_OPMODE,
+					PMOD_REGISTER_HIBERNATE);
+	if (ret)
+		dev_warn(dev, "Failed to set hibernate mode\n");
+
+	if (tsdata->suspend_mode == EDT_PMODE_HIBERNATE)
+		return 0;
+
+	/*
+	 * Power-off according the datasheet. Cut the power may leaf the irq
+	 * line in an undefined state depending on the host pull resistor
+	 * settings. Disable the irq to avoid adjusting each host till the
+	 * device is back in a full functional state.
+	 */
+	disable_irq(tsdata->client->irq);
+
+	gpiod_set_value_cansleep(reset_gpio, 1);
+	usleep_range(1000, 2000);
+
+	ret = regulator_disable(tsdata->vcc);
+	if (ret)
+		dev_warn(dev, "Failed to disable vcc\n");
+
+	return 0;
+}
+
+static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
+	int ret = 0;
+
+	if (device_may_wakeup(dev))
+		return 0;
+
+	if (tsdata->suspend_mode == EDT_PMODE_NOT_SUPPORTED)
+		return 0;
+
+	if (tsdata->suspend_mode == EDT_PMODE_POWEROFF) {
+		struct gpio_desc *reset_gpio = tsdata->reset_gpio;
+
+		/*
+		 * We can't check if the regulator is a dummy or a real
+		 * regulator. So we need to specify the 5ms reset time (T_rst)
+		 * here instead of the 100us T_rtp time. We also need to wait
+		 * 300ms in case it was a real supply and the power was cutted
+		 * of. Toggle the reset pin is also a way to exit the hibernate
+		 * mode.
+		 */
+		gpiod_set_value_cansleep(reset_gpio, 1);
+		usleep_range(5000, 6000);
+
+		ret = regulator_enable(tsdata->vcc);
+		if (ret) {
+			dev_err(dev, "Failed to enable vcc\n");
+			return ret;
+		}
+
+		usleep_range(1000, 2000);
+		gpiod_set_value_cansleep(reset_gpio, 0);
+		msleep(300);
+
+		edt_ft5x06_restore_reg_parameters(tsdata);
+		enable_irq(tsdata->client->irq);
+
+#ifdef CONFIG_DEBUG_FS
+		if (tsdata->factory_mode)
+			ret = edt_ft5x06_factory_mode(tsdata);
+#endif
+	} else {
+		struct gpio_desc *wake_gpio = tsdata->wake_gpio;
+
+		gpiod_set_value_cansleep(wake_gpio, 0);
+		usleep_range(5000, 6000);
+		gpiod_set_value_cansleep(wake_gpio, 1);
+	}
+
+
+	return ret;
+}
+
+static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops,
+			 edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume);
+
 static const struct edt_i2c_chip_data edt_ft5x06_data = {
 	.max_support_points = 5,
 };
@@ -1276,6 +1398,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
 	.driver = {
 		.name = "edt_ft5x06",
 		.of_match_table = edt_ft5x06_of_match,
+		.pm = &edt_ft5x06_ts_pm_ops,
 	},
 	.id_table = edt_ft5x06_ts_id,
 	.probe    = edt_ft5x06_ts_probe,
-- 
2.20.1


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

* [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe
  2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
                   ` (2 preceding siblings ...)
  2020-02-27 11:28 ` [PATCH 3/4] Input: edt-ft5x06 - improve power management operations Marco Felsch
@ 2020-02-27 11:28 ` Marco Felsch
  2020-05-09 21:28   ` Dmitry Torokhov
  2020-03-09  6:44 ` [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
  4 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-02-27 11:28 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW
  Cc: linux-input, kernel, Ahmad Fatoum

From: Ahmad Fatoum <a.fatoum@pengutronix.de>

Probing the device takes a while, because we sleep for 300 ms after a
reset; allow asynchronous probing so this can happen in the background
while other devices are being probed.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/input/touchscreen/edt-ft5x06.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 0babe6a25fe3..b7f2aee30943 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1399,6 +1399,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
 		.name = "edt_ft5x06",
 		.of_match_table = edt_ft5x06_of_match,
 		.pm = &edt_ft5x06_ts_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.id_table = edt_ft5x06_ts_id,
 	.probe    = edt_ft5x06_ts_probe,
-- 
2.20.1


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

* Re: [PATCH 0/4] EDT-FT5x06 Fixes and improvments
  2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
                   ` (3 preceding siblings ...)
  2020-02-27 11:28 ` [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe Marco Felsch
@ 2020-03-09  6:44 ` Marco Felsch
  2020-03-31  7:50   ` Marco Felsch
  4 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-03-09  6:44 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: kernel, linux-input

Hi,

gentle ping.

Regards,
  Marco

On 20-02-27 12:28, Marco Felsch wrote:
> Hi,
> 
> first this series fixes a possible undefined register access for
> ev-ft5726 devices.
> 
> This series also includes the v4 of the improved pm ops. Please check
> my notes I made on the patch.
> 
> Last but least it adds the support for async probe which is important
> for fast booting because devices having a reset-pin specified sleeps
> 300ms..
> 
> Regards,
>   Marco
> 
> Ahmad Fatoum (1):
>   Input: edt-ft5x06 - prefer asynchronous probe
> 
> Marco Felsch (3):
>   Input: edt-ft5x06 - fix get_default register write access
>   Input: edt-ft5x06 - move parameter restore into helper
>   Input: edt-ft5x06 - improve power management operations
> 
>  drivers/input/touchscreen/edt-ft5x06.c | 179 ++++++++++++++++++++++---
>  1 file changed, 157 insertions(+), 22 deletions(-)
> 
> -- 
> 2.20.1

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

* Re: [PATCH 0/4] EDT-FT5x06 Fixes and improvments
  2020-03-09  6:44 ` [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
@ 2020-03-31  7:50   ` Marco Felsch
  2020-05-08  8:22     ` Marco Felsch
  0 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-03-31  7:50 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: kernel, linux-input

Hi Dmitry,

gentle ping..

On 20-03-09 07:44, Marco Felsch wrote:
> Hi,
> 
> gentle ping.
> 
> Regards,
>   Marco
> 
> On 20-02-27 12:28, Marco Felsch wrote:
> > Hi,
> > 
> > first this series fixes a possible undefined register access for
> > ev-ft5726 devices.
> > 
> > This series also includes the v4 of the improved pm ops. Please check
> > my notes I made on the patch.
> > 
> > Last but least it adds the support for async probe which is important
> > for fast booting because devices having a reset-pin specified sleeps
> > 300ms..
> > 
> > Regards,
> >   Marco
> > 
> > Ahmad Fatoum (1):
> >   Input: edt-ft5x06 - prefer asynchronous probe
> > 
> > Marco Felsch (3):
> >   Input: edt-ft5x06 - fix get_default register write access
> >   Input: edt-ft5x06 - move parameter restore into helper
> >   Input: edt-ft5x06 - improve power management operations
> > 
> >  drivers/input/touchscreen/edt-ft5x06.c | 179 ++++++++++++++++++++++---
> >  1 file changed, 157 insertions(+), 22 deletions(-)
> > 
> > -- 
> > 2.20.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 0/4] EDT-FT5x06 Fixes and improvments
  2020-03-31  7:50   ` Marco Felsch
@ 2020-05-08  8:22     ` Marco Felsch
  0 siblings, 0 replies; 15+ messages in thread
From: Marco Felsch @ 2020-05-08  8:22 UTC (permalink / raw)
  To: dmitry.torokhov, andriy.shevchenko, hdegoede, LW; +Cc: kernel, linux-input

Hi Dmitry,

pls can you have a look on it?

Thanks,
  Marco

On 20-03-31 09:50, Marco Felsch wrote:
> Hi Dmitry,
> 
> gentle ping..
> 
> On 20-03-09 07:44, Marco Felsch wrote:
> > Hi,
> > 
> > gentle ping.
> > 
> > Regards,
> >   Marco
> > 
> > On 20-02-27 12:28, Marco Felsch wrote:
> > > Hi,
> > > 
> > > first this series fixes a possible undefined register access for
> > > ev-ft5726 devices.
> > > 
> > > This series also includes the v4 of the improved pm ops. Please check
> > > my notes I made on the patch.
> > > 
> > > Last but least it adds the support for async probe which is important
> > > for fast booting because devices having a reset-pin specified sleeps
> > > 300ms..
> > > 
> > > Regards,
> > >   Marco
> > > 
> > > Ahmad Fatoum (1):
> > >   Input: edt-ft5x06 - prefer asynchronous probe
> > > 
> > > Marco Felsch (3):
> > >   Input: edt-ft5x06 - fix get_default register write access
> > >   Input: edt-ft5x06 - move parameter restore into helper
> > >   Input: edt-ft5x06 - improve power management operations
> > > 
> > >  drivers/input/touchscreen/edt-ft5x06.c | 179 ++++++++++++++++++++++---
> > >  1 file changed, 157 insertions(+), 22 deletions(-)
> > > 
> > > -- 
> > > 2.20.1
> > 
> > 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access
  2020-02-27 11:28 ` [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access Marco Felsch
@ 2020-05-09 19:05   ` Dmitry Torokhov
  2020-05-10 11:06     ` Marco Felsch
  0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Torokhov @ 2020-05-09 19:05 UTC (permalink / raw)
  To: Marco Felsch; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

Hi Macro,

On Thu, Feb 27, 2020 at 12:28:16PM +0100, Marco Felsch wrote:
> Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
> ev-ft5726") offset-x and offset-y is supported. Devices using those
> offset parameters don't support the offset parameter so we need to add
> the NO_REGISTER check for edt_ft5x06_ts_get_defaults().
> 
> Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

I'll apply this, but I wonder if we should not move this check into
edt_ft5x06_register_write(), and also have edt_ft5x06_register_read()
return error if address is "NO_REGISTER"?

Thanks.

-- 
Dmitry

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

* Re: [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper
  2020-02-27 11:28 ` [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper Marco Felsch
@ 2020-05-09 19:06   ` Dmitry Torokhov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2020-05-09 19:06 UTC (permalink / raw)
  To: Marco Felsch; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

On Thu, Feb 27, 2020 at 12:28:17PM +0100, Marco Felsch wrote:
> We need to restore the parameters if we switch between the
> factory/work mode and during the resume process if we switched off the
> power-supply. Therefore refactor edt_ft5x06_work_mode() and move the
> "restore the parameters" into a helper routine so we can reuse it later.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Applied, thank you.

-- 
Dmitry

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

* Re: [PATCH 3/4] Input: edt-ft5x06 - improve power management operations
  2020-02-27 11:28 ` [PATCH 3/4] Input: edt-ft5x06 - improve power management operations Marco Felsch
@ 2020-05-09 21:21   ` Dmitry Torokhov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2020-05-09 21:21 UTC (permalink / raw)
  To: Marco Felsch; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

Hi Marco,

On Thu, Feb 27, 2020 at 12:28:18PM +0100, Marco Felsch wrote:
> +
> +#ifdef CONFIG_DEBUG_FS
> +		if (tsdata->factory_mode)
> +			ret = edt_ft5x06_factory_mode(tsdata);
> +#endif

Instead of #ifdefs I added a stub for edt_ft5x06_factory_mode() and
applied.

Thank you.

-- 
Dmitry

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

* Re: [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe
  2020-02-27 11:28 ` [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe Marco Felsch
@ 2020-05-09 21:28   ` Dmitry Torokhov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2020-05-09 21:28 UTC (permalink / raw)
  To: Marco Felsch
  Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel, Ahmad Fatoum

On Thu, Feb 27, 2020 at 12:28:19PM +0100, Marco Felsch wrote:
> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
> 
> Probing the device takes a while, because we sleep for 300 ms after a
> reset; allow asynchronous probing so this can happen in the background
> while other devices are being probed.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Applied, thank you.

-- 
Dmitry

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

* Re: [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access
  2020-05-09 19:05   ` Dmitry Torokhov
@ 2020-05-10 11:06     ` Marco Felsch
  2020-05-11 17:53       ` Dmitry Torokhov
  0 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2020-05-10 11:06 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

Hi Dmitry,

On 20-05-09 12:05, Dmitry Torokhov wrote:
> Hi Macro,
> 
> On Thu, Feb 27, 2020 at 12:28:16PM +0100, Marco Felsch wrote:
> > Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
> > ev-ft5726") offset-x and offset-y is supported. Devices using those
> > offset parameters don't support the offset parameter so we need to add
> > the NO_REGISTER check for edt_ft5x06_ts_get_defaults().
> > 
> > Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> 
> I'll apply this, but I wonder if we should not move this check into
> edt_ft5x06_register_write(), and also have edt_ft5x06_register_read()
> return error if address is "NO_REGISTER"?

I tought so too but I wanted to keep the fix small and backportable.

Regards,
  Marco

> Thanks.
> 
> -- 
> Dmitry
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access
  2020-05-10 11:06     ` Marco Felsch
@ 2020-05-11 17:53       ` Dmitry Torokhov
  2020-05-12 17:01         ` Marco Felsch
  0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Torokhov @ 2020-05-11 17:53 UTC (permalink / raw)
  To: Marco Felsch; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

On Sun, May 10, 2020 at 01:06:44PM +0200, Marco Felsch wrote:
> Hi Dmitry,
> 
> On 20-05-09 12:05, Dmitry Torokhov wrote:
> > Hi Macro,
> > 
> > On Thu, Feb 27, 2020 at 12:28:16PM +0100, Marco Felsch wrote:
> > > Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
> > > ev-ft5726") offset-x and offset-y is supported. Devices using those
> > > offset parameters don't support the offset parameter so we need to add
> > > the NO_REGISTER check for edt_ft5x06_ts_get_defaults().
> > > 
> > > Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
> > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > 
> > I'll apply this, but I wonder if we should not move this check into
> > edt_ft5x06_register_write(), and also have edt_ft5x06_register_read()
> > return error if address is "NO_REGISTER"?
> 
> I tought so too but I wanted to keep the fix small and backportable.

Any chance you can make a follow-up patch so that going forward it is
cleaner (and the fix can still be backported if needed)?

Thanks.

-- 
Dmitry

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

* Re: [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access
  2020-05-11 17:53       ` Dmitry Torokhov
@ 2020-05-12 17:01         ` Marco Felsch
  0 siblings, 0 replies; 15+ messages in thread
From: Marco Felsch @ 2020-05-12 17:01 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: andriy.shevchenko, hdegoede, LW, linux-input, kernel

On 20-05-11 10:53, Dmitry Torokhov wrote:
> On Sun, May 10, 2020 at 01:06:44PM +0200, Marco Felsch wrote:
> > Hi Dmitry,
> > 
> > On 20-05-09 12:05, Dmitry Torokhov wrote:
> > > Hi Macro,
> > > 
> > > On Thu, Feb 27, 2020 at 12:28:16PM +0100, Marco Felsch wrote:
> > > > Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
> > > > ev-ft5726") offset-x and offset-y is supported. Devices using those
> > > > offset parameters don't support the offset parameter so we need to add
> > > > the NO_REGISTER check for edt_ft5x06_ts_get_defaults().
> > > > 
> > > > Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
> > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > > 
> > > I'll apply this, but I wonder if we should not move this check into
> > > edt_ft5x06_register_write(), and also have edt_ft5x06_register_read()
> > > return error if address is "NO_REGISTER"?
> > 
> > I tought so too but I wanted to keep the fix small and backportable.
> 
> Any chance you can make a follow-up patch so that going forward it is
> cleaner (and the fix can still be backported if needed)?

Of course I will prepare a fix.

Regards,
  Marco

> Thanks.
> 

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

end of thread, back to index

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 11:28 [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
2020-02-27 11:28 ` [PATCH 1/4] Input: edt-ft5x06 - fix get_default register write access Marco Felsch
2020-05-09 19:05   ` Dmitry Torokhov
2020-05-10 11:06     ` Marco Felsch
2020-05-11 17:53       ` Dmitry Torokhov
2020-05-12 17:01         ` Marco Felsch
2020-02-27 11:28 ` [PATCH 2/4] Input: edt-ft5x06 - move parameter restore into helper Marco Felsch
2020-05-09 19:06   ` Dmitry Torokhov
2020-02-27 11:28 ` [PATCH 3/4] Input: edt-ft5x06 - improve power management operations Marco Felsch
2020-05-09 21:21   ` Dmitry Torokhov
2020-02-27 11:28 ` [PATCH 4/4] Input: edt-ft5x06 - prefer asynchronous probe Marco Felsch
2020-05-09 21:28   ` Dmitry Torokhov
2020-03-09  6:44 ` [PATCH 0/4] EDT-FT5x06 Fixes and improvments Marco Felsch
2020-03-31  7:50   ` Marco Felsch
2020-05-08  8:22     ` Marco Felsch

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git