# i2c udev rules

## flammenflitzer

Hallo

Ich benutzt conky. Allerdings werden im fast täglichem Wechsel  die i2c dev als i2c 1-0073 temp 1 bzw. i2c 0-0073 temp 1, i2c 1-0073 fan 2 bzw.  temp i2c 0-0073 fan 2 usw. angelegt. D.h., die conkyrc muß angepasst werden. Hat jemad eine Ahnung, wie ich das mit udev-rules hinbekomme, das z.B. immer immer i2c 0-0073 ... angelegt werden?

```

Roadrunner olaf # ls /sys/bus/i2c/devices/0-0073

alarms       fan2_div      in0_input  pwm3          temp3_input

bus          fan2_input    in1_input  revision      temp3_status

control      fan2_status   in2_input  subsystem     uevent

driver       fan3_div      name       temp1_input   watchdog_control

fan1_div     fan3_input    power      temp1_status  watchdog_preset

fan1_input   fan3_status   pwm1       temp2_input   watchdog_status

fan1_status  hwmon:hwmon1  pwm2       temp2_status

```

```
Roadrunner olaf # udevinfo -a -p /sys/bus/i2c/devices/0-0073

Udevinfo starts with the device specified by the devpath and then

walks up the chain of parent devices. It prints for every device

found, all possible attributes in the udev rules key format.

A rule to match, can be composed by the attributes of the device

and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:11.0/i2c-0/0-0073':

    KERNEL=="0-0073"

    SUBSYSTEM=="i2c"

    DRIVER=="fscher"

    ATTR{temp3_input}=="127000"

    ATTR{temp3_status}=="0"

    ATTR{temp2_input}=="53000"

    ATTR{temp2_status}=="1"

    ATTR{temp1_input}=="38000"

    ATTR{temp1_status}=="1"

    ATTR{pwm3}=="1"

    ATTR{fan3_input}=="1140"

    ATTR{fan3_div}=="2"

    ATTR{fan3_status}=="4"

    ATTR{pwm2}=="1"

    ATTR{fan2_input}=="2040"

    ATTR{fan2_div}=="2"

    ATTR{fan2_status}=="0"

    ATTR{pwm1}=="1"

    ATTR{fan1_input}=="0"

    ATTR{fan1_div}=="2"

    ATTR{fan1_status}=="0"

    ATTR{in2_input}=="2370"

    ATTR{in1_input}=="1940"

    ATTR{in0_input}=="1850"

    ATTR{watchdog_preset}=="0"

    ATTR{watchdog_control}=="0"

    ATTR{watchdog_status}=="0"

    ATTR{control}=="0"

    ATTR{alarms}=="1"

    ATTR{revision}=="32"

    ATTR{name}=="fscher"

  looking at parent device '/devices/pci0000:00/0000:00:11.0/i2c-0':

    KERNELS=="i2c-0"

    SUBSYSTEMS==""

    DRIVERS==""

    ATTRS{name}=="SMBus Via Pro adapter at f400"

  looking at parent device '/devices/pci0000:00/0000:00:11.0':

    KERNELS=="0000:00:11.0"

    SUBSYSTEMS=="pci"

    DRIVERS==""

    ATTRS{msi_bus}==""

    ATTRS{broken_parity_status}=="0"

    ATTRS{enable}=="0"

    ATTRS{modalias}=="pci:v00001106d00003227sv00001734sd0000102Ebc06sc01i00"

    ATTRS{local_cpus}=="01"

    ATTRS{irq}=="0"

    ATTRS{class}=="0x060100"

    ATTRS{subsystem_device}=="0x102e"

    ATTRS{subsystem_vendor}=="0x1734"

    ATTRS{device}=="0x3227"

    ATTRS{vendor}=="0x1106"

  looking at parent device '/devices/pci0000:00':

    KERNELS=="pci0000:00"

    SUBSYSTEMS==""

    DRIVERS==""
```

MfG

----------

## flammenflitzer

Vielleicht

```
KERNEL=="i2c*", ATTR{name}=="fscher", NAME="fscher"
```

? Aber kann ich damit etwas anfangen?

----------

