diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-27 16:56:57 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-31 14:43:59 +1000 |
commit | de8c3a5430c71d3a52d2dc3362743b791256d847 (patch) | |
tree | 375a66fd010bd3cb3d4f563686bc61d7a378bf0a | |
parent | 77b0ed05d29b8f71784af60fe56b111b91c7107f (diff) |
Export device node as property.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/properties.c | 16 | ||||
-rw-r--r-- | src/synaptics.c | 2 | ||||
-rw-r--r-- | src/synapticsstr.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/properties.c b/src/properties.c index 4e831dc..ea6e40f 100644 --- a/src/properties.c +++ b/src/properties.c @@ -47,6 +47,10 @@ #define XI_PROP_PRODUCT_ID "Device Product ID" #endif +#ifndef XI_PROP_DEVICE_NODE +#define XI_PROP_DEVICE_NODE "Device Node" +#endif + static Atom float_type; Atom prop_edges = 0; @@ -89,6 +93,7 @@ Atom prop_resolution = 0; Atom prop_area = 0; Atom prop_noise_cancellation = 0; Atom prop_product_id = 0; +Atom prop_device_node = 0; static Atom InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) @@ -299,6 +304,15 @@ InitDeviceProperties(InputInfoPtr pInfo) prop_product_id = InitAtom(pInfo->dev, XI_PROP_PRODUCT_ID, 32, 2, values); } + if (priv->device) + { + prop_device_node = MakeAtom(XI_PROP_DEVICE_NODE, strlen(XI_PROP_DEVICE_NODE), TRUE); + XIChangeDeviceProperty(pInfo->dev, prop_device_node, XA_STRING, 8, + PropModeReplace, strlen(priv->device), + priv->device, FALSE); + XISetDevicePropertyDeletable(pInfo->dev, prop_device_node, FALSE); + } + } int @@ -680,7 +694,7 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, return BadValue; para->hyst_x = hyst[0]; para->hyst_y = hyst[1]; - } else if (property == prop_product_id) + } else if (property == prop_product_id || property == prop_device_node) return BadValue; /* read-only */ return Success; diff --git a/src/synaptics.c b/src/synaptics.c index 7be1a7a..d3b637c 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -694,6 +694,8 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) goto SetupProc_fail; } + priv->device = xf86FindOptionValue(pInfo->options, "Device"); + /* open the touchpad device */ pInfo->fd = xf86OpenSerial(pInfo->options); if (pInfo->fd == -1) { diff --git a/src/synapticsstr.h b/src/synapticsstr.h index e9ac7cb..35331b2 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -175,6 +175,7 @@ typedef struct _SynapticsPrivateRec struct SynapticsHwState hwState; + char *device; /* device node */ Bool shm_config; /* True when shared memory area allocated */ OsTimerPtr timer; /* for up/down-button repeat, tap processing, etc */ |