On Thu, Oct 11, 2012 at 5:41 AM, Christopher Heiny <Cheiny@xxxxxxxxxxxxx> wrote: > Linus Walleij wrote: >> On Sat, Oct 6, 2012 at 6:09 AM, Christopher Heiny <cheiny@xxxxxxxxxxxxx> wrote: >> > + chargerinput ... (rw) User space programs can use this to tell >> > the + sensor that the system is plugged into an external >> > power + source (as opposed to running on >> > batteries). This allows + the sensor firmware to make >> > necessary adjustments for the + current capacitence >> > regime. Write 1 to this when the + system is using >> > external power, write 0 to this when the + system is >> > running on batteries. See spec for full details. >> I remember discussing in-kernel notifiers for this. I don't >> really see the point in tunnelling a notification from the drivers/power >> subsystem to the drivers/input subsystem through userspace for >> no good. >> >> It's no blocker though, I don't expect you to fix this as part of >> this driver submission. >> >> Maybe Anton can comment? > > Hmmm. I agree that it'd be good to avoid looping through userspace. But.... > > I found ways to notfiy the kernel that the charger is plugged/unplugged, > but that's only useful if you're a battery charger device driver. I also > found ways for userspace to get notification of charger events. I > didn't spot any way for in-kernel drivers to get notification of such > events. Perhaps I'm not looking the right places, though - can you > provide a pointer? So my point was that there is indeed no such in-kernel notification mechanism. Maybe something engineered similar to this: http://www.spinics.net/lists/lm-sensors/msg33834.html Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html