public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bruce <bruce@andrew.cmu.edu>
To: linux-kernel@vger.kernel.org
Cc: Casey Dahlin <cjdahlin@ncsu.edu>
Subject: Re: USB Key light on/off state depending on mount
Date: Sat, 25 Aug 2007 03:49:12 -0700	[thread overview]
Message-ID: <46D00928.1080901@andrew.cmu.edu> (raw)
In-Reply-To: <46CF6791.8040509@shaw.ca>

Robert Hancock wrote:
> Casey Dahlin wrote:
>> Most USB keys nowadays have a small LED somewhere inside of them that 
>> lights up when they are plugged in. On a windows box, the key is lit 
>> up whenever it is mounted, and as soon as it is unmounted it turns 
>> off, giving a handy physical indicator that the key is safe to remove. 
>> On linux, the light is simply on whenever the key is plugged in.
>>
>> Should linux toggle the light depending on mount state? Is it as 
>> trivial as it seems or does this reflect some larger issue?
> 
> I think that Windows turns off power to the port when you do the "safely 
> remove hardware" on it, or something like that. Mount/unmount doesn't 
> really indicate whether the device is in use in Linux, though, since it 
> can still be potentially accessed even when the device isn't mounted.

If there is a way to toggle the power state from userspace, then a 
desktop environment or userland tool can emulate the Windows behavior if 
that is desired.  A lot of devices can charge via USB now, and this is 
actually more convenient on Linux than on Windows (in effect Windows 
requires drivers in order to charge something).  However, having direct 
control over this is useful.

According to the following thread, it appears one can get the needed 
functionality through libusb:
http://www.mail-archive.com/linux-usb-users@lists.sourceforge.net/msg19131.html
http://www.gniibe.org/ac-power-by-usb/ac-power-control.html

  - Jim


  reply	other threads:[~2007-08-25 10:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.BwCgwGvTNIOD+KEeBrvP11xCEmw@ifi.uio.no>
2007-08-24 23:19 ` USB Key light on/off state depending on mount Robert Hancock
2007-08-25 10:49   ` James Bruce [this message]
2007-08-25 11:58     ` Éric Piel
2007-08-24 20:58 Casey Dahlin
2007-08-24 21:13 ` Josh Boyer
2007-08-25 19:26   ` Guennadi Liakhovetski
2007-08-25 22:21     ` Stefan Richter
2007-09-07 19:56       ` Casey Dahlin
2007-08-26 10:10     ` Xavier Bestel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46D00928.1080901@andrew.cmu.edu \
    --to=bruce@andrew.cmu.edu \
    --cc=cjdahlin@ncsu.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox