0001
0002
0003
0004
0005
0006 #ifndef _HGPK_H
0007 #define _HGPK_H
0008
0009 #define HGPK_GS 0xff
0010 #define HGPK_PT 0xcf
0011
0012 enum hgpk_model_t {
0013 HGPK_MODEL_PREA = 0x0a,
0014 HGPK_MODEL_A = 0x14,
0015 HGPK_MODEL_B = 0x28,
0016 HGPK_MODEL_C = 0x3c,
0017 HGPK_MODEL_D = 0x50,
0018 };
0019
0020 enum hgpk_spew_flag {
0021 NO_SPEW,
0022 MAYBE_SPEWING,
0023 SPEW_DETECTED,
0024 RECALIBRATING,
0025 };
0026
0027 #define SPEW_WATCH_COUNT 42
0028
0029 enum hgpk_mode {
0030 HGPK_MODE_MOUSE,
0031 HGPK_MODE_GLIDESENSOR,
0032 HGPK_MODE_PENTABLET,
0033 HGPK_MODE_INVALID
0034 };
0035
0036 struct hgpk_data {
0037 struct psmouse *psmouse;
0038 enum hgpk_mode mode;
0039 bool powered;
0040 enum hgpk_spew_flag spew_flag;
0041 int spew_count, x_tally, y_tally;
0042 unsigned long recalib_window;
0043 struct delayed_work recalib_wq;
0044 int abs_x, abs_y;
0045 int dupe_count;
0046 int xbigj, ybigj, xlast, ylast;
0047 int xsaw_secondary, ysaw_secondary;
0048 };
0049
0050 int hgpk_detect(struct psmouse *psmouse, bool set_properties);
0051 int hgpk_init(struct psmouse *psmouse);
0052
0053 #ifdef CONFIG_MOUSE_PS2_OLPC
0054 void hgpk_module_init(void);
0055 #else
0056 static inline void hgpk_module_init(void)
0057 {
0058 }
0059 #endif
0060
0061 #endif