From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Arjan Opmeer <arjan@opmeer.net>
Cc: akpm@linux-foundation.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: Update Elantech touchpad driver to v5 for kernel 2.6.27-rc5-mm1
Date: Thu, 16 Oct 2008 00:48:54 -0400 [thread overview]
Message-ID: <20081016044854.GB17531@anvil.corenet.prv> (raw)
In-Reply-To: <20081016042909.GA12122@adopmeer.homeip.net>
On Thu, Oct 16, 2008 at 06:29:09AM +0200, Arjan Opmeer wrote:
>
> Hi Dmitry,
>
> On Wed, Oct 15, 2008 at 11:05:15PM -0400, Dmitry Torokhov wrote:
> > >
> > > As far as I know the touchpad does not report pressure
> >
> > I see. In this case the driver should not really report ABS_PRESSURE but
> > only BTN_TOUCH. I understand that this would require synaptics X driver
> > changes but that should be OK. I wrote a patch to the X driver which seems
> > to be working if I bastardize my synaptics touchpad but I would like to
> > have it tested with real Elantech device. I am attaching the version of
> > Elantech driver that I want to apply (there were some timy changes) and
> > the patch to teh Synaptics X driver (against recent git pull from its
> > repository). If you could give it a try that would be grand.
>
> Well, there we have a problem. My laptop with the Elantech touchpad died. So
> I no longer have any hardware to try your changes on!
>
Oops, sorry to hear that. It looks like i wait for too long...
> Maybe we should just put the code out there and see what happens?
>
I suppose so, it was in Andrew's tree for a while.
>
> As I was reading over the patch I found some small things you might want to
> change.
>
> > dropped (users wishing to use touchpad in relative mode can use
> > standard PS/2 protocol emilation done in hardware). The driver
> ^^^^^^^^^ emulation
>
OK.
> > + case 2:
> > + /* We don't now how to check parity in protocol v2 */
> ^^^ know
OK.
>
> > + /*
> > + * Read back reg 0x10. The touchpad is probably initalising
> > + * and not ready until we read back the value we just wrote.
> > + */
>
> Although the fact that we can read back the registers contents means we
> didn't jam the touchpad EC by initialising with the wrong register values
> earlier, it occured to me that we never actually test the value we read
> back.
>
> > + do {
> > + rc = elantech_read_reg(psmouse, 0x10, &val);
> > + if (rc == 0)
>
> Shouldn't this read
>
> if (rc == 0 && val == etd->reg 10)
>
> ?
>
If we see reports of hardware not switching to absolute mode we might
want to do this.
> > + for (i = 1; i < 256; i++)
> > + etd->parity[i] = (etd->parity[i & (i - 1)] ^ 1);
> ^ ^
> Why did I put these parentheses there?
>
:)
> > + /*
> > + * Assume every version greater than this is new EeePC style
> > + * hardware with 6 byte packets
> > + */
> > + if ((etd->fw_version_maj >= 0x02) && (etd->fw_version_min >= 0x30)) {
>
> In your quest of removing parentheses don't you want to remove these ones too?
> :)
>
Done.
> > +/*
> > + * Try Elantech touchpad.
> > + */
> > + if (max_proto > PSMOUSE_IMEX &&
> > + elantech_detect(psmouse, set_properties) == 0) {
> > + if (!set_properties || elantech_init(psmouse) == 0)
> > + return PSMOUSE_ELANTECH;
>
> I see you moved the Elantech detection up. I put it after the pmouse_reset
> on purpose as a safety measure because when initially developing the driver
> I managed to get the touchpad all confused and not responding properly to
> its magic knock. However this was using the serio_raw interface, so it might
> not be necessary in this case.
>
There is psmouse_reset() call in elantech_detect() now. The reason it
was moved is the place it used to be we do "basic" protocol probes when
either user asked us to limit protocols being tested or we know that we
are working with specific hardware but native protocol failed for some
reason.
--
Dmitry
prev parent reply other threads:[~2008-10-16 4:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-14 3:23 Arjan Opmeer
2008-09-19 4:17 ` Dmitry Torokhov
2008-09-19 7:05 ` Arjan Opmeer
2008-10-16 3:05 ` Dmitry Torokhov
2008-10-16 4:29 ` Arjan Opmeer
2008-10-16 4:48 ` Dmitry Torokhov [this message]
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=20081016044854.GB17531@anvil.corenet.prv \
--to=dmitry.torokhov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@opmeer.net \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®