mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
cfd8579ddc
Recently we had a building error if we enable the MOUSE_PS2_ALPS while
disable the MOUSE_PS2_TRACKPOINT, and was fixed by 49e6979e7e
("Input: psmouse - fix build error of multiple definition").
We could improve that fix by dropping all unneeded functions and
CONFIG_MOUSE_ guards from the header, it is safe to do that since
those functions are not directly called by psmouse-base.c anymore.
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
62 lines
1.3 KiB
C
62 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* OLPC HGPK (XO-1) touchpad PS/2 mouse driver
|
|
*/
|
|
|
|
#ifndef _HGPK_H
|
|
#define _HGPK_H
|
|
|
|
#define HGPK_GS 0xff /* The GlideSensor */
|
|
#define HGPK_PT 0xcf /* The PenTablet */
|
|
|
|
enum hgpk_model_t {
|
|
HGPK_MODEL_PREA = 0x0a, /* pre-B1s */
|
|
HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */
|
|
HGPK_MODEL_B = 0x28, /* B2s, has capacitance issues */
|
|
HGPK_MODEL_C = 0x3c,
|
|
HGPK_MODEL_D = 0x50, /* C1, mass production */
|
|
};
|
|
|
|
enum hgpk_spew_flag {
|
|
NO_SPEW,
|
|
MAYBE_SPEWING,
|
|
SPEW_DETECTED,
|
|
RECALIBRATING,
|
|
};
|
|
|
|
#define SPEW_WATCH_COUNT 42 /* at 12ms/packet, this is 1/2 second */
|
|
|
|
enum hgpk_mode {
|
|
HGPK_MODE_MOUSE,
|
|
HGPK_MODE_GLIDESENSOR,
|
|
HGPK_MODE_PENTABLET,
|
|
HGPK_MODE_INVALID
|
|
};
|
|
|
|
struct hgpk_data {
|
|
struct psmouse *psmouse;
|
|
enum hgpk_mode mode;
|
|
bool powered;
|
|
enum hgpk_spew_flag spew_flag;
|
|
int spew_count, x_tally, y_tally; /* spew detection */
|
|
unsigned long recalib_window;
|
|
struct delayed_work recalib_wq;
|
|
int abs_x, abs_y;
|
|
int dupe_count;
|
|
int xbigj, ybigj, xlast, ylast; /* jumpiness detection */
|
|
int xsaw_secondary, ysaw_secondary; /* jumpiness detection */
|
|
};
|
|
|
|
int hgpk_detect(struct psmouse *psmouse, bool set_properties);
|
|
int hgpk_init(struct psmouse *psmouse);
|
|
|
|
#ifdef CONFIG_MOUSE_PS2_OLPC
|
|
void hgpk_module_init(void);
|
|
#else
|
|
static inline void hgpk_module_init(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif
|