Bug 225338 - psm: Elantech touchpad in Gigabyte Aero 15X is recognized but doesn't work
Summary: psm: Elantech touchpad in Gigabyte Aero 15X is recognized but doesn't work
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Jean-Sébastien Pédron
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-20 10:58 UTC by Jean-Sébastien Pédron
Modified: 2018-01-27 17:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Sébastien Pédron freebsd_committer freebsd_triage 2018-01-20 10:58:10 UTC
The Elantech touchpad in a Gigabyte Aero 15X laptop is recognized properly after setting `hw.psm.elantech_support=1` in /boot/loader.conf:

    kernel: Elantech touchpad hardware v.4 firmware v.0x595f00
    kernel:   Model information:
    kernel:    MaxX:       3188
    kernel:    MaxY:       2085
    kernel:    DpmmX:      31
    kernel:    DpmmY:      31
    kernel:    TracesX:    21
    kernel:    TracesY:    14
    kernel:    DptraceX:   159
    kernel:    DptraceY:   160
    kernel:    SemiMT:     0
    kernel:    Clickpad:   1
    kernel:    Trackpoint: 0
    kernel:    CRC:        1
    kernel:    Pressure:   1
    kernel: psm0: found Elantech Touchpad
    kernel: psm0: model Elantech Touchpad, device ID 0-00, 3 buttons
    kernel: psm0: config:00004100, flags:00000008, packet size:6
    kernel: psm0: syncmask:04, syncbits:00

However, when I try to use it, the cursor doesn't move and clicks are not reported. The touchpad is reinitialized after each move/touch event because packets are apparently out-of-sync:

    kernel: psmintr: out of sync (0000 != 0004) 1 cmds since last error.
    kernel: psmintr: discard a byte (1)
    kernel: psmintr: out of sync (0000 != 0004) 0 cmds since last error.
    kernel: psmintr: discard a byte (2)
    kernel: psmintr: out of sync (0000 != 0004) 0 cmds since last error.
    kernel: psmintr: reset the mouse.

According to the psm(4) source code, the problem is that we check sync even though we should skip it when CRC is supported.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-20 11:03:07 UTC
A commit references this bug:

Author: dumbbell
Date: Sat Jan 20 11:02:19 UTC 2018
New revision: 328190
URL: https://svnweb.freebsd.org/changeset/base/328190

Log:
  psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set

  In psmprobe(), we set the initial `syncmask` to the vendor default value
  if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only
  set it for the Elantech touchpad later in psmattach(), thus `syncmask`
  is always configured.

  Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set.
  This fixes Elantech touchpad support for units which have `hascrc` set.

  To clarify that, when we log the `syncmask` and `syncbits` fields, also
  mention if they are actually used.

  Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS`
  flag.

  PR:		225338
  MFC after:	1 week

Changes:
  head/sys/dev/atkbdc/psm.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-01-27 16:36:11 UTC
A commit references this bug:

Author: dumbbell
Date: Sat Jan 27 16:36:07 UTC 2018
New revision: 328481
URL: https://svnweb.freebsd.org/changeset/base/328481

Log:
  psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set

  In psmprobe(), we set the initial `syncmask` to the vendor default value
  if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only
  set it for the Elantech touchpad later in psmattach(), thus `syncmask`
  is always configured.

  Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set.
  This fixes Elantech touchpad support for units which have `hascrc` set.

  To clarify that, when we log the `syncmask` and `syncbits` fields, also
  mention if they are actually used.

  Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS`
  flag.

  PR:		225338
  MFC of:		r328190

Changes:
_U  stable/11/
  stable/11/sys/dev/atkbdc/psm.c