summaryrefslogtreecommitdiff
path: root/recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-08-06 16:27:35 +0300
committerMax Krummenacher <max.krummenacher@toradex.com>2020-09-14 09:46:55 +0200
commit9629e9a7ff89ebf6d6ca62d94fc0980647bbb8fd (patch)
treeec93237374530e8efbd1b52e74a3978a7bc008b8 /recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh
parentf83e42462cba0b445662140cf6a9ae7b99de225b (diff)
colibri-imx6ull: udev: add symlink to adc raw data
Create symlinks for each supported by Colibri iMX6ULL ADC channels, standardizing names as colibri-ainX, according to the Colibri signal names table. Related-to: ELB-2839 Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> (cherry picked from commit 26f58c5c34bac69c1a9b312242e92decd532cd14)
Diffstat (limited to 'recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh')
-rwxr-xr-xrecipes-core/udev/files/colibri-imx6ull/toradex-adc.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh b/recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh
new file mode 100755
index 0000000..b56593f
--- /dev/null
+++ b/recipes-core/udev/files/colibri-imx6ull/toradex-adc.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+#
+# Called from udev. Compatible to colibri-imx8x.
+#
+# Create/remove symlinks to/from the files with raw ain data.
+
+# Map the ADC lines:
+# colibri-ain{0..3} -> ADCx_IN{0,1,8,9}
+
+if [ "$ACTION" = "add" ]; then
+ ln -s "/sys$DEVPATH/in_voltage0_raw" /dev/colibri-ain0
+ ln -s "/sys$DEVPATH/in_voltage1_raw" /dev/colibri-ain1
+ ln -s "/sys$DEVPATH/in_voltage8_raw" /dev/colibri-ain2
+ ln -s "/sys$DEVPATH/in_voltage9_raw" /dev/colibri-ain3
+elif [ "$ACTION" = "remove" ]; then
+ rm -f /dev/colibri-ain0
+ rm -f /dev/colibri-ain1
+ rm -f /dev/colibri-ain2
+ rm -f /dev/colibri-ain3
+fi
+