How to detect TK1 v1.2 in Linux?

From TK1 v1.1 to v1.2 the I2C bus 2 was moved to 3.
I’d like to detect which hardware I am running on, so that this change transparent to already existing client sofware.

Based on this change u-boot-toradex.git - U-Boot bootloader for Apalis and Colibri modules (taken from Apalis TK1 V1.2A Specific Software Modifications), I deduced that GPIO_PV0 should be usable in Linux to detect TK1 v1.2.
So I tried to read gpio168 (which should be the same as GPIO_PV0 based on tegra-gpio.h - include/dt-bindings/gpio/tegra-gpio.h - Linux source code (v5.13.1) - Bootlin) using:

echo 168 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio168/direction
cat /sys/class/gpio/gpio168/value

That gives 0 on the TK1 v1.1 and v1.2.
What am I doing wrong here?
Is there a better way to detect TK1 v1.2 at runtime in Linux?

You may find this information in the device tree:

cat /proc/device-tree/toradex,board-rev

It gets passed by U-Boot here.

Perfect - that works as expected

You are welcome. Thanks for the feedback.