mirror of
https://github.com/torvalds/linux.git
synced 2026-04-22 08:44:02 -04:00
This patch introduces a driver for the PixArt PS/2 touchpad, which supports both clickpad and touchpad types. At the same time, we extended the single data packet length to 16, because according to the current PixArt hardware and FW design, we need 11 bytes/15 bytes to represent the complete three-finger/four-finger data. Co-developed-by: Jon Xie <jon_xie@pixart.com> Signed-off-by: Jon Xie <jon_xie@pixart.com> Co-developed-by: Jay Lee <jay_lee@pixart.com> Signed-off-by: Jay Lee <jay_lee@pixart.com> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Link: https://lore.kernel.org/r/20240704125243.3633569-1-zhoubinbin@loongson.cn Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
37 lines
765 B
C
37 lines
765 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef _PIXART_PS2_H
|
|
#define _PIXART_PS2_H
|
|
|
|
#include "psmouse.h"
|
|
|
|
#define PIXART_PAD_WIDTH 1023
|
|
#define PIXART_PAD_HEIGHT 579
|
|
#define PIXART_MAX_FINGERS 4
|
|
|
|
#define PIXART_CMD_REPORT_FORMAT 0x01d8
|
|
#define PIXART_CMD_SWITCH_PROTO 0x00de
|
|
|
|
#define PIXART_MODE_REL 0
|
|
#define PIXART_MODE_ABS 1
|
|
|
|
#define PIXART_TYPE_CLICKPAD 0
|
|
#define PIXART_TYPE_TOUCHPAD 1
|
|
|
|
#define CONTACT_CNT_MASK GENMASK(6, 4)
|
|
|
|
#define SLOT_ID_MASK GENMASK(2, 0)
|
|
#define ABS_Y_MASK GENMASK(5, 4)
|
|
#define ABS_X_MASK GENMASK(7, 6)
|
|
|
|
struct pixart_data {
|
|
u8 mode;
|
|
u8 type;
|
|
int x_max;
|
|
int y_max;
|
|
};
|
|
|
|
int pixart_detect(struct psmouse *psmouse, bool set_properties);
|
|
int pixart_init(struct psmouse *psmouse);
|
|
|
|
#endif /* _PIXART_PS2_H */
|