diff options
Diffstat (limited to 'src/wcmValidateDevice.c')
-rw-r--r-- | src/wcmValidateDevice.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 44e3b85..ceb1680 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -401,6 +401,8 @@ int wcmParseOptions(LocalDevicePtr local) int i, oldButton; WacomToolPtr tool = NULL; WacomToolAreaPtr area = NULL; + int fd, rc; + struct serial_struct ser; /* Optional configuration */ priv->debugLevel = xf86SetIntOption(local->options, @@ -437,22 +439,28 @@ int wcmParseOptions(LocalDevicePtr local) if (local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER)) priv->flags |= COREEVENT_FLAG; - /* ISDV4 support */ - s = xf86SetStrOption(local->options, "ForceDevice", NULL); + SYSCALL(fd = open(common->wcmDevice, O_RDONLY)); + if (!fd) + { + xf86Msg(X_WARNING, "%s: failed to open %s in " + "wcmParseOptions", local->name, + common->wcmDevice); + goto error; + } + rc = ioctl(fd, TIOCGSERIAL, &ser); + close(fd); - if (s) + /* not a serial device. Must be USB (bluetooth is considered as USB) */ + if (rc) + common->wcmDevCls = &gWacomUSBDevice; + else /* serial device */ { - if (xf86NameCmp(s, "ISDV4") == 0) - { - common->wcmForceDevice=DEVICE_ISDV4; - common->wcmDevCls = &gWacomISDV4Device; - common->wcmTPCButtonDefault = 1; /* Tablet PC buttons on by default */ - } else - { - xf86Msg(X_ERROR, "%s: invalid ForceDevice option '%s'.\n", - local->name, s); - goto error; - } + /* We only support serial ISDV4 devices for X server 1.7+ */ + common->wcmForceDevice = DEVICE_ISDV4; + common->wcmDevCls = &gWacomISDV4Device; + + /* Tablet PC buttons on by default */ + common->wcmTPCButtonDefault = 1; } s = xf86SetStrOption(local->options, "Rotate", NULL); @@ -495,10 +503,6 @@ int wcmParseOptions(LocalDevicePtr local) common->wcmFlags |= RAW_FILTERING_FLAG; } - if (xf86SetBoolOption(local->options, "USB", - (common->wcmDevCls == &gWacomUSBDevice))) - common->wcmDevCls = &gWacomUSBDevice; - /* pressure curve takes control points x1,y1,x2,y2 * values in range from 0..100. * Linear curve is 0,0,100,100 @@ -618,7 +622,7 @@ int wcmParseOptions(LocalDevicePtr local) common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", common->wcmMaxY); else - common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", + common->wcmMaxTouchY = xf86SetIntOption(local->options, "MaxY", common->wcmMaxTouchY); common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", |