Hi, On 19-11-27 16:32, Andy Shevchenko wrote: > On Wed, Nov 27, 2019 at 02:06:02PM +0100, Marco Felsch wrote: > > On 19-11-27 14:59, Andy Shevchenko wrote: > > > On Wed, Nov 27, 2019 at 01:09:48PM +0100, Marco Felsch wrote: > > > > 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. > > > How about this: > static void edt_ft5x06_ts_toggle_gpio(struct gpio_desc *gpiod, int value) > { > gpiod_...(..., !value); > ... > gpiod_...(..., value); > ... > } > > ...resume(...) > { > ... > if (wake_gpio) > ...toggle_gpio(wake_gpio, 1); > else if (reset_gpio) > ...toggle_gpio(reset_gpio, 0); > ... > } > > ? That's possible.. Don't see the improvement yet, but I can prepare a folllow-up patch if Dmitry wants. 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 |