# 60-sensor.rules
#
# Match string formats:
+# sensor:<label>:modalias:<parent modalias pattern>:dmi:<dmi pattern>
# sensor:modalias:<parent modalias pattern>:dmi:<dmi pattern>
#
# The device modalias can be seen in the `modalias` file of the sensor parent,
+# and the device label can be seen in the `label` file of the sensor,
# for example:
+# cat /sys/`udevadm info -q path -n /dev/iio:device0`/label
# cat /sys/`udevadm info -q path -n /dev/iio:device0`/../modalias
#
# The full DMI string of the running machine can be read from
'touchpad': ('i8042', 'rmi', 'bluetooth', 'usb'),
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
'keyboard': ('name', ),
- 'sensor': ('modalias', ),
+ 'sensor': ('modalias',
+ 'accel-base',
+ 'accel-display',
+ 'accel-camera',
+ 'proximity-palmrest',
+ 'proximity-palmrest-left',
+ 'proximity-palmrest-right',
+ 'proximity-lap',
+ 'proximity-wifi',
+ 'proximity-lte',
+ 'proximity-wifi-lte',
+ 'proximity-wifi-left',
+ 'proximity-wifi-right',
+ ),
'ieee1394-unit-function' : ('node', ),
'camera': ('usb'),
}
ACTION=="remove", GOTO="sensor_end"
+# device matching the sensor's label, name and the machine's DMI data for IIO devices
+SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="usb|i2c|platform", ATTR{label}!="", \
+ IMPORT{builtin}="hwdb 'sensor:$attr{label}:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \
+ GOTO="sensor_end"
+
# device matching the sensor's name and the machine's DMI data for IIO devices
SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="usb|i2c|platform", \
IMPORT{builtin}="hwdb 'sensor:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \