Thread (16 messages) flat view 16 messages, 2 authors, 2021-06-06

Re: [PATCH 7/7] Input: cy8ctmg110_ts - switch to using gpiod API

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2021-06-06 04:09:24
Also in: lkml

On Fri, Jun 04, 2021 at 09:38:04AM +0200, Linus Walleij wrote:
On Thu, Jun 3, 2021 at 6:37 AM Dmitry Torokhov
[off-list ref] wrote:
quoted
Instead of legacy gpio API let's use newer gpiod API. This also allows us
to get rid of platform data.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <redacted>
quoted
 static void cy8ctmg110_power(struct cy8ctmg110 *ts, bool poweron)
 {
-       if (ts->reset_pin)
-               gpio_direction_output(ts->reset_pin, 1 - poweron);
+       if (ts->reset_gpio)
+               gpiod_set_value_cansleep(ts->reset_gpio, !poweron);
I would perhaps drop in a comment that this de-asserts the RESET
line when we power on and asserts it when we power off.
quoted
+       ts->reset_gpio = devm_gpiod_get_optional(&client->dev, NULL,
+                                                GPIOD_OUT_HIGH);
And here that this will assert RESET.
Good idea, added and applied.

Thank you Linus.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help