summaryrefslogtreecommitdiff
path: root/x11-drivers/xf86-input-wacom/files/wacom.in
blob: 2d3b75e778ea48adb91445cfb61899eef30336cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: wacom
# REQUIRE: mountcritlocal
# BEFORE:  devd
# KEYWORD: nojail
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# wacom_enable (bool):	Set it to YES to add Wacom USB quirks on startup.
#			Default: NO

. /etc/rc.subr

name="wacom"
rcvar="wacom_enable"

load_rc_config "$name"

: ${wacom_enable:="NO"}

start_precmd="wacom_prepare"
start_cmd="wacom_start"
stop_cmd="wacom_stop"

wacom_prepare()
{
	kldload -n usb_quirk
}

wacom_start()
{
	# Prevent moused(8) from picking up bogus /dev/umsN
	usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_MATCH_VENDOR_ONLY
	usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
}

wacom_stop()
{
	usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff UQ_MATCH_VENDOR_ONLY
	usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
}

run_rc_command "$1"