touchpad.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  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 the cached probe result. */
  21. void program_touchpad_main(void);
  22. /* Poll one input report. Returns 1 when the deltas or buttons changed;
  23. * values use the mouse layer's PS/2 convention (+dy is up). */
  24. int touchpad_poll(int *buttons, int *dx, int *dy);
  25. #endif