85
85
SYSCALL(ret = ioctl(pInfo->fd, MOUSE_SETLEVEL, &level));
87
xf86IDrvMsg(pInfo, X_ERROR, "%s Can't set native mode\n", pInfo->name);
87
xf86IDrvMsg(pInfo, X_ERROR, "%s Can't set native mode\n", pInfo->name);
90
90
SYSCALL(ret = ioctl(pInfo->fd, MOUSE_GETHWINFO, &mhw));
92
xf86IDrvMsg(pInfo, X_ERROR, "%s Can't get hardware info\n", pInfo->name);
92
xf86IDrvMsg(pInfo, X_ERROR, "%s Can't get hardware info\n",
96
97
if (mhw.model == MOUSE_MODEL_SYNAPTICS) {
99
xf86IDrvMsg(pInfo, X_ERROR, "%s Found no Synaptics, found Mouse model %d instead\n",
100
pInfo->name, mhw.model);
101
xf86IDrvMsg(pInfo, X_ERROR,
102
"%s Found no Synaptics, found Mouse model %d instead\n",
103
pInfo->name, mhw.model);
106
convert_hw_info(const synapticshw_t *psm_ident, struct PS2SynapticsHwInfo *synhw)
109
convert_hw_info(const synapticshw_t * psm_ident,
110
struct PS2SynapticsHwInfo *synhw)
108
112
memset(synhw, 0, sizeof(*synhw));
109
113
synhw->model_id = ((psm_ident->infoRot180 << 23) |
110
(psm_ident->infoPortrait << 22) |
111
(psm_ident->infoSensor << 16) |
112
(psm_ident->infoHardware << 9) |
113
(psm_ident->infoNewAbs << 7) |
114
(psm_ident->capPen << 6) |
115
(psm_ident->infoSimplC << 5) |
116
(psm_ident->infoGeometry));
114
(psm_ident->infoPortrait << 22) |
115
(psm_ident->infoSensor << 16) |
116
(psm_ident->infoHardware << 9) |
117
(psm_ident->infoNewAbs << 7) |
118
(psm_ident->capPen << 6) |
119
(psm_ident->infoSimplC << 5) |
120
(psm_ident->infoGeometry));
117
121
synhw->capabilities = ((psm_ident->capExtended << 23) |
118
(psm_ident->capPassthrough << 7) |
119
(psm_ident->capSleep << 4) |
120
(psm_ident->capFourButtons << 3) |
121
(psm_ident->capMultiFinger << 1) |
122
(psm_ident->capPalmDetect));
122
(psm_ident->capPassthrough << 7) |
123
(psm_ident->capSleep << 4) |
124
(psm_ident->capFourButtons << 3) |
125
(psm_ident->capMultiFinger << 1) |
126
(psm_ident->capPalmDetect));
123
127
synhw->ext_cap = 0;
124
128
synhw->identity = ((psm_ident->infoMajor) |
126
(psm_ident->infoMinor << 16));
129
(0x47 << 8) | (psm_ident->infoMinor << 16));
133
136
struct PS2SynapticsHwInfo *synhw;
134
137
SynapticsPrivate *priv;
136
priv = (SynapticsPrivate *)pInfo->private;
139
priv = (SynapticsPrivate *) pInfo->private;
138
if(!priv->proto_data)
141
if (!priv->proto_data)
139
142
priv->proto_data = calloc(1, sizeof(struct PS2SynapticsHwInfo));
140
synhw = (struct PS2SynapticsHwInfo*)priv->proto_data;
143
synhw = (struct PS2SynapticsHwInfo *) priv->proto_data;
142
145
/* is the synaptics touchpad active? */
143
146
if (!PSMQueryIsSynaptics(pInfo))
146
149
xf86IDrvMsg(pInfo, X_PROBED, "synaptics touchpad found\n");
148
151
if (!psm_synaptics_identify(pInfo->fd, &psm_ident))
151
154
convert_hw_info(&psm_ident, synhw);