diff options
author | Ping Cheng <pinglinux@gmail.com> | 2009-11-27 20:08:52 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-11-30 13:34:18 +1000 |
commit | 693913e55b3244c7728737e55069c3ffc5c6c16f (patch) | |
tree | 1c2ba0968e9a05d2f00fd5045a31d2d718e92306 /src/wcmValidateDevice.c | |
parent | 0c9419360da976c6580af4615b244bc112d748cd (diff) | |
download | xf86-input-wacom-693913e55b3244c7728737e55069c3ffc5c6c16f.tar.gz |
Remove ForceDevice option - now unused.
Since we only support ISDV4 serial devices with this driver, there is no
need to check the "ForceDevice" option any more, which was used to
distinguish ISDV4 from regular serial devices.
We check if the device is a serial device or not by accessing its file
descriptor directly.
Device Class is assigned to USB by default.
Signed-off-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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", |