This simple driver makes use of SMBus/ig4 to read values from
the ISL29018 light sensor. It's not using any of the advanced
features like interrupts etc. and it doesn't allow changing
the controller configuration. Measurements are read directly
using sysctl. There are many ways this driver could be improved
(run a separate thread that feeds data in a certain interval -
also a function the device supports directly, devd support...).
Despite those shortcomings, the driver is still useful in its current state,
e.g. to adjust screen brightness on a laptop, simplified real life example:
#!/bin/sh update_brightness() ( BRIGHTNESS=$(( `sysctl -n dev.isl.0.als` )) if [ $BRIGHTNESS -lt 15 ]; then BRIGHTNESS=15 fi if [ $BRIGHTNESS -gt 100 ]; then BRIGHTNESS=100 fi return $BRIGHTNESS ) ... update_brightness B_LAST=$? intel_backlight $B_LAST ...
It creates a device /dev/islX, which is not used for anything right now.
Once the driver is in HEAD, additional features might be added by
me or other developers quite easily. The documentation is fairly
good and available at
http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29018.pdf
The device shows up properly in devinfo:
ig4iic1 smbus1 isl0
Example sysctl output:
# sysctl dev.isl.0 dev.isl.0.range: 1000 dev.isl.0.resolution: 65536 dev.isl.0.prox: 13298 dev.isl.0.ir: 13312 dev.isl.0.als: 43 dev.isl.0.%parent: smbus1 dev.isl.0.%pnpinfo: dev.isl.0.%location: addr=0x44 dev.isl.0.%driver: isl dev.isl.0.%desc: ISL Digital Ambient Light Sensor