* [PATCH 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable @ 2018-05-16 12:28 Daniel Mack 2018-05-16 12:28 ` [PATCH 1/3] " Daniel Mack ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Daniel Mack @ 2018-05-16 12:28 UTC (permalink / raw) To: dmitry.torokhov, robh+dt, mark.rutland, shawnguo, kernel, fabio.estevam Cc: devicetree, Daniel Mack, linux-arm-kernel, linux-input Hi, I have a platform that features an edt-ft5x06 touch panel and that doesn't want to wake on touch screen activity. Here's a trivial series of patches that make the edt-ft5x06 driver only act as wakeup source when requested through device properties or DTS. The third patch changes the default in two DTS files that use this driver. I guess the first two patches should go through the input tree, while the third can be picked by the IMX people. There are no compile-time dependencies, so the order doesn't matter. Thanks, Daniel Daniel Mack (3): input: touchscreen: edt-ft5x06: make wakeup source behavior configurable input: touchscreen: edt-ft5x06: assert reset during suspend ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source .../devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 3 +++ arch/arm/boot/dts/imx28-tx28.dts | 1 + arch/arm/boot/dts/imx53-tx53-x03x.dts | 1 + drivers/input/touchscreen/edt-ft5x06.c | 9 ++++++++- 4 files changed, 13 insertions(+), 1 deletion(-) -- 2.14.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable 2018-05-16 12:28 [PATCH 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable Daniel Mack @ 2018-05-16 12:28 ` Daniel Mack 2018-05-16 17:03 ` Dmitry Torokhov 2018-05-16 12:28 ` [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend Daniel Mack 2018-05-16 12:28 ` [PATCH 3/3] ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source Daniel Mack 2 siblings, 1 reply; 7+ messages in thread From: Daniel Mack @ 2018-05-16 12:28 UTC (permalink / raw) To: dmitry.torokhov, robh+dt, mark.rutland, shawnguo, kernel, fabio.estevam Cc: devicetree, Daniel Mack, linux-arm-kernel, linux-input Allow configuring the device as wakeup source through device properties, as not all platforms want to wake up on touch screen activity. Note that by default, the device will now no longer be a wakeup source. Signed-off-by: Daniel Mack <daniel@zonque.org> --- Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 3 +++ drivers/input/touchscreen/edt-ft5x06.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt index 025cf8c9324a..83f792d4d88c 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt @@ -52,6 +52,8 @@ Optional properties: - touchscreen-inverted-y : See touchscreen.txt - touchscreen-swapped-x-y : See touchscreen.txt + - wakeup-source: touchscreen acts as wakeup source + Example: polytouch: edt-ft5x06@38 { compatible = "edt,edt-ft5406", "edt,edt-ft5x06"; @@ -62,4 +64,5 @@ Example: interrupts = <5 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; + wakeup-source; }; diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 5bf63f76ddda..955f085627fa 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1007,7 +1007,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, goto err_remove_attrs; edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); - device_init_wakeup(&client->dev, 1); + device_init_wakeup(&client->dev, + device_property_read_bool(dev, "wakeup-source")); dev_dbg(&client->dev, "EDT FT5x06 initialized: IRQ %d, WAKE pin %d, Reset pin %d.\n", -- 2.14.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable 2018-05-16 12:28 ` [PATCH 1/3] " Daniel Mack @ 2018-05-16 17:03 ` Dmitry Torokhov 2018-05-17 8:48 ` Daniel Mack 0 siblings, 1 reply; 7+ messages in thread From: Dmitry Torokhov @ 2018-05-16 17:03 UTC (permalink / raw) To: Daniel Mack Cc: mark.rutland, devicetree, robh+dt, kernel, linux-input, fabio.estevam, shawnguo, linux-arm-kernel Hi Daniel, On Wed, May 16, 2018 at 02:28:27PM +0200, Daniel Mack wrote: > Allow configuring the device as wakeup source through device properties, as > not all platforms want to wake up on touch screen activity. > > Note that by default, the device will now no longer be a wakeup source. > > Signed-off-by: Daniel Mack <daniel@zonque.org> > --- > Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 3 +++ > drivers/input/touchscreen/edt-ft5x06.c | 3 ++- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt > index 025cf8c9324a..83f792d4d88c 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt > +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt > @@ -52,6 +52,8 @@ Optional properties: > - touchscreen-inverted-y : See touchscreen.txt > - touchscreen-swapped-x-y : See touchscreen.txt > > + - wakeup-source: touchscreen acts as wakeup source > + > Example: > polytouch: edt-ft5x06@38 { > compatible = "edt,edt-ft5406", "edt,edt-ft5x06"; > @@ -62,4 +64,5 @@ Example: > interrupts = <5 IRQ_TYPE_EDGE_FALLING>; > reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; > wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; > + wakeup-source; > }; > diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c > index 5bf63f76ddda..955f085627fa 100644 > --- a/drivers/input/touchscreen/edt-ft5x06.c > +++ b/drivers/input/touchscreen/edt-ft5x06.c > @@ -1007,7 +1007,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, > goto err_remove_attrs; > > edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); > - device_init_wakeup(&client->dev, 1); > + device_init_wakeup(&client->dev, > + device_property_read_bool(dev, "wakeup-source")); I think we should actually drop device_init_wakeup() call. I2C core already handles "wakeup-source" property (for OF). The static board files can instantiate clients with I2C_CLIENT_WAKE, so that's handled too, and I think ACPI has its own notion of annotating wakeup sources. > > dev_dbg(&client->dev, > "EDT FT5x06 initialized: IRQ %d, WAKE pin %d, Reset pin %d.\n", > -- > 2.14.3 > Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable 2018-05-16 17:03 ` Dmitry Torokhov @ 2018-05-17 8:48 ` Daniel Mack 0 siblings, 0 replies; 7+ messages in thread From: Daniel Mack @ 2018-05-17 8:48 UTC (permalink / raw) To: Dmitry Torokhov Cc: mark.rutland, devicetree, robh+dt, kernel, linux-input, fabio.estevam, shawnguo, linux-arm-kernel Hi Dmitry, On Wednesday, May 16, 2018 07:03 PM, Dmitry Torokhov wrote: >> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c >> index 5bf63f76ddda..955f085627fa 100644 >> --- a/drivers/input/touchscreen/edt-ft5x06.c >> +++ b/drivers/input/touchscreen/edt-ft5x06.c >> @@ -1007,7 +1007,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, >> goto err_remove_attrs; >> >> edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); >> - device_init_wakeup(&client->dev, 1); >> + device_init_wakeup(&client->dev, >> + device_property_read_bool(dev, "wakeup-source")); > > I think we should actually drop device_init_wakeup() call. I2C core > already handles "wakeup-source" property (for OF). The static board > files can instantiate clients with I2C_CLIENT_WAKE, so that's handled > too, and I think ACPI has its own notion of annotating wakeup sources. Ah, right! Thanks, will respin :) Daniel ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend 2018-05-16 12:28 [PATCH 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable Daniel Mack 2018-05-16 12:28 ` [PATCH 1/3] " Daniel Mack @ 2018-05-16 12:28 ` Daniel Mack 2018-05-16 17:05 ` Dmitry Torokhov 2018-05-16 12:28 ` [PATCH 3/3] ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source Daniel Mack 2 siblings, 1 reply; 7+ messages in thread From: Daniel Mack @ 2018-05-16 12:28 UTC (permalink / raw) To: dmitry.torokhov, robh+dt, mark.rutland, shawnguo, kernel, fabio.estevam Cc: devicetree, Daniel Mack, linux-arm-kernel, linux-input If the device is not configured as wakeup source, it can be put in reset during suspend to save some power. Signed-off-by: Daniel Mack <daniel@zonque.org> --- drivers/input/touchscreen/edt-ft5x06.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 955f085627fa..c34a0b23f90a 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1036,9 +1036,12 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client) 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); if (device_may_wakeup(dev)) enable_irq_wake(client->irq); + else if (tsdata->reset_gpio) + gpiod_set_value_cansleep(tsdata->reset_gpio, 1); return 0; } @@ -1046,9 +1049,12 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) 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); if (device_may_wakeup(dev)) disable_irq_wake(client->irq); + else if (tsdata->reset_gpio) + gpiod_set_value_cansleep(tsdata->reset_gpio, 0); return 0; } -- 2.14.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend 2018-05-16 12:28 ` [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend Daniel Mack @ 2018-05-16 17:05 ` Dmitry Torokhov 0 siblings, 0 replies; 7+ messages in thread From: Dmitry Torokhov @ 2018-05-16 17:05 UTC (permalink / raw) To: Daniel Mack Cc: mark.rutland, devicetree, robh+dt, kernel, linux-input, fabio.estevam, shawnguo, linux-arm-kernel On Wed, May 16, 2018 at 02:28:28PM +0200, Daniel Mack wrote: > If the device is not configured as wakeup source, it can be put in reset > during suspend to save some power. > > Signed-off-by: Daniel Mack <daniel@zonque.org> > --- > drivers/input/touchscreen/edt-ft5x06.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c > index 955f085627fa..c34a0b23f90a 100644 > --- a/drivers/input/touchscreen/edt-ft5x06.c > +++ b/drivers/input/touchscreen/edt-ft5x06.c > @@ -1036,9 +1036,12 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client) > 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); > > if (device_may_wakeup(dev)) > enable_irq_wake(client->irq); > + else if (tsdata->reset_gpio) > + gpiod_set_value_cansleep(tsdata->reset_gpio, 1); > > return 0; > } > @@ -1046,9 +1049,12 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) > 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); > > if (device_may_wakeup(dev)) > disable_irq_wake(client->irq); > + else if (tsdata->reset_gpio) > + gpiod_set_value_cansleep(tsdata->reset_gpio, 0); I think you need msleep() here as the chip needs a bit to get out of reset before it is ready. FWIW we have 300 ms delay in probe(). Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source 2018-05-16 12:28 [PATCH 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable Daniel Mack 2018-05-16 12:28 ` [PATCH 1/3] " Daniel Mack 2018-05-16 12:28 ` [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend Daniel Mack @ 2018-05-16 12:28 ` Daniel Mack 2 siblings, 0 replies; 7+ messages in thread From: Daniel Mack @ 2018-05-16 12:28 UTC (permalink / raw) To: dmitry.torokhov, robh+dt, mark.rutland, shawnguo, kernel, fabio.estevam Cc: devicetree, Daniel Mack, linux-arm-kernel, linux-input The touchscreen driver no longer configures the device as wakeup source by default. A "wakeup-source" property is needed. To avoid regressions, this patch changes the DTS files for the only two users of this driver that didn't have this property yet. Signed-off-by: Daniel Mack <daniel@zonque.org> --- arch/arm/boot/dts/imx28-tx28.dts | 1 + arch/arm/boot/dts/imx53-tx53-x03x.dts | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts index 0ebbc83852d0..094a39a67ec8 100644 --- a/arch/arm/boot/dts/imx28-tx28.dts +++ b/arch/arm/boot/dts/imx28-tx28.dts @@ -328,6 +328,7 @@ interrupts = <5 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; + wakeup-source; }; touchscreen: tsc2007@48 { diff --git a/arch/arm/boot/dts/imx53-tx53-x03x.dts b/arch/arm/boot/dts/imx53-tx53-x03x.dts index 0ecb43d88522..dbf0d73dc7b9 100644 --- a/arch/arm/boot/dts/imx53-tx53-x03x.dts +++ b/arch/arm/boot/dts/imx53-tx53-x03x.dts @@ -220,6 +220,7 @@ interrupts = <15 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>; + wakeup-source; }; touchscreen: tsc2007@48 { -- 2.14.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-05-17 8:48 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-05-16 12:28 [PATCH 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable Daniel Mack 2018-05-16 12:28 ` [PATCH 1/3] " Daniel Mack 2018-05-16 17:03 ` Dmitry Torokhov 2018-05-17 8:48 ` Daniel Mack 2018-05-16 12:28 ` [PATCH 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend Daniel Mack 2018-05-16 17:05 ` Dmitry Torokhov 2018-05-16 12:28 ` [PATCH 3/3] ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source Daniel Mack
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).