AppleSMC: Support inotify on light sensor to adjust keyboardbacklight

From: Nico Schottelius
Date: Thu Oct 13 2011 - 14:05:39 EST


Hello LKML,

I've written a small utility to adjust the keyboard backlight
on the Mac Book Air 4,2 depending on the information on the light
sensor [0].

Now is my problem that
/sys/bus/platform/drivers/applesmc/applesmc.768/light
seems not to emit inotify events, if the content changes.
This feature would be great, so I do not need to do a
"while true; sleep X; done"-loop.

As I've no clue about inotify support in kernel, I'd be happy
if someone of you would implement this or else give me a pointer
on how to do so.

Secondly, having this feature for
/sys/bus/platform/drivers/applesmc/applesmc.768/leds/smc::kbd_backlight/brightness
as well, might be useful for other tools monitoring the keyboard
backlight brightness.

Cheers,

Nico

[0] http://git.schottelius.org/?p=kbsd;a=summary
git://git.schottelius.org/kbsd

--
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/