Commit 81ad2e38 authored by Peter Hutterer's avatar Peter Hutterer

Use InputInfoPtr instead of LocalDevicePtr.

The latter is about to be removed from the server, InputInfoPtr has been
around in all supported server versions.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent b7dbe573
......@@ -87,9 +87,9 @@ ALPS_initialize(int fd)
}
static Bool
ALPSQueryHardware(LocalDevicePtr local)
ALPSQueryHardware(InputInfoPtr pInfo)
{
ALPS_initialize(local->fd);
ALPS_initialize(pInfo->fd);
return TRUE;
}
......@@ -103,7 +103,7 @@ ALPS_packet_ok(struct CommData *comm)
}
static Bool
ALPS_get_packet(struct CommData *comm, LocalDevicePtr local)
ALPS_get_packet(struct CommData *comm, InputInfoPtr pInfo)
{
int c;
......@@ -205,14 +205,14 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
}
static Bool
ALPSReadHwState(LocalDevicePtr local,
ALPSReadHwState(InputInfoPtr pInfo,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
unsigned char *buf = comm->protoBuf;
struct SynapticsHwState *hw = &(comm->hwState);
if (!ALPS_get_packet(comm, local))
if (!ALPS_get_packet(comm, pInfo))
return FALSE;
ALPS_process_packet(buf, hw);
......@@ -222,7 +222,7 @@ ALPSReadHwState(LocalDevicePtr local,
}
static Bool
ALPSAutoDevProbe(LocalDevicePtr local)
ALPSAutoDevProbe(InputInfoPtr pInfo)
{
return FALSE;
}
......
......@@ -56,9 +56,9 @@
****************************************************************************/
static void
EventDeviceOnHook(LocalDevicePtr local, SynapticsParameters *para)
EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters *para)
{
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
BOOL *need_grab;
if (!priv->proto_data)
......@@ -69,10 +69,10 @@ EventDeviceOnHook(LocalDevicePtr local, SynapticsParameters *para)
if (para->grab_event_device) {
/* Try to grab the event device so that data don't leak to /dev/input/mice */
int ret;
SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1));
SYSCALL(ret = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1));
if (ret < 0) {
xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n",
local->name, errno);
pInfo->name, errno);
}
}
......@@ -148,14 +148,14 @@ static model_lookup_t model_lookup_table[] = {
};
static void
event_query_info(LocalDevicePtr local)
event_query_info(InputInfoPtr pInfo)
{
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
short id[4];
int rc;
model_lookup_t *model_lookup;
SYSCALL(rc = ioctl(local->fd, EVIOCGID, id));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGID, id));
if (rc < 0)
return;
......@@ -168,19 +168,19 @@ event_query_info(LocalDevicePtr local)
/* Query device for axis ranges */
static void
event_query_axis_ranges(LocalDevicePtr local)
event_query_axis_ranges(InputInfoPtr pInfo)
{
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
struct input_absinfo abs = {0};
unsigned long absbits[NBITS(ABS_MAX)] = {0};
unsigned long keybits[NBITS(KEY_MAX)] = {0};
char buf[256];
int rc;
SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_X), &abs));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGABS(ABS_X), &abs));
if (rc >= 0)
{
xf86Msg(X_PROBED, "%s: x-axis range %d - %d\n", local->name,
xf86Msg(X_PROBED, "%s: x-axis range %d - %d\n", pInfo->name,
abs.minimum, abs.maximum);
priv->minx = abs.minimum;
priv->maxx = abs.maximum;
......@@ -188,13 +188,13 @@ event_query_axis_ranges(LocalDevicePtr local)
priv->resx = abs.resolution;
#endif
} else
xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", local->name,
xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", pInfo->name,
strerror(errno));
SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_Y), &abs));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGABS(ABS_Y), &abs));
if (rc >= 0)
{
xf86Msg(X_PROBED, "%s: y-axis range %d - %d\n", local->name,
xf86Msg(X_PROBED, "%s: y-axis range %d - %d\n", pInfo->name,
abs.minimum, abs.maximum);
priv->miny = abs.minimum;
priv->maxy = abs.maximum;
......@@ -202,27 +202,27 @@ event_query_axis_ranges(LocalDevicePtr local)
priv->resy = abs.resolution;
#endif
} else
xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", local->name,
xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", pInfo->name,
strerror(errno));
priv->has_pressure = FALSE;
priv->has_width = FALSE;
SYSCALL(rc = ioctl(local->fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
if (rc >= 0)
{
priv->has_pressure = (TEST_BIT(ABS_PRESSURE, absbits) != 0);
priv->has_width = (TEST_BIT(ABS_TOOL_WIDTH, absbits) != 0);
}
else
xf86Msg(X_ERROR, "%s: failed to query ABS bits (%s)\n", local->name,
xf86Msg(X_ERROR, "%s: failed to query ABS bits (%s)\n", pInfo->name,
strerror(errno));
if (priv->has_pressure)
{
SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_PRESSURE), &abs));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGABS(ABS_PRESSURE), &abs));
if (rc >= 0)
{
xf86Msg(X_PROBED, "%s: pressure range %d - %d\n", local->name,
xf86Msg(X_PROBED, "%s: pressure range %d - %d\n", pInfo->name,
abs.minimum, abs.maximum);
priv->minp = abs.minimum;
priv->maxp = abs.maximum;
......@@ -230,21 +230,21 @@ event_query_axis_ranges(LocalDevicePtr local)
} else
xf86Msg(X_INFO,
"%s: device does not report pressure, will use touch data.\n",
local->name);
pInfo->name);
if (priv->has_width)
{
SYSCALL(rc = ioctl(local->fd, EVIOCGABS(ABS_TOOL_WIDTH), &abs));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGABS(ABS_TOOL_WIDTH), &abs));
if (rc >= 0)
{
xf86Msg(X_PROBED, "%s: finger width range %d - %d\n", local->name,
xf86Msg(X_PROBED, "%s: finger width range %d - %d\n", pInfo->name,
abs.minimum, abs.maximum);
priv->minw = abs.minimum;
priv->maxw = abs.maximum;
}
}
SYSCALL(rc = ioctl(local->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits));
SYSCALL(rc = ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits));
if (rc >= 0)
{
buf[0] = 0;
......@@ -268,56 +268,56 @@ event_query_axis_ranges(LocalDevicePtr local)
strcat(buf, " scroll-buttons");
}
xf86Msg(X_PROBED, "%s: buttons:%s\n", local->name, buf);
xf86Msg(X_PROBED, "%s: buttons:%s\n", pInfo->name, buf);
}
}
static Bool
EventQueryHardware(LocalDevicePtr local)
EventQueryHardware(InputInfoPtr pInfo)
{
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
BOOL *need_grab = (BOOL*)priv->proto_data;
if (!event_query_is_touchpad(local->fd, (need_grab) ? *need_grab : TRUE))
if (!event_query_is_touchpad(pInfo->fd, (need_grab) ? *need_grab : TRUE))
return FALSE;
xf86Msg(X_PROBED, "%s: touchpad found\n", local->name);
xf86Msg(X_PROBED, "%s: touchpad found\n", pInfo->name);
return TRUE;
}
static Bool
SynapticsReadEvent(LocalDevicePtr local, struct input_event *ev)
SynapticsReadEvent(InputInfoPtr pInfo, struct input_event *ev)
{
int rc = TRUE;
ssize_t len;
len = read(local->fd, ev, sizeof(*ev));
len = read(pInfo->fd, ev, sizeof(*ev));
if (len <= 0)
{
/* We use X_NONE here because it doesn't alloc */
if (errno != EAGAIN)
xf86MsgVerb(X_NONE, 0, "%s: Read error %s\n", local->name, strerror(errno));
xf86MsgVerb(X_NONE, 0, "%s: Read error %s\n", pInfo->name, strerror(errno));
rc = FALSE;
} else if (len % sizeof(*ev)) {
xf86MsgVerb(X_NONE, 0, "%s: Read error, invalid number of bytes.", local->name);
xf86MsgVerb(X_NONE, 0, "%s: Read error, invalid number of bytes.", pInfo->name);
rc = FALSE;
}
return rc;
}
static Bool
EventReadHwState(LocalDevicePtr local,
EventReadHwState(InputInfoPtr pInfo,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
struct input_event ev;
Bool v;
struct SynapticsHwState *hw = &(comm->hwState);
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
SynapticsParameters *para = &priv->synpara;
while (SynapticsReadEvent(local, &ev)) {
while (SynapticsReadEvent(pInfo, &ev)) {
switch (ev.type) {
case EV_SYN:
switch (ev.code) {
......@@ -420,18 +420,18 @@ static int EventDevOnly(const struct dirent *dir) {
* Probe the open device for dimensions.
*/
static void
EventReadDevDimensions(LocalDevicePtr local)
EventReadDevDimensions(InputInfoPtr pInfo)
{
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
BOOL *need_grab = (BOOL*)priv->proto_data;
if (event_query_is_touchpad(local->fd, (need_grab) ? *need_grab : TRUE))
event_query_axis_ranges(local);
event_query_info(local);
if (event_query_is_touchpad(pInfo->fd, (need_grab) ? *need_grab : TRUE))
event_query_axis_ranges(pInfo);
event_query_info(pInfo);
}
static Bool
EventAutoDevProbe(LocalDevicePtr local)
EventAutoDevProbe(InputInfoPtr pInfo)
{
/* We are trying to find the right eventX device or fall back to
the psaux protocol and the given device from XF86Config */
......@@ -446,7 +446,7 @@ EventAutoDevProbe(LocalDevicePtr local)
}
else if (i == 0) {
xf86Msg(X_ERROR, "%s The /dev/input/event* device nodes seem to be missing\n",
local->name);
pInfo->name);
free(namelist);
return FALSE;
}
......@@ -464,9 +464,9 @@ EventAutoDevProbe(LocalDevicePtr local)
if (event_query_is_touchpad(fd, TRUE)) {
touchpad_found = TRUE;
xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n",
local->name, fname);
local->options =
xf86ReplaceStrOption(local->options, "Device", fname);
pInfo->name, fname);
pInfo->options =
xf86ReplaceStrOption(pInfo->options, "Device", fname);
}
SYSCALL(close(fd));
}
......@@ -475,7 +475,7 @@ EventAutoDevProbe(LocalDevicePtr local)
free(namelist);
if (!touchpad_found) {
xf86Msg(X_ERROR, "%s no synaptics event device found\n", local->name);
xf86Msg(X_ERROR, "%s no synaptics event device found\n", pInfo->name);
return FALSE;
}
return TRUE;
......
......@@ -132,9 +132,9 @@ InitFloatAtom(DeviceIntPtr dev, char *name, int nvalues, float *values)
}
void
InitDeviceProperties(LocalDevicePtr local)
InitDeviceProperties(InputInfoPtr pInfo)
{
SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
SynapticsParameters *para = &priv->synpara;
int values[9]; /* we never have more than 9 values in an atom */
float fvalues[4]; /* never have more than 4 float values */
......@@ -146,7 +146,7 @@ InitDeviceProperties(LocalDevicePtr local)
if (!float_type)
{
xf86Msg(X_ERROR, "%s: Failed to init float atom. "
"Disabling property support.\n", local->name);
"Disabling property support.\n", pInfo->name);
return;
}
}
......@@ -156,108 +156,108 @@ InitDeviceProperties(LocalDevicePtr local)
values[2] = para->top_edge;
values[3] = para->bottom_edge;
prop_edges = InitAtom(local->dev, SYNAPTICS_PROP_EDGES, 32, 4, values);
prop_edges = InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGES, 32, 4, values);
values[0] = para->finger_low;
values[1] = para->finger_high;
values[2] = para->finger_press;
prop_finger = InitAtom(local->dev, SYNAPTICS_PROP_FINGER, 32, 3, values);
prop_tap_time = InitAtom(local->dev, SYNAPTICS_PROP_TAP_TIME, 32, 1, &para->tap_time);
prop_tap_move = InitAtom(local->dev, SYNAPTICS_PROP_TAP_MOVE, 32, 1, &para->tap_move);
prop_finger = InitAtom(pInfo->dev, SYNAPTICS_PROP_FINGER, 32, 3, values);
prop_tap_time = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_TIME, 32, 1, &para->tap_time);
prop_tap_move = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_MOVE, 32, 1, &para->tap_move);
values[0] = para->single_tap_timeout;
values[1] = para->tap_time_2;
values[2] = para->click_time;
prop_tap_durations = InitAtom(local->dev, SYNAPTICS_PROP_TAP_DURATIONS, 32, 3, values);
prop_tap_fast = InitAtom(local->dev, SYNAPTICS_PROP_TAP_FAST, 8, 1, &para->fast_taps);
prop_middle_timeout = InitAtom(local->dev, SYNAPTICS_PROP_MIDDLE_TIMEOUT,
prop_tap_durations = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_DURATIONS, 32, 3, values);
prop_tap_fast = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_FAST, 8, 1, &para->fast_taps);
prop_middle_timeout = InitAtom(pInfo->dev, SYNAPTICS_PROP_MIDDLE_TIMEOUT,
32, 1, &para->emulate_mid_button_time);
prop_twofinger_pressure = InitAtom(local->dev, SYNAPTICS_PROP_TWOFINGER_PRESSURE,
prop_twofinger_pressure = InitAtom(pInfo->dev, SYNAPTICS_PROP_TWOFINGER_PRESSURE,
32, 1, &para->emulate_twofinger_z);
prop_twofinger_width = InitAtom(local->dev, SYNAPTICS_PROP_TWOFINGER_WIDTH,
prop_twofinger_width = InitAtom(pInfo->dev, SYNAPTICS_PROP_TWOFINGER_WIDTH,
32, 1, &para->emulate_twofinger_w);
values[0] = para->scroll_dist_vert;
values[1] = para->scroll_dist_horiz;
prop_scrolldist = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 2, values);
prop_scrolldist = InitAtom(pInfo->dev, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 2, values);
values[0] = para->scroll_edge_vert;
values[1] = para->scroll_edge_horiz;
values[2] = para->scroll_edge_corner;
prop_scrolledge = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_EDGE,8, 3, values);
prop_scrolledge = InitAtom(pInfo->dev, SYNAPTICS_PROP_SCROLL_EDGE,8, 3, values);
values[0] = para->scroll_twofinger_vert;
values[1] = para->scroll_twofinger_horiz;
prop_scrolltwofinger = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_TWOFINGER,8, 2, values);
prop_scrolltwofinger = InitAtom(pInfo->dev, SYNAPTICS_PROP_SCROLL_TWOFINGER,8, 2, values);
fvalues[0] = para->min_speed;
fvalues[1] = para->max_speed;
fvalues[2] = para->accl;
fvalues[3] = para->trackstick_speed;
prop_speed = InitFloatAtom(local->dev, SYNAPTICS_PROP_SPEED, 4, fvalues);
prop_speed = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_SPEED, 4, fvalues);
values[0] = para->edge_motion_min_z;
values[1] = para->edge_motion_max_z;
prop_edgemotion_pressure = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32, 2, values);
prop_edgemotion_pressure = InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32, 2, values);
values[0] = para->edge_motion_min_speed;
values[1] = para->edge_motion_max_speed;
prop_edgemotion_speed = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32, 2, values);
prop_edgemotion_always = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION, 8, 1, &para->edge_motion_use_always);
prop_edgemotion_speed = InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32, 2, values);
prop_edgemotion_always = InitAtom(pInfo->dev, SYNAPTICS_PROP_EDGEMOTION, 8, 1, &para->edge_motion_use_always);
if (priv->has_scrollbuttons)
{
values[0] = para->updown_button_scrolling;
values[1] = para->leftright_button_scrolling;
prop_buttonscroll = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values);
prop_buttonscroll = InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values);
values[0] = para->updown_button_repeat;
values[1] = para->leftright_button_repeat;
prop_buttonscroll_repeat = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, values);
prop_buttonscroll_time = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, &para->scroll_button_repeat);
prop_buttonscroll_repeat = InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, values);
prop_buttonscroll_time = InitAtom(pInfo->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, &para->scroll_button_repeat);
}
prop_off = InitAtom(local->dev, SYNAPTICS_PROP_OFF, 8, 1, &para->touchpad_off);
prop_lockdrags = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 1, &para->locked_drags);
prop_lockdrags_time = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 1, &para->locked_drag_time);
prop_off = InitAtom(pInfo->dev, SYNAPTICS_PROP_OFF, 8, 1, &para->touchpad_off);
prop_lockdrags = InitAtom(pInfo->dev, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 1, &para->locked_drags);
prop_lockdrags_time = InitAtom(pInfo->dev, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 1, &para->locked_drag_time);
memcpy(values, para->tap_action, MAX_TAP * sizeof(int));
prop_tapaction = InitAtom(local->dev, SYNAPTICS_PROP_TAP_ACTION, 8, MAX_TAP, values);
prop_tapaction = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_ACTION, 8, MAX_TAP, values);
memcpy(values, para->click_action, MAX_CLICK * sizeof(int));
prop_clickaction = InitAtom(local->dev, SYNAPTICS_PROP_CLICK_ACTION, 8, MAX_CLICK, values);
prop_clickaction = InitAtom(pInfo->dev, SYNAPTICS_PROP_CLICK_ACTION, 8, MAX_CLICK, values);
prop_circscroll = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 1, &para->circular_scrolling);
prop_circscroll = InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 1, &para->circular_scrolling);
fvalues[0] = para->scroll_dist_circ;
prop_circscroll_dist = InitFloatAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 1, fvalues);
prop_circscroll_dist = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 1, fvalues);
prop_circscroll_trigger = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 1, &para->circular_trigger);
prop_circpad = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1, &para->circular_pad);
prop_palm = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DETECT, 8, 1, &para->palm_detect);
prop_circscroll_trigger = InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 1, &para->circular_trigger);
prop_circpad = InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1, &para->circular_pad);
prop_palm = InitAtom(pInfo->dev, SYNAPTICS_PROP_PALM_DETECT, 8, 1, &para->palm_detect);
values[0] = para->palm_min_width;
values[1] = para->palm_min_z;
prop_palm_dim = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 2, values);
prop_palm_dim = InitAtom(pInfo->dev, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 2, values);
fvalues[0] = para->coasting_speed;
prop_coastspeed = InitFloatAtom(local->dev, SYNAPTICS_PROP_COASTING_SPEED, 1, fvalues);
prop_coastspeed = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_COASTING_SPEED, 1, fvalues);
values[0] = para->press_motion_min_z;
values[1] = para->press_motion_max_z;
prop_pressuremotion = InitAtom(local->dev, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 2, values);
prop_pressuremotion = InitAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 2, values);
fvalues[0] = para->press_motion_min_factor;
fvalues[1] = para->press_motion_max_factor;
prop_pressuremotion_factor = InitFloatAtom(local->dev, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 2, fvalues);
prop_pressuremotion_factor = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 2, fvalues);
prop_grab = InitAtom(local->dev, SYNAPTICS_PROP_GRAB, 8, 1, &para->grab_event_device);
prop_grab = InitAtom(pInfo->dev, SYNAPTICS_PROP_GRAB, 8, 1, &para->grab_event_device);
values[0] = para->tap_and_drag_gesture;
prop_gestures = InitAtom(local->dev, SYNAPTICS_PROP_GESTURES, 8, 1, values);
prop_gestures = InitAtom(pInfo->dev, SYNAPTICS_PROP_GESTURES, 8, 1, values);
values[0] = priv->has_left;
values[1] = priv->has_middle;
......@@ -266,25 +266,25 @@ InitDeviceProperties(LocalDevicePtr local)
values[4] = priv->has_triple;
values[5] = priv->has_pressure;
values[6] = priv->has_width;
prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 7, values);
prop_capabilities = InitAtom(pInfo->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 7, values);
values[0] = para->resolution_vert;
values[1] = para->resolution_horiz;
prop_resolution = InitAtom(local->dev, SYNAPTICS_PROP_RESOLUTION, 32, 2, values);
prop_resolution = InitAtom(pInfo->dev, SYNAPTICS_PROP_RESOLUTION, 32, 2, values);
values[0] = para->area_left_edge;
values[1] = para->area_right_edge;
values[2] = para->area_top_edge;
values[3] = para->area_bottom_edge;
prop_area = InitAtom(local->dev, SYNAPTICS_PROP_AREA, 32, 4, values);
prop_area = InitAtom(pInfo->dev, SYNAPTICS_PROP_AREA, 32, 4, values);
}
int
SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
BOOL checkonly)
{
LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
InputInfoPtr pInfo = dev->public.devicePrivate;
SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
SynapticsParameters *para = &priv->synpara;
SynapticsParameters tmp;
......
......@@ -377,17 +377,17 @@ ps2_print_ident(const struct SynapticsHwInfo *synhw)
}
static void
PS2DeviceOffHook(LocalDevicePtr local)
PS2DeviceOffHook(InputInfoPtr pInfo)
{
ps2_synaptics_reset(local->fd);
ps2_synaptics_enable_device(local->fd);
ps2_synaptics_reset(pInfo->fd);
ps2_synaptics_enable_device(pInfo->fd);
}
static Bool
PS2QueryHardware(LocalDevicePtr local)
PS2QueryHardware(InputInfoPtr pInfo)
{
int mode;
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
struct SynapticsHwInfo *synhw;
if (!priv->proto_data)
......@@ -395,21 +395,21 @@ PS2QueryHardware(LocalDevicePtr local)
synhw = (struct SynapticsHwInfo*)priv->proto_data;
/* is the synaptics touchpad active? */
if (!ps2_query_is_synaptics(local->fd, synhw))
if (!ps2_query_is_synaptics(pInfo->fd, synhw))
return FALSE;
xf86Msg(X_PROBED, "%s synaptics touchpad found\n", local->name);
xf86Msg(X_PROBED, "%s synaptics touchpad found\n", pInfo->name);
if (!ps2_synaptics_reset(local->fd))
xf86Msg(X_ERROR, "%s reset failed\n", local->name);
if (!ps2_synaptics_reset(pInfo->fd))
xf86Msg(X_ERROR, "%s reset failed\n", pInfo->name);
if (!ps2_synaptics_identify(local->fd, synhw))
if (!ps2_synaptics_identify(pInfo->fd, synhw))
return FALSE;
if (!ps2_synaptics_model_id(local->fd, synhw))
if (!ps2_synaptics_model_id(pInfo->fd, synhw))
return FALSE;
if (!ps2_synaptics_capability(local->fd, synhw))
if (!ps2_synaptics_capability(pInfo->fd, synhw))
return FALSE;
mode = SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
......@@ -417,10 +417,10 @@ PS2QueryHardware(LocalDevicePtr local)
mode |= SYN_BIT_DISABLE_GESTURE;
if (SYN_CAP_EXTENDED(synhw))
mode |= SYN_BIT_W_MODE;
if (!ps2_synaptics_set_mode(local->fd, mode))
if (!ps2_synaptics_set_mode(pInfo->fd, mode))
return FALSE;
ps2_synaptics_enable_device(local->fd);
ps2_synaptics_enable_device(pInfo->fd);
ps2_print_ident(synhw);
......@@ -460,7 +460,7 @@ ps2_packet_ok(struct SynapticsHwInfo *synhw, struct CommData *comm)
}
static Bool
ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
ps2_synaptics_get_packet(InputInfoPtr pInfo, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm)
{
......@@ -473,9 +473,9 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
/* test if there is a reset sequence received */
if ((c == 0x00) && (comm->lastByte == 0xAA)) {
if (xf86WaitForInput(local->fd, 50000) == 0) {
if (xf86WaitForInput(pInfo->fd, 50000) == 0) {
DBG(7, "Reset received\n");
proto_ops->QueryHardware(local);
proto_ops->QueryHardware(pInfo);
} else
DBG(3, "faked reset received\n");
}
......@@ -501,7 +501,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if (comm->outOfSync > MAX_UNSYNC_PACKETS) {
comm->outOfSync = 0;
DBG(3, "Synaptics synchronization lost too long -> reset touchpad.\n");
proto_ops->QueryHardware(local); /* including a reset */
proto_ops->QueryHardware(pInfo); /* including a reset */
continue;
}
}
......@@ -521,13 +521,13 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
}
static Bool