I also have seen the /sys/class/... method, but as far as I know this "file" is created by the intel driver. So it's no global solution.
I also have seen the /sys/class/... method, but as far as I know this "file" is created by the intel driver. So it's no global solution.