Re: Power-managing devices that are not of interest at some point in time

From: Benson Leung
Date: Wed Jul 16 2014 - 13:12:34 EST


On Wed, Jul 16, 2014 at 7:17 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

>> Various workarounds cover some of these cases, and we have some ugly
>> hacks in ChromeOS to make things work. It would be nice if a userspace
>> power management daemon could listen to the lid-close event, and then
>> have a way to temporarily power off these devices, potentially through
>> sysfs.
>
> Isn't it common for laptops to go into system suspend when the lid is
> closed?

It's common, but it does not cover all possible cases. As was
mentioned by Dmitry, the user may dock his laptop, close his lid and
use external display, keyboard, and mouse. In that case, the internal
devices should be disabled or else they may send bogus input when the
laptop's B panel couples with the touchpad, for example.

Even in the case where system suspend happens, we don't want to depend
on that state change to disable these devices. It may take some time
before the system enters suspend, and in the meantime the input
devices with the lid closed may inadvertently cancel suspend by
generating a pm_wakeup_event(), which is not what we want.

Other scenarios outside of lid close where such a feature would be
helpful would be for transforming form-factors such as Yoga style
laptops where the screen can fold back into tablet mode, and the C
panel touchpad and keyboard should be disabled.


--
Benson Leung
Software Engineer, Chrom* OS
bleung@xxxxxxxxxxxx
--
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/