1

我有许多相同设备(基于 I2C 的 IIO 传感器)的实例,在几个 I2C 多路复用器后面具有相同的 I2C 地址。我想iio:deviceX根据确定性路径将 符号链接到更有意义的名称(例如,设备 = 0x29,在多路复用器 = 0x70 上,在总线 1 上)

不幸的是,我似乎无法udevadm info --attribute-walk --name=/dev/iio\:device0根据这些属性匹配 I2C 地址:

  looking at device '/devices/pci0000:00/808622C1:00/i2c-0/i2c-5/i2c-PRP0001:02/iio:device0':
    KERNEL=="iio:device0"
    SUBSYSTEM=="iio"
    DRIVER==""
    ATTR{name}=="vl53l0x"
    ATTR{in_distance_raw}=="8190"
    ATTR{in_distance_scale}=="0.001000"

  looking at parent device '/devices/pci0000:00/808622C1:00/i2c-0/i2c-5/i2c-PRP0001:02':
    KERNELS=="i2c-PRP0001:02"
    SUBSYSTEMS=="i2c"
    DRIVERS=="vl53l0x-i2c"
    ATTRS{name}=="vl53l0x"

  looking at parent device '/devices/pci0000:00/808622C1:00/i2c-0/i2c-5':
    KERNELS=="i2c-5"
    SUBSYSTEMS=="i2c"
    DRIVERS==""
    ATTRS{name}=="i2c-0-mux (chan_id 0)"

  looking at parent device '/devices/pci0000:00/808622C1:00/i2c-0':
    KERNELS=="i2c-0"
    SUBSYSTEMS=="i2c"
    DRIVERS==""
    ATTRS{name}=="Synopsys DesignWare I2C adapter"

  looking at parent device '/devices/pci0000:00/808622C1:00':
    KERNELS=="808622C1:00"
    SUBSYSTEMS=="platform"
    DRIVERS=="i2c_designware"
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

如何确定性地匹配这些传感器?我什至不确定我是否可以假设 I2C 多路复用器将始终以相同的顺序初始化......

4

0 回答 0