-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path90-MCP2221-LibUsbDotNet.rules
25 lines (23 loc) · 1.07 KB
/
90-MCP2221-LibUsbDotNet.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# SPDX-FileCopyrightText: 2021 smdn <[email protected]>
# SPDX-License-Identifier: MIT
#
# udev rules for MCP2221/MCP2221A + LibUsbDotNet (libusb)
#
# copy this file to `/etc/udev/rules.d/` and run `sudo udevadm control --reload-rules && sudo udevadm trigger -s usb`
# tested on Ubuntu 20.04.2 LTS
#
# reference:
# http://reactivated.net/writing_udev_rules.html
# https://wiki.archlinux.jp/index.php/Udev
#
SUBSYSTEM=="usb", DRIVER=="usb|usbhid", \
# [mandatory] matching keys for MCP2221/MCP2221A
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", \
# [optional] matching keys for the device bus number and device path of MCP2221/MCP2221A
# ATTRS{busnum}=="x", ATTRS{devpath}!="y", \
# [mandatory] unbind kernel driver from MCP2221/MCP2221A's HID interface
RUN+="/bin/sh -c 'echo $kernel >/sys/bus/usb/drivers/usbhid/unbind'", \
# [optional] grant non-root user access to MCP2221/MCP2221A by specifying group for the device
GROUP="plugdev", TAG+="uaccess", \
# [optional] grant non-root user access to MCP2221/MCP2221A by specifying permission for the device
# MODE="0666", \