public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices
@ 2009-08-14 12:58 Pander
  2009-08-14 13:53 ` Pander
  2009-08-14 21:05 ` Lennart Sorensen
  0 siblings, 2 replies; 4+ messages in thread
From: Pander @ 2009-08-14 12:58 UTC (permalink / raw)
  To: linux-kernel

Hi all,

Consider situations where normal power outlets are not available, e.g.
when travelling in remote areas or in an air plane or train, but you do
need to charge USB/FireWire devices like a mobile telephone, camera,
PDA, etc. It would be efficient to boot your laptop with a special
kernel that turns it into a charger.

Some laptops already offer this feature, however the majority of laptops
donot. A suspended laptop can offer this too, but please consider
situation orplaces where power is so scarce that normally booting a
laptop in order tocharge another device is undesirable in terms of being
efficient with theenergy stored in the battery or that it is not allowed
to activate RF devicesas is in an air plane.

Normal boot will cause that a lot of power will be consumed by the
disks,screen, CPUs, RF devices, fans, all LEDs (except the one
indicating the deviceis switched on), etc. while you are only interested
in power being available at the USB/FireWire ports.

This can be achieved by building a special kernel that will shut down
all hardware that is not needed for offering power on the before
mentioned ports. Perhaps this can be achieved by kernel configuration
alone or it might require a minimal of functionality to put a laptop
into such a charging state.

Normally, systems automatically shut down before the battery is drained
100%. This kernel will allow you to drain all the entire battery.

The resulting kernel can be installed and made available in a similar
way as the memtest kernel and can be incorporated by installers of
GNU/Linux distributions.

Implementing this idea will allow for highly energy efficient recharging
of devices like telephones, cameras and other mobile devices via your
laptop.

Regards,

Pander


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices
  2009-08-14 12:58 [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices Pander
@ 2009-08-14 13:53 ` Pander
  2009-08-14 14:54   ` Alan Jenkins
  2009-08-14 21:05 ` Lennart Sorensen
  1 sibling, 1 reply; 4+ messages in thread
From: Pander @ 2009-08-14 13:53 UTC (permalink / raw)
  To: linux-kernel

Pander wrote:
> Hi all,
> 
...
> 
> This can be achieved by building a special kernel that will shut down
> all hardware that is not needed for offering power on the before
> mentioned ports. Perhaps this can be achieved by kernel configuration
> alone or it might require a minimal of functionality to put a laptop
> into such a charging state.

Alternative implementation could be that this functionality is present
in a normal kernel and is only activated by boot time command argument
'charger'.

While being on the subject anyway, optionally, extra functionality could
be implemented for turning the laptop into an emergency light. The boot
time command argument 'light' could offer this.

The same functionality as with charger will be enabled and the screen
and keyboard will powered up. Initially, the screen will be white. By
means of the following keys: arrow op, arrow down, arrow left, arrow
right, page up, page down, home, end, return, tab one is able to change
the color of the screen in on of 16 basic colors: white, yellow,
fuchsia, red, silver, gray, olive, purple, maroon, aqua, lime, teal,
green, blue, navy and black (perhaps omit the latter). The space bar key
would enable and disable the screen but still allow for the other keys
to change the color. Also the brightness keys should be supported.

Of course this is easily done by software on a fully booted system.
However, due to the emergency situation, again power can be scarce and
must be used as efficient as possible. Considering and discussing
implementation of this greatly overlaps the aforementioned proposal.

Kind regards,

Pander

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] charger: Offer kernel build that disables disks, screen,  etc. and lets laptop serve as charger for USB/FireWire devices
  2009-08-14 13:53 ` Pander
@ 2009-08-14 14:54   ` Alan Jenkins
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Jenkins @ 2009-08-14 14:54 UTC (permalink / raw)
  To: Pander; +Cc: linux-kernel

On 8/14/09, Pander <pander@users.sourceforge.net> wrote:
> Pander wrote:
>> Hi all,
>>
> ...
>>
>> This can be achieved by building a special kernel that will shut down
>> all hardware that is not needed for offering power on the before
>> mentioned ports. Perhaps this can be achieved by kernel configuration
>> alone or it might require a minimal of functionality to put a laptop
>> into such a charging state.
>
> Alternative implementation could be that this functionality is present
> in a normal kernel and is only activated by boot time command argument
> 'charger'.
>
> While being on the subject anyway, optionally, extra functionality could
> be implemented for turning the laptop into an emergency light. The boot
> time command argument 'light' could offer this.
>
> The same functionality as with charger will be enabled and the screen
> and keyboard will powered up. Initially, the screen will be white. By
> means of the following keys: arrow op, arrow down, arrow left, arrow
> right, page up, page down, home, end, return, tab one is able to change
> the color of the screen in on of 16 basic colors: white, yellow,
> fuchsia, red, silver, gray, olive, purple, maroon, aqua, lime, teal,
> green, blue, navy and black (perhaps omit the latter). The space bar key
> would enable and disable the screen but still allow for the other keys
> to change the color. Also the brightness keys should be supported.
>
> Of course this is easily done by software on a fully booted system.
> However, due to the emergency situation, again power can be scarce and
> must be used as efficient as possible. Considering and discussing
> implementation of this greatly overlaps the aforementioned proposal.
>
> Kind regards,
>
> Pander

You can do all this in userspace, without using any more power.  E.g.
instead of a "charger" boot option, just use init=/sbin/charger.

If there are any opportunities to save more power by disabling certain
devices, then these capability should be exercised automatically when
devices are unused.

Where this is not possible, userspace can explicitly disable the
device.  E.g. USB mice which usually have broken autosuspend support,
and will not "wake up" when used.  In this example, userspace can
already write "suspend" or "auto" to
/sys/bus/usb/devices/.../power/level.  See
Documentation/ABI/testing/sysfs-bus-usb.

Then you can benefit from writing "charger" or "torch" in userspace,
which is generally a much nicer environment.  And any extra power
saving capabilities you add can be reused by other userspace software,
possibly including the modern desktop environments.

W.r.t to suspend: I do not believe it is guaranteed that USB ports
will supply full power when the system is suspended.  You might have
to make that an option.

Here are some of the biggest potential power savings:  Disable all
radios e.g. WiFi, using the rkill subsystem.  Put the screen into
power saving mode.  Don't access the disk - use a ramdisk, or a good
prefetching system, and spin the disk down once you've loaded
everything into ram.  Don't run any userspace programs which wake up
periodically (i.e. audit your system with powertop).

All the above can be implemented in userspace without doing anything
really novel.  If anything, they will be harder to implement in-kernel
because it's not really designed to allow that sort of policy
enforcement.  And you might even have to run X in order to reliably &
portably blank the screen :-).

Have fun
Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices
  2009-08-14 12:58 [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices Pander
  2009-08-14 13:53 ` Pander
@ 2009-08-14 21:05 ` Lennart Sorensen
  1 sibling, 0 replies; 4+ messages in thread
From: Lennart Sorensen @ 2009-08-14 21:05 UTC (permalink / raw)
  To: Pander; +Cc: linux-kernel

On Fri, Aug 14, 2009 at 02:58:05PM +0200, Pander wrote:
> Consider situations where normal power outlets are not available, e.g.
> when travelling in remote areas or in an air plane or train, but you do
> need to charge USB/FireWire devices like a mobile telephone, camera,
> PDA, etc. It would be efficient to boot your laptop with a special
> kernel that turns it into a charger.
> 
> Some laptops already offer this feature, however the majority of laptops
> donot. A suspended laptop can offer this too, but please consider
> situation orplaces where power is so scarce that normally booting a
> laptop in order tocharge another device is undesirable in terms of being
> efficient with theenergy stored in the battery or that it is not allowed
> to activate RF devicesas is in an air plane.
> 
> Normal boot will cause that a lot of power will be consumed by the
> disks,screen, CPUs, RF devices, fans, all LEDs (except the one
> indicating the deviceis switched on), etc. while you are only interested
> in power being available at the USB/FireWire ports.
> 
> This can be achieved by building a special kernel that will shut down
> all hardware that is not needed for offering power on the before
> mentioned ports. Perhaps this can be achieved by kernel configuration
> alone or it might require a minimal of functionality to put a laptop
> into such a charging state.
> 
> Normally, systems automatically shut down before the battery is drained
> 100%. This kernel will allow you to drain all the entire battery.
> 
> The resulting kernel can be installed and made available in a similar
> way as the memtest kernel and can be incorporated by installers of
> GNU/Linux distributions.
> 
> Implementing this idea will allow for highly energy efficient recharging
> of devices like telephones, cameras and other mobile devices via your
> laptop.

Perhaps using your laptop is a charger is simply inefficient and no
matter how simple the system is it is likely to use way more power than
any dedicated usb charger would, and certainly more than the laptops
that actually support this in hardware.

-- 
Len Sorensen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-14 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 12:58 [RFC] charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices Pander
2009-08-14 13:53 ` Pander
2009-08-14 14:54   ` Alan Jenkins
2009-08-14 21:05 ` Lennart Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox