Skip to contentSkip to conversation

Ejecting/Powering off/ -> Turn off the device lamp.

DISCUSSION Andy Kennedy 3 participants 5 messages May 22, 2006

lore
Share & tools
lore
#0 lore raw

All,

I have done an extensive search on this issue and cannot find the answer to my specific question. Whereas I understand that an individual device on a USB host (on board) cannot be "powered off" nor "ejected" I wonder if the device can be sent a command from userspace to turn off it's LED indicator lamp. Most of the devices that I have seen, when the device is no longer in use, goes into a blink cycle.

Is there a way to signal the device to stop the cycle and actually power off the LED?

Thanks in advance for any help you can give.

Andy Kennedy

begin:vcard
fn:Andy Kennedy
n:;Andy Kennedy
org:TechMon Research Inc.
adr;dom:;;2221 Dianne Drive;Birmingham;AL;35235
email;internet:[email protected]
title:Sr. Software Engineer
tel;work:(205) 854-9895
tel;cell:(256) 453-1814
version:2.1
end:vcard

#1 lore raw
Quoted 11 lines · Andy Kennedy

All,

I have done an extensive search on this issue and cannot find the answer to my specific question. Whereas I understand that an individual device on a USB host (on board) cannot be "powered off" nor "ejected" I wonder if the device can be sent a command from userspace to turn off it's LED indicator lamp. Most of the devices that I have seen, when the device is no longer in use, goes into a blink cycle.

Is there a way to signal the device to stop the cycle and actually power off the LED?

It's hard to answer that question without knowing what kind of device you're talking about. Some USB devices (like hubs) can be told to turn off their indicators; most cannot.

Alan Stern

#2 lore raw
Quoted 7 lines · Alan Stern
Quoted 4 lines · Andy Kennedy

All,

I have done an extensive search on this issue and cannot find the answer to my specific question. Whereas I understand that an individual device on a USB host (on board) cannot be "powered off" nor "ejected" I wonder if the device can be sent a command from userspace to turn off it's LED indicator lamp. Most of the devices that I have seen, when the device is no longer in use, goes into a blink cycle.

Quoted 9 lines
Quoted 2 lines

Is there a way to signal the device to stop the cycle and actually power off the LED?

It's hard to answer that question without knowing what kind of device you're talking about. Some USB devices (like hubs) can be told to turn off their indicators; most cannot.

Alan Stern

Very sorry. . . I did leave out the most important part: I am working with various flash disks / USB mass storage devices.

I am working with an embedded system that will have no user interaction save the USB port. The unit will recognize the mass storage device via the hotplug scripts, then execute a series of commands. . . after which the device will be unmounted and then could be removed. That is the purpose for wanting to extinguish the lamp. It would be hard to explain to a lay person to "Watch the little light. It should blink very fast for a few seconds/minutes then blink slow for a few seconds, then fast again. . . then you can remove it." and expect them to comprehend the meaning of the "little blinking light."

I have TTLs on the embedded system; I may just have to use those.

Andy Kennedy

begin:vcard
fn:Andy Kennedy
n:;Andy Kennedy
org:TechMon Research Inc.
adr;dom:;;2221 Dianne Drive;Birmingham;AL;35235
email;internet:[email protected]
title:Sr. Software Engineer
tel;work:(205) 854-9895
tel;cell:(256) 453-1814
version:2.1
end:vcard

#3 lore raw
Quoted 4 lines · Andy Kennedy

I am working with an embedded system that will have no user interaction save the USB port. ...

I have TTLs on the embedded system; I may just have to use those.

Sounds like you need to design in some additional user interaction, either a LED driven by a GPIO to indicate "OK to remove", or else a LED driven by that port's root hub. (Some root hubs support the standardized root hub LED mechanisms; most don't.)

- Dave

#4 lore raw
In reply to Andy Kennedy
Quoted 2 lines · Andy Kennedy

Is there a way to signal the device to stop the cycle and actually power off the LED?

You might be able to ask the device to suspend -- using the deprecated /sys/devices/.../power/state files -- which in common cases means that bus-powered devices won't be able to keep a LED powered.

But LEDs are highly device-specific, so there can be no general rules.

- Dave