diff options
author | Ping Cheng <pinglinux@gmail.com> | 2009-11-27 19:49:17 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-11-30 13:24:05 +1000 |
commit | 0c9419360da976c6580af4615b244bc112d748cd (patch) | |
tree | 3bf3646fc349b7d87a3b94f621e951e1a7bb5274 /src/wcmConfig.c | |
parent | 54387e477904cadf3a0ebfc37567f808d4b94cce (diff) | |
download | xf86-input-wacom-0c9419360da976c6580af4615b244bc112d748cd.tar.gz |
Support serial hotplugging.
USB devices use the KEY_* bits to determine the capabilities. Serial devices
fake up those bits depending on the ID announced. Then pass those bits
between wcmConfig.c and wcmValidateDevice.c
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/wcmConfig.c')
-rw-r--r-- | src/wcmConfig.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 4313d72..4613231 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -27,12 +27,14 @@ #include <fcntl.h> extern Bool xf86WcmIsWacomDevice (char* fname); -extern int wcmIsAValidType(LocalDevicePtr local, const char* type); +extern Bool wcmIsAValidType(const char* type, unsigned long* keys); extern int wcmIsDuplicate(char* device, LocalDevicePtr local); -extern int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type); +extern int wcmNeedAutoHotplug(LocalDevicePtr local, + const char **type, unsigned long* keys); extern int wcmAutoProbeDevice(LocalDevicePtr local); extern int wcmParseOptions(LocalDevicePtr local); -extern void wcmHotplugOthers(LocalDevicePtr local); +extern void wcmHotplugOthers(LocalDevicePtr local, unsigned long* keys); +extern int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys); static int xf86WcmAllocate(LocalDevicePtr local, char* name, int flag); @@ -420,6 +422,7 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags) char* device; static int numberWacom = 0; int need_hotplug = 0; + unsigned long keys[NBITS(KEY_MAX)]; gWacomModule.wcmDrv = drv; @@ -434,15 +437,18 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags) */ xf86CollectInputOptions(local, default_options, NULL); + /* initialize supported keys */ + wcmDeviceTypeKeys(local, keys); + device = xf86SetStrOption(local->options, "Device", NULL); type = xf86FindOptionValue(local->options, "Type"); - need_hotplug = wcmNeedAutoHotplug(local, &type); + need_hotplug = wcmNeedAutoHotplug(local, &type, keys); /* leave the undefined for auto-dev (if enabled) to deal with */ if(device) { /* check if the type is valid for those don't need hotplug */ - if(!need_hotplug && !wcmIsAValidType(local, type)) + if(!need_hotplug && !wcmIsAValidType(type, keys)) goto SetupProc_fail; /* check if the device has been added */ @@ -491,7 +497,7 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags) if (need_hotplug) { priv->isParent = 1; - wcmHotplugOthers(local); + wcmHotplugOthers(local, keys); } /* return the LocalDevice */ |