1. 24 Aug, 2011 11 commits
    • Daniel Kurtz's avatar
      Input: synaptics - process finger (<=5) transitions · 6b4b49fe
      Daniel Kurtz authored
      Synaptics image sensor touchpads track up to 5 fingers, but only report 2.
      They use a special "TYPE=2" (AGM-CONTACT) packet type that reports
      the number of tracked fingers and which finger is reported in the SGM
      and AGM packets.
      
      With this new packet type, it is possible to tell userspace when 4 or 5
      fingers are touching.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      6b4b49fe
    • Daniel Kurtz's avatar
      Input: add BTN_TOOL_QUINTTAP for reporting 5 fingers on touchpad · d5051272
      Daniel Kurtz authored
      "4-finger scroll" is a gesture supported by some applications and
      operating systems.
      
      "Resting thumb" is when a clickpad user rests a finger (e.g., a
      thumb), in a "click zone" (typically the bottom of the touchpad) in
      anticipation of click+move=select gestures.
      
      Thus, "4-finger scroll + resting thumb" is a 5-finger gesture.
      To allow userspace to detect this gesture, we send BTN_TOOL_QUINTTAP.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      d5051272
    • Daniel Kurtz's avatar
      Input: synaptics - process finger (<=3) transitions · 4dc772d2
      Daniel Kurtz authored
      Synaptics image sensor touchpads track 5 fingers, but only report 2.
      This patch attempts to deal with some idiosyncrasies of these touchpads:
      
       * When there are 3 or more fingers, only two are reported.
       * The touchpad tracks the 5 fingers in slot[0] through slot[4].
       * It always reports the lowest and highest valid slots in SGM and AGM
         packets, respectively.
       * The number of fingers is only reported in the SGM packet.  However,
         the number of fingers can change either before or after an AGM
         packet.
       * Thus, if an SGM reports a different number of fingers than the last
         SGM, it is impossible to tell whether the intervening AGM corresponds
         to the old number of fingers or the new number of fingers.
       * For example, when going from 2->3 fingers, it is not possible to tell
         whether tell AGM contains slot[1] (old 2nd finger) or slot[2] (new
         3rd finger).
       * When fingers are added one at at time, from 1->2->3, it is possible to
         track which slots are contained in the SGM and AGM packets:
           1 finger:  SGM = slot[0], no AGM
           2 fingers: SGM = slot[0], AGM = slot[1]
           3 fingers: SGM = slot[0], AGM = slot[2]
       * It is also possible to track which slot is contained in the SGM when 1
         of 2 fingers is removed.  This is because the touchpad sends a special
         (0,0,0) AGM packet whenever all fingers are removed except slot[0]:
           Last AGM == (0,0,0): SGM contains slot[1]
           Else: SGM contains slot[0]
       * However, once there are 3 fingers, if exactly 1 finger is removed, it
         is impossible to tell which 2 slots are contained in SGM and AGM.
         The (SGM,AGM) could be (0,1), (0,2), or (1,2). There is no way to know.
       * Similarly, if two fingers are simultaneously removed (3->1), then it
         is only possible to know if SGM still contains slot[0].
       * Since it is not possible to reliably track which slot is being
         reported, we invalidate the tracking_id every time the number of
         fingers changes until this ambiguity is resolved when:
           a) All fingers are removed.
           b) 4 or 5 fingers are touched, generates an AGM-CONTACT packet.
           c) All fingers are removed except slot[0].  In this special case, the
              ambiguity is resolved since by the (0,0,0) AGM packet.
      
      Behavior of the driver:
      
      When 2 or more fingers are present on the touchpad, the kernel reports
      up to two MT-B slots containing the position data for two of the fingers
      reported by the touchpad.  If the identity of a finger cannot be tracked
      when the number-of-fingers changes, the corresponding MT-B slot will be
      invalidated (track_id set to -1), and a new track_id will be assigned in
      a subsequent input event report.
      
      The driver always reports the total number of fingers using one of the
      EV_KEY/BTN_TOOL_*TAP events. This could differ from the number of valid
      MT-B slots for two reasons:
       a) There are more than 2 fingers on the pad.
       b) During ambiguous number-of-fingers transitions, the correct track_id
          for one or both of the slots cannot be determined, so the slots are
          invalidated.
      
      Thus, this is a hybrid singletouch/MT-B scheme. Userspace can detect
      this behavior by noting that the driver supports more EV_KEY/BTN_TOOL_*TAP
      events than its maximum EV_ABS/ABS_MT_SLOT.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      4dc772d2
    • Daniel Kurtz's avatar
      Input: mt - document devices reporting more touches than slots · a93bd154
      Daniel Kurtz authored
      Some devices are capable of identifying and/or tracking more contacts than
      they can report to the driver.  Document how a driver should handle this,
      and what userspace should expect.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      a93bd154
    • Daniel Kurtz's avatar
      Input: synaptics - decode AGM packet types · a6ca40c1
      Daniel Kurtz authored
      A Synaptics image sensor tracks 5 fingers, but can only report 2.
      
      The algorithm for choosing which 2 fingers to report and in which packet:
        Touchpad maintains 5 slots, numbered 0 to 4
        Initially all slots are empty
        As new fingers are detected, assign them to the lowest available slots
        The touchpad always reports:
          SGM: lowest numbered non-empty slot
          AGM: highest numbered non-empty slot, if there is one
      
      In addition, these touchpads have a special AGM packet type which reports
      the number of fingers currently being tracked, and which finger is in
      each of the two slots.  Unfortunately, these "TYPE=2" packets are only used
      when more than 3 fingers are being tracked.  When less than 4 fingers
      are present, the 'w' value must be used to track how many fingers are
      present, and knowing which fingers are being reported is much more
      difficult, if not impossible.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      a6ca40c1
    • Daniel Kurtz's avatar
      Input: synaptics - add image sensor support · 3cdfee9e
      Daniel Kurtz authored
      Synaptics makes (at least) two kinds of touchpad sensors:
       * Older pads use a profile sensor that could only infer the location
         of individual fingers based on the projection of their profiles
         onto row and column sensors.
       * Newer pads use an image sensor that can track true finger position
         using a two-dimensional sensor grid.
      
      Both sensor types support an "Advanced Gesture Mode":
       When multiple fingers are detected, the touchpad sends alternating
       "Advanced Gesture Mode" (AGM) and "Simple Gesture Mode" (SGM)
       packets.
       The AGM packets have w=2, and contain reduced resolution finger data
       The SGM packets have w={0,1} and contain full resolution finger data
      
      Profile sensors try to report the "upper" (larger y value) finger in
      the SGM packet, and the lower (smaller y value) in the AGM packet.
      However, due to the nature of the profile sensor, they easily get
      confused when fingers cross, and can start reporting the x-coordinate
      of one with the y-coordinate of the other.  Thus, for profile
      sensors, "semi-mt" was created, which reports a "bounding box"
      created by pairing min and max coordinates of the two pairs of
      reported fingers.
      
      Image sensors can report the actual coordinates of two of the fingers
      present.  This patch detects if the touchpad is an image sensor and
      reports finger data using the MT-B protocol.
      
      NOTE: This patch only adds partial support for 2-finger gestures.
            The proper interpretation of the slot contents when more than
            two fingers are present is left to later patches.  Also,
            handling of 'number of fingers' transitions is incomplete.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      3cdfee9e
    • Daniel Kurtz's avatar
    • Daniel Kurtz's avatar
      Input: synaptics - refactor agm packet parsing · 7afdb842
      Daniel Kurtz authored
      When a Synaptics touchpad is in "AGM" mode, and multiple fingers are
      detected, the touchpad sends alternating "Advanced Gesture Mode" (AGM) and
      "Simple Gesture Mode" (SGM) packets.
        The AGM packets have w=2, and contain reduced resolution finger data.
        The SGM packets have w={0,1} and contain full resolution finger data.
      
      Refactor the parsing of agm packets to its own function, and rename the
      synaptics_data.mt field to .agm to indicate that it contains the contents of
      the last agm packet.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      7afdb842
    • Daniel Kurtz's avatar
      Input: synaptics - refactor y inversion · 6de58dd6
      Daniel Kurtz authored
      Synaptics touchpads report increasing y from bottom to top.
      This is inverted from normal userspace "top of screen is 0" coordinates.
      Thus, the kernel driver reports inverted y coordinates to userspace.
      
      This patch refactors this inversion.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      6de58dd6
    • Dmitry Torokhov's avatar
      Input: wacom_w8001 - simplify w8001_remove · 66fd9385
      Dmitry Torokhov authored
      Since touchscreen driver does not handle any events to be sent to the
      device we can close serio port first and then unregister the input device.
      Tested-by: default avatarPing Cheng <pingc@wacom.com>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      66fd9385
    • Dmitry Torokhov's avatar
      Input: wacom_w8001 - implement open and close · e9496746
      Dmitry Torokhov authored
      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.
      Acked-by: default avatarChris Bagwell <chris@cnpbagwell.com>
      Tested-by: default avatarPing Cheng <pingc@wacom.com>
      Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
      e9496746
  2. 09 Aug, 2011 2 commits
  3. 03 Aug, 2011 1 commit
  4. 25 Jul, 2011 2 commits
  5. 20 Jul, 2011 2 commits
  6. 19 Jul, 2011 4 commits
  7. 13 Jul, 2011 4 commits
  8. 10 Jul, 2011 3 commits
  9. 09 Jul, 2011 1 commit
  10. 07 Jul, 2011 9 commits
  11. 05 Jul, 2011 1 commit