diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-11-25 20:32:53 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-20 15:01:56 +1000 |
commit | 36392bb42a9f34e9b9b4f4045d1db7616f57c059 (patch) | |
tree | 74d904333e11139af8c7491f09b8e0a29d8a6f7f /src | |
parent | 33389874192bdc844865e086cc31a9b022906206 (diff) | |
download | xf86-input-wacom-36392bb42a9f34e9b9b4f4045d1db7616f57c059.tar.gz |
Add a wcmDevStop() and move it to the driver layer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/wcmConfig.c | 10 | ||||
-rw-r--r-- | src/xf86Wacom.c | 6 | ||||
-rw-r--r-- | src/xf86Wacom.h | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 72d7b79..7772d5e 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -874,6 +874,16 @@ Bool wcmDevStart(WacomDevicePtr priv) return TRUE; } +void wcmDevStop(WacomDevicePtr priv) +{ + + TimerCancel(priv->tap_timer); + TimerCancel(priv->serial_timer); + TimerCancel(priv->touch_timer); + wcmDisableTool(priv); + wcmUnlinkTouchAndPen(priv); +} + /***************************************************************************** * wcmDevClose -- ****************************************************************************/ diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c index a43f507..7425736 100644 --- a/src/xf86Wacom.c +++ b/src/xf86Wacom.c @@ -612,11 +612,7 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what) break; case DEVICE_OFF: - TimerCancel(priv->tap_timer); - TimerCancel(priv->serial_timer); - TimerCancel(priv->touch_timer); - wcmDisableTool(priv); - wcmUnlinkTouchAndPen(priv); + wcmDevStop(priv); if (pInfo->fd >= 0) { xf86RemoveEnabledDevice(pInfo); diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h index 3f2c3ba..9598347 100644 --- a/src/xf86Wacom.h +++ b/src/xf86Wacom.h @@ -122,6 +122,7 @@ int wcmDevOpen(WacomDevicePtr priv); /* Close the **shared** fd, if necessary */ void wcmDevClose(WacomDevicePtr priv); Bool wcmDevStart(WacomDevicePtr priv); +void wcmDevStop(WacomDevicePtr priv); /* Open the device with the right serial parmeters */ |