-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path50-revpi.rules
executable file
·35 lines (30 loc) · 1.92 KB
/
50-revpi.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
25
26
27
28
29
30
31
32
33
34
35
PROGRAM="/bin/grep -Fz -m 1 'kunbus,revpi-' /sys/firmware/devicetree/base/compatible"
RESULT=="kunbus,revpi-core", GOTO="revpi_core"
RESULT=="kunbus,revpi-connect", GOTO="revpi_connect"
RESULT=="kunbus,revpi-compact", GOTO="revpi_compact"
RESULT=="kunbus,revpi-flat", GOTO="revpi_flat"
GOTO="revpi_end"
LABEL="revpi_core"
ACTION=="add", DEVPATH=="*/spi0.0/net/*eth*", NAME="pileft", ENV{SYSTEMD_WANTS}="pileft.service"
ACTION=="add", DEVPATH=="*/spi0.1/net/*eth*", NAME="piright", ENV{SYSTEMD_WANTS}="piright.service"
GOTO="revpi_end"
LABEL="revpi_connect"
ACTION=="add", DEVPATH=="*/usb1/1-1/1-1.5/1-1.5.2/*", SUBSYSTEM=="tty", SYMLINK+="ttyRS485"
ACTION=="add", DEVPATH=="*/usb1/1-1/1-1.5/1-1.5.3/*", SUBSYSTEM=="tty", SYMLINK+="ttyConBridge"
ACTION=="add", DEVPATH=="*/spi0.1/net/*eth*", NAME="pileft"
GOTO="revpi_end"
LABEL="revpi_compact"
ACTION=="add", ENV{OF_COMPATIBLE_0}=="fairchild,74hc595", SYMLINK+="gpiochip_dout"
ACTION=="add", ENV{OF_COMPATIBLE_0}=="maxim,max31913", SYMLINK+="gpiochip_din"
ACTION=="add", DEVPATH=="*/spi0.2/net/*eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DEVPATH=="*/usb1/1-1/1-1.[2-5]*", NAME="usbnet%n"
ACTION=="add", DEVPATH=="*/ttyAMA0", SYMLINK+="ttyRS485"
ACTION=="add", DEVPATH=="*/i2c-1/1-0050/1-00500", RUN+="/bin/chgrp pi /sys%p/nvmem", RUN+="/bin/chmod g+rw /sys%p/nvmem"
ACTION=="add", DEVPATH=="/devices/platform/leds/leds/*", RUN+="/bin/chgrp pi /sys%p/brightness", RUN+="/bin/chmod g+rw /sys%p/brightness"
ACTION=="add", DEVPATH=="*/spi2.0/iio:device*", RUN+="/bin/chgrp pi /sys%p/out_voltage0_raw /sys%p/out_voltage1_raw /sys%p/out_voltage_powerdown /sys%p/out_voltage_powerdown_mode", RUN+="/bin/chmod g+rw /sys%p/out_voltage0_raw /sys%p/out_voltage1_raw /sys%p/out_voltage_powerdown /sys%p/out_voltage_powerdown_mode"
GOTO="revpi_end"
LABEL="revpi_flat"
ACTION=="add", DEVPATH=="*/ttyAMA0", SYMLINK+="ttyRS485-0"
ACTION=="add", DEVPATH=="*/ttyS0", SYMLINK+="ttyRS485-1"
GOTO="revpi_end"
LABEL="revpi_end"