From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Sander Vermin <sander-wENMetUwf8VmR6Xm/wNWPw@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH 4/7] touchscreen: pixcir_i2c: Add support for wake and enable gpios
Date: Fri, 20 Nov 2015 09:27:25 -0800 [thread overview]
Message-ID: <20151120172725.GA26895@dtor-ws> (raw)
In-Reply-To: <1448018233-27824-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Nov 20, 2015 at 12:17:10PM +0100, Hans de Goede wrote:
> From: Sander Vermin <sander-wENMetUwf8VmR6Xm/wNWPw@public.gmane.org>
>
> On some devices the wake and enable pins of the pixcir touchscreen
> controller are connected to gpios and these must be controlled by the
> driver for the device to operate properly.
>
> Signed-off-by: Sander Vermin <sander-wENMetUwf8VmR6Xm/wNWPw@public.gmane.org>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> Changes in v2 (Hans de Goede):
> -Split the changes for dealing with inverted / swapped axis out into a
> separate patch
> -Remove a bunch of dev_info calls to make the driver less chatty
> -Use devm_gpiod_get_optional as these new gpios are optional
> -Only msleep after setting enable high if we have an enable pin
> ---
> .../bindings/input/touchscreen/pixcir_i2c_ts.txt | 2 +
> drivers/input/touchscreen/pixcir_i2c_ts.c | 46 ++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/pixcir_i2c_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/pixcir_i2c_ts.txt
> index 8eb240a..72ca5ec 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/pixcir_i2c_ts.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/pixcir_i2c_ts.txt
> @@ -10,6 +10,8 @@ Required properties:
>
> Optional properties:
> - reset-gpio: GPIO connected to the RESET line of the chip
> +- enable-gpios: GPIO connected to the ENABLE line of the chip
> +- wake-gpios: GPIO connected to the WAKE line of the chip
>
> Example:
>
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index 211408c..b75ef65 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -38,6 +38,8 @@ struct pixcir_i2c_ts_data {
> struct input_dev *input;
> struct gpio_desc *gpio_attb;
> struct gpio_desc *gpio_reset;
> + struct gpio_desc *gpio_enable;
> + struct gpio_desc *gpio_wake;
> const struct pixcir_i2c_chip_data *chip;
> int max_fingers; /* Max fingers supported in this instance */
> bool running;
> @@ -208,6 +210,11 @@ static int pixcir_set_power_mode(struct pixcir_i2c_ts_data *ts,
> struct device *dev = &ts->client->dev;
> int ret;
>
> + if (mode == PIXCIR_POWER_ACTIVE || mode == PIXCIR_POWER_IDLE) {
> + if (!IS_ERR_OR_NULL(ts->gpio_wake))
> + gpiod_set_value_cansleep(ts->gpio_wake, 1);
I believe you error out in case when IS_ERR(ts->gpio_wake) is true, so I
wonder if we should simply use
if (ts->gpio_wake)
gpiod_set_value_cansleep(ts->gpio_wake, 1);
here and elsewhere.
No need to resubmit, just let me know.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2015-11-20 17:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 11:17 [PATCH 0/7] Various touchscreens: Support axis inversion / swapping / extra gpios Hans de Goede
2015-11-20 11:17 ` [PATCH 1/7] of_touchscreen-helpers: Add support for inverted / swapped axis Hans de Goede
[not found] ` <1448018233-27824-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-20 11:17 ` [PATCH 2/7] touchscreen: ft5x06: Add support for axis inversion / swapping Hans de Goede
2015-11-20 11:17 ` [PATCH 3/7] touchscreen: icn8318: Use parse_properties and apply_prop_to_x_y helpers Hans de Goede
2015-11-20 11:17 ` [PATCH 4/7] touchscreen: pixcir_i2c: Add support for wake and enable gpios Hans de Goede
2015-11-20 14:43 ` Rob Herring
[not found] ` <1448018233-27824-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-20 17:27 ` Dmitry Torokhov [this message]
2015-11-20 18:22 ` [linux-sunxi] " Hans de Goede
2015-11-20 11:17 ` [PATCH 5/7] touchscreen: pixcir_ts: Add support for axis inversion / swapping Hans de Goede
2015-11-20 11:17 ` [PATCH 6/7] ARM: dts: sun4i: Add touchscreen node to iNet1 tablet Hans de Goede
2015-11-20 11:17 ` [PATCH 7/7] ARM: dts: sun4i: Add touchscreen node to pov protab2-ips9 tablet Hans de Goede
2015-11-20 11:22 ` [PATCH 0/7] Various touchscreens: Support axis inversion / swapping / extra gpios Russell King - ARM Linux
[not found] ` <20151120112245.GC8644-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-11-20 11:33 ` Hans de Goede
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=20151120172725.GA26895@dtor-ws \
--to=dmitry.torokhov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=sander-wENMetUwf8VmR6Xm/wNWPw@public.gmane.org \
/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).