diff options
Diffstat (limited to 'recipes-core/udev/files/verdin-imx8mp')
-rw-r--r-- | recipes-core/udev/files/verdin-imx8mp/99-toradex.rules | 13 | ||||
-rwxr-xr-x | recipes-core/udev/files/verdin-imx8mp/toradex-adc.sh | 21 |
2 files changed, 34 insertions, 0 deletions
diff --git a/recipes-core/udev/files/verdin-imx8mp/99-toradex.rules b/recipes-core/udev/files/verdin-imx8mp/99-toradex.rules new file mode 100644 index 0000000..f1554e2 --- /dev/null +++ b/recipes-core/udev/files/verdin-imx8mp/99-toradex.rules @@ -0,0 +1,13 @@ +ACTION=="add", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a50000.i2c", SYMLINK+="verdin-i2c1" +ACTION=="add", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a30000.i2c", SYMLINK+="verdin-i2c2" +ACTION=="add", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a40000.i2c", SYMLINK+="verdin-i2c4" +ACTION=="add", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a20000.i2c", SYMLINK+="verdin-i2c-on-module" +ACTION=="add", ATTRS{iomem_base}=="0x30860000", SYMLINK+="verdin-uart1" +ACTION=="add", ATTRS{iomem_base}=="0x30890000", SYMLINK+="verdin-uart2" +ACTION=="add", ATTRS{iomem_base}=="0x30880000", SYMLINK+="verdin-uart3" +ACTION=="add", KERNELS=="watchdog", SYMLINK+="verdin-watchdog" +ACTION=="add", SUBSYSTEM=="spidev", KERNELS=="30820000.ecspi", SYMLINK+="verdin-spi-cs%n" +KERNEL=="mmcblk[0-9]", ENV{DEVTYPE}=="disk", KERNELS=="30b60000.mmc", SYMLINK+="emmc" +KERNEL=="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", KERNELS=="30b60000.mmc", SYMLINK+="emmc-boot%n" +KERNEL=="mmcblk[0-9]p[0-9]", ENV{DEVTYPE}=="partition", KERNELS=="30b60000.mmc", SYMLINK+="emmc-part%n" +SUBSYSTEM=="iio", KERNELS=="iio:device0", RUN+="/etc/udev/scripts/toradex-adc.sh" diff --git a/recipes-core/udev/files/verdin-imx8mp/toradex-adc.sh b/recipes-core/udev/files/verdin-imx8mp/toradex-adc.sh new file mode 100755 index 0000000..1591170 --- /dev/null +++ b/recipes-core/udev/files/verdin-imx8mp/toradex-adc.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +# +# Called from udev. Compatible to verdin-imx8mp. +# +# Create/remove symlinks to/from the files with raw adc data. + +# Map the ADC lines: +# verdin-adc{1..4} -> TLA2024 ADC{3,2,1,0} + +if [ "$ACTION" = "add" ]; then + ln -s "/sys$DEVPATH/in_voltage0_raw" /dev/verdin-adc4 + ln -s "/sys$DEVPATH/in_voltage1_raw" /dev/verdin-adc3 + ln -s "/sys$DEVPATH/in_voltage2_raw" /dev/verdin-adc2 + ln -s "/sys$DEVPATH/in_voltage3_raw" /dev/verdin-adc1 +elif [ "$ACTION" = "remove" ]; then + rm -f /dev/verdin-adc1 + rm -f /dev/verdin-adc2 + rm -f /dev/verdin-adc3 + rm -f /dev/verdin-adc4 +fi + |