You are not logged in.

#1 2015-12-19 13:30:48

brdvlps
Member
Registered: 2015-12-19
Posts: 13

[solved] USB power while lid is closed

I'd like to charge my smartphone over usb even if I closed the lid, although this should work only if my laptop power supply is connected.
How do I set this up?

Many thanks in advance.

Last edited by brdvlps (2015-12-25 13:37:08)

Offline

#2 2015-12-19 14:49:15

bibek22
Member
From: Nepal
Registered: 2015-09-10
Posts: 90

Re: [solved] USB power while lid is closed

You mean like when laptop is in sleep? I don't think that's possible (while that would be really cool). But if you're fine having your laptop awake while lid is closed, then you can do by editing /etc/systemd/logind.conf *
especifically, telling it to ignore the LidSwitch.
But you can do the same thing by using power setting in your DE (all of them must have a setting for that.)

* assuming you're using systemctl.

Last edited by bibek22 (2015-12-19 14:52:20)

Offline

#3 2015-12-21 14:04:22

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [solved] USB power while lid is closed

AFAIK whether the USB supplies power in different power states depends on the board/bios setting.

For example, my ASUS desktop board always has power supply for USB ports in S3 (suspend), and also S4 (hiberate) unless I enabled "Deep S4" in UEFI. Not sure if the rating will be lowered though. It even has an option called "USB Charging in S5", which means there will be power to the ports after shutdown.

FWIW you can also check /proc/acpi/wakeup:

[tom@localhost ~]$ cat /proc/acpi/wakeup 
Device	S-state	  Status   Sysfs node
...
EHC1	  S4	*enabled   pci:0000:00:1d.0
EHC2	  S4	*enabled   pci:0000:00:1a.0
XHC	  S4	*enabled   pci:0000:00:14.0
...

If the usb controllers has "S3" or above for "S-state", that might imply that it's capable of supplying power while sleeping.  In that case, you can also try `echo $Device > /proc/acpi/wakup` to toggle their status to "enabled" if it's "disabled" to see if it change the behaviour. Note that this might also make your usb devices capable of waking the laptop and hence requires further fine-tuning in the sysfs. The changes are volatile to a reboot unless you use a udev rule btw.

Last edited by tom.ty89 (2015-12-21 14:21:33)

Offline

#4 2015-12-23 15:27:06

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,461

Re: [solved] USB power while lid is closed

Agree with tom.
In my laptop Bios gives option to keep power available through USB, but only when charging cable is connected.

Online

#5 2015-12-24 13:39:04

brdvlps
Member
Registered: 2015-12-19
Posts: 13

Re: [solved] USB power while lid is closed

Thanks for your responses!
Haven't known the possibility to change the usb power behavior in the BIOS yet. So I did this, and now it works (unfortunately also in battery mode, but for now I'm fine with that).

Offline

#6 2015-12-25 01:31:53

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,461

Re: [solved] USB power while lid is closed

Don't forget to mark this thread solved by editing your first post title.

Online

#7 2016-02-09 04:38:42

slashrsm
Member
Registered: 2015-08-05
Posts: 4

Re: [solved] USB power while lid is closed

If I enable wakeup for XHC1 in /proc/acpi/wakeup I get power on USB ports when suspended, but I also experience random wakeups from suspend mode. Is there a way to get powered USB ports while preventing the waking-up issue?

Offline

#8 2016-02-09 06:35:34

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,461

Re: [solved] USB power while lid is closed

please create new thread

Online

#9 2016-02-09 16:04:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,654

Re: [solved] USB power while lid is closed

Docbroke wrote:

please create new thread

Agree.  Closing this thread.

brdvlps, should you need this thread reopened, please use the report function and drop us a note.
Thanks.

Last edited by ewaller (2016-02-09 16:05:58)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB