linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: robh+dt@kernel.org, dmitry.torokhov@gmail.com, bparrot@ti.com,
	simon.budig@kernelconcepts.de, hdegoede@redhat.com,
	fcooper@ti.com, mripard@kernel.org,
	alexandre.belloni@bootlin.com, shawnguo@kernel.org,
	devicetree@vger.kernel.org, kernel@pengutronix.de,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2 5/5] Input: edt-ft5x06 - improve power management operations
Date: Wed, 27 Nov 2019 14:06:02 +0100	[thread overview]
Message-ID: <20191127130602.5zp537xdybbafnci@pengutronix.de> (raw)
In-Reply-To: <20191127125932.GK32742@smile.fi.intel.com>

Hi Andy,

On 19-11-27 14:59, Andy Shevchenko wrote:
> On Wed, Nov 27, 2019 at 01:09:48PM +0100, Marco Felsch wrote:
> > 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. This is
> > the most effective power-saving mechanism. Disabling the device don't
> > change the suspend logic because the hibernate mode needs a hardware
> > reset anyway.
> > 
> > [1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.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
> 
> 
> > +	/* Recover from hibernate mode if hardware supports it */
> > +	if (tsdata->wake_gpio) {
> > +		gpiod_set_value_cansleep(tsdata->wake_gpio, 0);
> > +		usleep_range(5000, 6000);
> > +		gpiod_set_value_cansleep(tsdata->wake_gpio, 1);
> > +		msleep(300);
> > +	} else if (tsdata->reset_gpio) {
> > +		gpiod_set_value_cansleep(tsdata->reset_gpio, 1);
> > +		usleep_range(5000, 6000);
> > +		gpiod_set_value_cansleep(tsdata->reset_gpio, 0);
> > +		msleep(300);
> > +	}
> 
> Perhaps
> 
> static void edt_ft5x06_ts_toggle_gpio(struct gpio_desc *gpiod)
> {
> 	...
> }
> 
> ...resume(...)
> {
> 	...
> 	if (wake_gpio)
> 		...toggle_gpio(wake_gpio);
> 	else if (reset_gpio)
> 		...toggle_gpio(reset_gpio);
> 	...
> }
> 
> ?

Thanks fpr your suggestion but we need to differentiate between reset
and wake logic level. The wake-gpio keeps asserted while the reset is
released. So the edt_ft5x06_ts_toggle_gpio() needs at least a 'is_reset'
parameter but then the simplification is gone.

Regards,
  Marco

> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 
> 

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

  reply	other threads:[~2019-11-27 13:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 12:09 [PATCH v2 0/5] EDT-FT5x06 improvements Marco Felsch
2019-11-27 12:09 ` [PATCH v2 1/5] Input: edt-ft5x06: work around first register access error Marco Felsch
2019-12-02 17:58   ` Dmitry Torokhov
2019-12-03  8:15     ` Marco Felsch
2019-11-27 12:09 ` [PATCH v2 2/5] Input: edt-ft5x06 - alphabetical include reorder Marco Felsch
2019-11-27 12:09 ` [PATCH v2 3/5] dt-bindings: Input: edt-ft5x06 - document wakeup-source capability Marco Felsch
2019-12-05 21:15   ` Rob Herring
2019-11-27 12:09 ` [PATCH v2 4/5] Input: edt-ft5x06 - make wakeup-source switchable Marco Felsch
2019-12-02 18:00   ` Dmitry Torokhov
2019-12-10  8:36     ` Marco Felsch
2019-11-27 12:09 ` [PATCH v2 5/5] Input: edt-ft5x06 - improve power management operations Marco Felsch
2019-11-27 12:59   ` Andy Shevchenko
2019-11-27 13:06     ` Marco Felsch [this message]
2019-11-27 14:32       ` Andy Shevchenko
2019-11-27 17:25         ` Marco Felsch
2019-11-27 18:06           ` Andy Shevchenko
2019-12-02 18:04   ` Dmitry Torokhov
2019-12-10  8:43     ` Marco Felsch
2019-11-27 17:10 ` [PATCH v2 0/5] EDT-FT5x06 improvements Andy Shevchenko
2019-11-27 17:14 ` Andy Shevchenko
2019-11-27 17:25   ` Marco Felsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127130602.5zp537xdybbafnci@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bparrot@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fcooper@ti.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=simon.budig@kernelconcepts.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).