Lines 499-504
static int verbose = PSM_DEBUG;
Link Here
|
499 |
static int synaptics_support = 0; |
499 |
static int synaptics_support = 0; |
500 |
static int trackpoint_support = 0; |
500 |
static int trackpoint_support = 0; |
501 |
static int elantech_support = 0; |
501 |
static int elantech_support = 0; |
|
|
502 |
static int force_mux_discovery = 0; |
502 |
|
503 |
|
503 |
/* for backward compatibility */ |
504 |
/* for backward compatibility */ |
504 |
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) |
505 |
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) |
Lines 642-647
static probefunc_t enable_4dmouse;
Link Here
|
642 |
static probefunc_t enable_4dplus; |
643 |
static probefunc_t enable_4dplus; |
643 |
static probefunc_t enable_mmanplus; |
644 |
static probefunc_t enable_mmanplus; |
644 |
static probefunc_t enable_synaptics; |
645 |
static probefunc_t enable_synaptics; |
|
|
646 |
static probefunc_t enable_synaptics_mux; |
645 |
static probefunc_t enable_trackpoint; |
647 |
static probefunc_t enable_trackpoint; |
646 |
static probefunc_t enable_versapad; |
648 |
static probefunc_t enable_versapad; |
647 |
static probefunc_t enable_elantech; |
649 |
static probefunc_t enable_elantech; |
Lines 674-679
static struct {
Link Here
|
674 |
0x08, MOUSE_4D_PACKETSIZE, enable_4dmouse }, |
676 |
0x08, MOUSE_4D_PACKETSIZE, enable_4dmouse }, |
675 |
{ MOUSE_MODEL_4DPLUS, /* A4 Tech 4D+ Mouse */ |
677 |
{ MOUSE_MODEL_4DPLUS, /* A4 Tech 4D+ Mouse */ |
676 |
0xc8, MOUSE_4DPLUS_PACKETSIZE, enable_4dplus }, |
678 |
0xc8, MOUSE_4DPLUS_PACKETSIZE, enable_4dplus }, |
|
|
679 |
{ MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad on Active Mux */ |
680 |
0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux }, |
677 |
{ MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad */ |
681 |
{ MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad */ |
678 |
0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_synaptics }, |
682 |
0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_synaptics }, |
679 |
{ MOUSE_MODEL_ELANTECH, /* Elantech Touchpad */ |
683 |
{ MOUSE_MODEL_ELANTECH, /* Elantech Touchpad */ |
Lines 2933-2938
SYSCTL_INT(_hw_psm, OID_AUTO, trackpoint_support, CTLFLAG_RDTUN,
Link Here
|
2933 |
SYSCTL_INT(_hw_psm, OID_AUTO, elantech_support, CTLFLAG_RDTUN, |
2937 |
SYSCTL_INT(_hw_psm, OID_AUTO, elantech_support, CTLFLAG_RDTUN, |
2934 |
&elantech_support, 0, "Enable support for Elantech touchpads"); |
2938 |
&elantech_support, 0, "Enable support for Elantech touchpads"); |
2935 |
|
2939 |
|
|
|
2940 |
SYSCTL_INT(_hw_psm, OID_AUTO, force_mux_discovery, CTLFLAG_RDTUN, |
2941 |
&force_mux_discovery, 0, "Force probing of multiplexed PS/2 ports"); |
2942 |
|
2936 |
static void |
2943 |
static void |
2937 |
psmintr(void *arg) |
2944 |
psmintr(void *arg) |
2938 |
{ |
2945 |
{ |
Lines 2940-2946
psmintr(void *arg)
Link Here
|
2940 |
struct timeval now; |
2947 |
struct timeval now; |
2941 |
int c; |
2948 |
int c; |
2942 |
packetbuf_t *pb; |
2949 |
packetbuf_t *pb; |
|
|
2950 |
static int active_mode_logged = FALSE; |
2943 |
|
2951 |
|
|
|
2952 |
if (kbdcp(sc->kbdc)->aux_mux_enabled && !active_mode_logged) { |
2953 |
printf ("psm0: AUX IRQ fired in active multiplexing mode"); |
2954 |
active_mode_logged = TRUE; |
2955 |
} |
2944 |
|
2956 |
|
2945 |
/* read until there is nothing to read */ |
2957 |
/* read until there is nothing to read */ |
2946 |
while((c = read_aux_data_no_wait(sc->kbdc)) != -1) { |
2958 |
while((c = read_aux_data_no_wait(sc->kbdc)) != -1) { |
Lines 4933-4938
psmsoftintr(void *arg)
Link Here
|
4933 |
break; |
4945 |
break; |
4934 |
|
4946 |
|
4935 |
case MOUSE_MODEL_SYNAPTICS: |
4947 |
case MOUSE_MODEL_SYNAPTICS: |
|
|
4948 |
if (sc->mode.packetsize == 3) { |
4949 |
static u_char save[3]; |
4950 |
if (pb->ipacket[0] & 0x08) { |
4951 |
/* Convert generic -> pass-through */ |
4952 |
pb->ipacket[5] = pb->ipacket[2]; |
4953 |
pb->ipacket[4] = pb->ipacket[1]; |
4954 |
pb->ipacket[1] = pb->ipacket[0]; |
4955 |
pb->ipacket[0] = 0x84 | (save[0] & 3); |
4956 |
pb->ipacket[3] = 0xc4 | (save[0] & 3); |
4957 |
pb->ipacket[2] = 0; |
4958 |
} else { |
4959 |
/* Join two 3-bytes absolute packets */ |
4960 |
if (!(pb->ipacket[0] & 0x40)) { |
4961 |
bcopy(pb->ipacket, save, 3); |
4962 |
goto next; |
4963 |
} |
4964 |
bcopy(pb->ipacket, pb->ipacket + 3, 3); |
4965 |
bcopy(save, pb->ipacket, 3); |
4966 |
save[0] &= 0x03; |
4967 |
} |
4968 |
pb->inputbytes = 6; |
4969 |
} |
4936 |
if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { |
4970 |
if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { |
4937 |
VLOG(3, (LOG_DEBUG, "synaptics: " |
4971 |
VLOG(3, (LOG_DEBUG, "synaptics: " |
4938 |
"packet rejected\n")); |
4972 |
"packet rejected\n")); |
Lines 6043-6048
synaptics_set_mode(struct psm_softc *sc, int mode_byte) {
Link Here
|
6043 |
} |
6077 |
} |
6044 |
} |
6078 |
} |
6045 |
|
6079 |
|
|
|
6080 |
static int |
6081 |
enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) |
6082 |
{ |
6083 |
KBDC kbdc = sc->kbdc; |
6084 |
int status[3]; |
6085 |
int port, probe = FALSE, version, has_trackpoint = FALSE; |
6086 |
|
6087 |
/* |
6088 |
* Some HP laptops e.g. EB 8560w and 9470m have a trackpoint attached |
6089 |
* to AUX multiplexer rather than to synaptics pass-through interface. |
6090 |
* If active multiplexing mode is not activated this device produces |
6091 |
* own response to synaptics identify query thus preventing synaptics |
6092 |
* touchpad detection. |
6093 |
*/ |
6094 |
set_mouse_scaling(kbdc, 1); |
6095 |
if (mouse_ext_command(kbdc, 0) && |
6096 |
get_mouse_status(kbdc, status, 0, 3) == 3 && |
6097 |
status[0] == 0x00 && status[1] == 0x46 && status[2] == 0x12) |
6098 |
has_trackpoint = TRUE; |
6099 |
|
6100 |
version = enable_aux_mux(kbdc); |
6101 |
if (version == -1) |
6102 |
return (FALSE); |
6103 |
|
6104 |
if (verbose >= 2) |
6105 |
printf("Active Multiplexing PS/2 controller v%d.%d\n", |
6106 |
(version >> 4) & 0x0f, version & 0x0f); |
6107 |
|
6108 |
/* If trackpoint is detected we should scan AUX ports in active mode */ |
6109 |
if (has_trackpoint || force_mux_discovery) { |
6110 |
for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { |
6111 |
VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); |
6112 |
set_active_aux_mux_port(kbdc, port); |
6113 |
probe = enable_synaptics(sc, arg); |
6114 |
if (probe) { |
6115 |
/* Relative mouses are mapped to passthrough */ |
6116 |
sc->synhw.capPassthrough = 1; |
6117 |
break; |
6118 |
} |
6119 |
} |
6120 |
} |
6121 |
|
6122 |
/* Back to hidden multiplexing. Active one is not supported by reads */ |
6123 |
disable_aux_mux(kbdc); |
6124 |
|
6125 |
return (probe); |
6126 |
} |
6127 |
|
6046 |
static int |
6128 |
static int |
6047 |
enable_synaptics(struct psm_softc *sc, enum probearg arg) |
6129 |
enable_synaptics(struct psm_softc *sc, enum probearg arg) |
6048 |
{ |
6130 |
{ |