hid-logitech-wtp: refactoring for extensibility
authorDennis Kempin <denniskempin@chromium.org>
Fri, 10 May 2013 00:59:08 +0000 (17:59 -0700)
committerChromeBot <chrome-bot@google.com>
Wed, 15 May 2013 23:16:23 +0000 (16:16 -0700)
commitab25983c9032807d33f510ff3e9f79bd636b6994
treebf9d8ee6ae6b1dc2575b8c8a4bfd9b46b09c3287
parentec554f54eb6940bac4d3a9ddd7eb138bdb04f459
hid-logitech-wtp: refactoring for extensibility

Refactored the driver to allow for future devices to be added.

- Changed the initialization procedure to support multiple hidpp
  features. Each feature has methods attached to it, that take care of
  init, polling and parsing of events.
- During init, the driver selects the first available feature that is
  supported (Currently only TouchPadRawXY is supported).
- All device-specific branches are happening during the init method.
  e.q. don't send T651 to raw mode.
- TouchpadRawXY allows two different event formats. Raw or attached to
  the end of the mouse events. The init method decides which one to use.
- The data structures now reflect the data required to generate the
  output, no longer the data available from the device.
- Reordered and renamed to reflect feature-specific code and generic
  code.
BUG=chromium:240850
TEST=manually test with all 3 previously supported touchpads.

Change-Id: I24f67868aa6c26a55193a24c636f0a15a6d70e53
Signed-off-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50754
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
drivers/hid/hid-logitech-hidpp.c
drivers/hid/hid-logitech-wtp.c