From: Chris Bagwell <chris@cnpbagwell.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, Ping Cheng <pinglinux@gmail.com>,
Jaya Kumar <jayakumar.lkml@gmail.com>
Subject: Re: [PATCH 1/2] Input: wacom_w8001 - implement open and close
Date: Tue, 23 Aug 2011 12:22:06 -0500 [thread overview]
Message-ID: <CAGzDe_bUbbpg5g773zhX__ax65jfVcRYf1afd=GxMS4GS8ge-w@mail.gmail.com> (raw)
In-Reply-To: <1313957747-22796-1-git-send-email-dmitry.torokhov@gmail.com>
I don't have one of these to test but anyways:
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
I've been trying to slowing document the protocols for ISDV4 and USB
Wacom devices (http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=ISDV4_Protocol
for these ISDV4 ones if your interested). During this, I was
comparing this version against the user land version of this driver
inside xf86-input-wacom.
xf86-input-wacom was doing a version of this patch so good to see
here. The only other difference remaining is it also discards any
data on the line during startup to flush old data from after initial
STOP command and so that its sure of command/response sequence.
I do not know the serio well enough to know if it discards old data.
Even if it does not, the driver would handle old motion events OK and
the tiniest possibility an old touch query response on line when it
sends initial pen query.
Chris
On Sun, Aug 21, 2011 at 3:15 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Implement open() and close() methods for the input device so that we
> do not start the device unless there are users listening to the events.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> drivers/input/touchscreen/wacom_w8001.c | 21 ++++++++++++++++++++-
> 1 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
> index c14412e..5ece6c1 100644
> --- a/drivers/input/touchscreen/wacom_w8001.c
> +++ b/drivers/input/touchscreen/wacom_w8001.c
> @@ -367,6 +367,20 @@ static int w8001_command(struct w8001 *w8001, unsigned char command,
> return rc;
> }
>
> +static int w8001_open(struct input_dev *dev)
> +{
> + struct w8001 *w8001 = input_get_drvdata(dev);
> +
> + return w8001_command(w8001, W8001_CMD_START, false);
> +}
> +
> +static void w8001_close(struct input_dev *dev)
> +{
> + struct w8001 *w8001 = input_get_drvdata(dev);
> +
> + w8001_command(w8001, W8001_CMD_STOP, false);
> +}
> +
> static int w8001_setup(struct w8001 *w8001)
> {
> struct input_dev *dev = w8001->dev;
> @@ -474,7 +488,7 @@ static int w8001_setup(struct w8001 *w8001)
>
> strlcat(w8001->name, " Touchscreen", sizeof(w8001->name));
>
> - return w8001_command(w8001, W8001_CMD_START, false);
> + return 0;
> }
>
> /*
> @@ -534,6 +548,11 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv)
> input_dev->id.version = 0x0100;
> input_dev->dev.parent = &serio->dev;
>
> + input_dev->open = w8001_open;
> + input_dev->close = w8001_close;
> +
> + input_set_drvdata(input_dev, w8001);
> +
> err = input_register_device(w8001->dev);
> if (err)
> goto fail3;
> --
> 1.7.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-08-23 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-21 20:15 [PATCH 1/2] Input: wacom_w8001 - implement open and close Dmitry Torokhov
2011-08-21 20:15 ` [PATCH 2/2] Input: wacom_w8001 - simplify w8001_remove Dmitry Torokhov
2011-08-23 17:22 ` Chris Bagwell [this message]
2011-08-23 17:48 ` [PATCH 1/2] Input: wacom_w8001 - implement open and close Dmitry Torokhov
[not found] ` <CAF8JNhJ+1=7J3e=Ohs-cpQVwkbYgqOfepxGt=MtWjXFq7=eHDQ@mail.gmail.com>
2011-08-23 21:23 ` Ping Cheng
2011-08-24 6:53 ` 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='CAGzDe_bUbbpg5g773zhX__ax65jfVcRYf1afd=GxMS4GS8ge-w@mail.gmail.com' \
--to=chris@cnpbagwell.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jayakumar.lkml@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=pinglinux@gmail.com \
/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).