tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Ambient light sensors in envsys



Hey folks -

I have a need to have an ambient light sensor in my silly little clock project.  I have a driver for the particular sensor I’m using that runs entirely in user space, but I’m wondering if it might be a good idea to glue it into envsys.

There are a couple reasons for putting it into envsys that I can see:

1- Hey, why not.  It’s an environmental sensor, after all.  We already handle relative humidity, why not sunshine too?

2- Putting a driver for it in the kernel would allow me to eventually support interrupting on high-light / low-light thresholds, so that I don’t have to poll all the time.  Granted, with the GPIO interrupt support I just added, I could do this entirely in user space with the kqueue-based “GPIO event” stuff originally written by Brad Spencer that I plan to integrate.  But in general, I think that envsys should get proper support for interrupting on interesting events.

I think all that’s really needed is a new sensor unit type of “Lux”.  It’s been a while since I looked at envsys, do I don’t know if it’s possible to set high/low thresholds yet… eventually, I think that needs be done in a generic way, but I’m going to start with polling for now.

Ok… DISCUSS!

-- thorpej



Home | Main Index | Thread Index | Old Index