touchpad.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /* Elan HID-over-I2C touchpad (HP Chromebook 11 G5 EE / setzer).
  2. *
  3. * The controller is a DesignWare I2C block in the Braswell LPSS; the
  4. * touchpad answers at slave address 0x15 with the HID-over-I2C register
  5. * protocol (16-bit little-endian register addresses). The device reports
  6. * absolute finger positions in the Elan 0x5D vendor report; the driver turns
  7. * successive positions into pointer deltas.
  8. */
  9. #ifndef TOUCHPAD_H
  10. #define TOUCHPAD_H
  11. /* Probe the LPSS I2C controllers and bring the touchpad up. Returns 1 when
  12. * a device was found. Must run at boot, before processes clone the kernel
  13. * page directory (it maps the I2C MMIO window). */
  14. int touchpad_init(void);
  15. int touchpad_present(void);
  16. /* Identification of the probed device (valid when present). */
  17. unsigned int touchpad_addr(void);
  18. unsigned short touchpad_vendor(void);
  19. unsigned short touchpad_product(void);
  20. /* `touchpad` kernel command: print status, or set the tap gestures with
  21. * `rightclick off|tap|corner|both` / `tapclick on|off`. */
  22. void program_touchpad_main(const char *arg);
  23. /* Poll one input report. Returns 1 when the deltas, scroll or buttons
  24. * changed; pointer values use the mouse layer's PS/2 convention (+dy is up),
  25. * scroll is in pixels (+ = later content). */
  26. int touchpad_poll(int *buttons, int *dx, int *dy, int *scroll);
  27. #endif