build/packages/bsp/jethub/jethubj100/90-jethub-rs485-aliases.rules

23 lines
983 B
Plaintext

ACTION=="remove", GOTO="serial_end"
SUBSYSTEM!="tty", GOTO="serial_end"
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
# /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
KERNEL!="ttyUSB[0-9]*", GOTO="serial_end"
SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}"
IMPORT{builtin}="path_id"
ENV{ID_BUS}=="", GOTO="serial_end"
ENV{ID_SERIAL}=="", GOTO="serial_end"
ENV{ID_USB_INTERFACE_NUM}=="", GOTO="serial_end"
# CP2105, rev >1.8
ENV{ID_PATH}=="platform-xhci-hcd.0.auto-usb-0:1.1:1.*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea70", SYMLINK+="serial/rs485/ttyRS485-$env{ID_USB_INTERFACE_NUM}"
# CP2104, rev <=1.8
ENV{ID_PATH}=="platform-xhci-hcd.0.auto-usb-0:1.1:1.0", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="serial/rs485/ttyRS485-00"
ENV{ID_PATH}=="platform-xhci-hcd.0.auto-usb-0:1.2:1.0", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="serial/rs485/ttyRS485-01"
LABEL="serial_end"