From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Oreste Salerno <oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
fery-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 3/3] Input: cyttsp - add default init function
Date: Mon, 11 Jan 2016 12:02:47 -0800 [thread overview]
Message-ID: <20160111200247.GC22646@dtor-ws> (raw)
In-Reply-To: <01aa2661875444ecc771dfce1f466b6846ac5eea.1452447124.git.oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
On Sun, Jan 10, 2016 at 06:36:09PM +0100, Oreste Salerno wrote:
> When using device trees, it's not possible to assign an init()
> function in the platform data.
> In case the init function has not been assigned, attempt to
> perform a hard reset of the chip, using reset gpio defined in the
> platform data / device tree.
Hmm, I do not see any users of cyttsp platform data in mainline, so
let's kill init/exit and just do GPIO toggle for everyone. We might need
to add regulator support as well, but that's when someone will need it.
Thanks.
>
> Signed-off-by: Oreste Salerno <oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/input/touchscreen/cyttsp_core.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
> index 5dc6bf6..baf0fd5 100644
> --- a/drivers/input/touchscreen/cyttsp_core.c
> +++ b/drivers/input/touchscreen/cyttsp_core.c
> @@ -239,6 +239,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts)
> return retval;
> }
>
> +static void cyttsp_hard_reset(struct cyttsp *ts)
> +{
> + if (ts->pdata->reset_gpio) {
> + gpiod_set_value_cansleep(ts->pdata->reset_gpio, 1);
> + msleep(CY_DELAY_DFLT);
> + gpiod_set_value_cansleep(ts->pdata->reset_gpio, 0);
> + msleep(CY_DELAY_DFLT);
> + }
> +}
> +
> static int cyttsp_soft_reset(struct cyttsp *ts)
> {
> unsigned long timeout;
> @@ -685,6 +695,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
> error);
> goto err_free_mem;
> }
> + } else {
> + cyttsp_hard_reset(ts);
> }
>
> input_dev->name = pdata->name;
> --
> 1.9.1
>
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oreste Salerno <oreste.salerno@tomtom.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
fery@cypress.com, robh+dt@kernel.org, pawel.moll@arm.com,
mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 3/3] Input: cyttsp - add default init function
Date: Mon, 11 Jan 2016 12:02:47 -0800 [thread overview]
Message-ID: <20160111200247.GC22646@dtor-ws> (raw)
In-Reply-To: <01aa2661875444ecc771dfce1f466b6846ac5eea.1452447124.git.oreste.salerno@tomtom.com>
On Sun, Jan 10, 2016 at 06:36:09PM +0100, Oreste Salerno wrote:
> When using device trees, it's not possible to assign an init()
> function in the platform data.
> In case the init function has not been assigned, attempt to
> perform a hard reset of the chip, using reset gpio defined in the
> platform data / device tree.
Hmm, I do not see any users of cyttsp platform data in mainline, so
let's kill init/exit and just do GPIO toggle for everyone. We might need
to add regulator support as well, but that's when someone will need it.
Thanks.
>
> Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com>
> ---
> drivers/input/touchscreen/cyttsp_core.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
> index 5dc6bf6..baf0fd5 100644
> --- a/drivers/input/touchscreen/cyttsp_core.c
> +++ b/drivers/input/touchscreen/cyttsp_core.c
> @@ -239,6 +239,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts)
> return retval;
> }
>
> +static void cyttsp_hard_reset(struct cyttsp *ts)
> +{
> + if (ts->pdata->reset_gpio) {
> + gpiod_set_value_cansleep(ts->pdata->reset_gpio, 1);
> + msleep(CY_DELAY_DFLT);
> + gpiod_set_value_cansleep(ts->pdata->reset_gpio, 0);
> + msleep(CY_DELAY_DFLT);
> + }
> +}
> +
> static int cyttsp_soft_reset(struct cyttsp *ts)
> {
> unsigned long timeout;
> @@ -685,6 +695,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
> error);
> goto err_free_mem;
> }
> + } else {
> + cyttsp_hard_reset(ts);
> }
>
> input_dev->name = pdata->name;
> --
> 1.9.1
>
--
Dmitry
next prev parent reply other threads:[~2016-01-11 20:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 17:36 [PATCH v3 0/3] Add device tree support to the cyttsp driver Oreste Salerno
2016-01-10 17:36 ` Oreste Salerno
2016-01-10 17:36 ` [PATCH v3 1/3] Input: cyttsp - remove unused irq_gpio from platform_data Oreste Salerno
2016-01-10 17:36 ` Oreste Salerno
[not found] ` <cover.1452447124.git.oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
2016-01-10 17:36 ` [PATCH v3 2/3] Input: cyttsp - add device tree bindings Oreste Salerno
2016-01-10 17:36 ` Oreste Salerno
2016-01-11 3:01 ` Rob Herring
2016-01-11 17:54 ` Oreste Salerno
2016-01-11 17:54 ` Oreste Salerno
2016-01-11 18:45 ` Dmitry Torokhov
2016-01-11 19:01 ` Oreste Salerno
2016-01-11 19:01 ` Oreste Salerno
2016-01-11 23:51 ` Rob Herring
[not found] ` <dd329fe3420fba4049c353a9a092ff9c45c5a252.1452447124.git.oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
2016-01-11 18:30 ` Dmitry Torokhov
2016-01-11 18:30 ` Dmitry Torokhov
2016-01-10 17:36 ` [PATCH v3 3/3] Input: cyttsp - add default init function Oreste Salerno
2016-01-10 17:36 ` Oreste Salerno
[not found] ` <01aa2661875444ecc771dfce1f466b6846ac5eea.1452447124.git.oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org>
2016-01-11 20:02 ` Dmitry Torokhov [this message]
2016-01-11 20:02 ` Dmitry Torokhov
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=20160111200247.GC22646@dtor-ws \
--to=dmitry.torokhov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=fery-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=oreste.salerno-Jdzig1fPfSTQT0dZR+AlfA@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.