On 04/10/12(Thu) 15:24, Stefan Sperling wrote:
> This diff adds support for Elantech touchpads to pms(4), so that
> synpatics(4) will attach and allow configuration of edge-scrolling,
> 2-finger scrolling, toggle tap-to-click on/off, etc.

Wow, nice to see more touchpad models supported.

> Currently, such pads only work in compat mode, which means they are
> recognized as regular PS/2 mice and cannot be properly configured.
> 
> This patch adds support for hardware version 1, 2, and 3.
> Linux also supports version 4 but this driver does not yet.
> I have hardware version 3 which seems to work well, but code for
> the other versions is entirely untested. If you have a machine with
> a touchpad please try this diff. If it's an Elantech 1, 2, or 3,
> it should be detected as such automatically. (If you're looking
> for an easy way to configure the pad I'd suggest installing Xfce
> and going to the Mouse/Touchpad settings window.)
> 
> If I don't get test reports for versions 1 and 2, my plan is to
> commit the support code for versions 1 and 2 but only attach to
> version 3. Bugs in touchpad support code can be rather irritating
> so I'd prefer to keep versions 1 and 2 in PS/2 compat mode until
> somebody can confirm that the code actually works. Thanks!

My first impression at looking the code is that the v2 and v3 use
totally different packet formats and I don't see a real benefit of
having only one entry in the protocol table if you need to check
for the hardware version in every function.

I would suggest to use 3 different entries in the protocol table and a
enable_elantech_common() function so you can get rid of the hw_version
check and the protocol->packetsize hack for the v1.

I got the same feeling when you set the absolute mode: every version
use different magic ps2 commands with different magic values, I'm not
sure adding generic read/write functions help to understand nor save
some lines of code.

Other than that, it looks to me that the flags ELANTECH_F_HW_V1_OLD and
ELANTECH_F_PARITY_REVERSED are redundant.

Martin

Reply via email to