Re: Documentation for USB device interface for power consumption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 09, 2017 at 11:36:55AM +0800, Kai Hendry wrote:
> Hi there,
> 
> Can't see the /{proc,sys} interface documented in places I expect to be
> like https://github.com/torvalds/linux/tree/master/drivers/usb

It's documented under Documentation/ABI/ for most of the sysfs stuff,
right?

> And the mailing list search is pretty awful:
> https://marc.info/?l=linux-usb&w=2&r=1&s=power+measure&q=b

Take the search issue up with the owners of that web site :)

> My use case is to examine the power draw from my USB port of my iPhone:
> lsusb | grep iPhone
> Bus 001 Device 009: ID 05ac:12a8 Apple, Inc. iPhone5/5C/5S/6
> 
> First problem is to identify the USB port! Currently I am `find
> /sys/devices | grep usb` & wondering how on earth it maps to "Bus 001
> Device 009: ID 05ac:12a8".

We don't know, given that there is no physical mapping of logical USB
busses to physical ports by the hardware, sorry.  You can sometimes
guess as there are hints in sysfs for what port a device is connected
to.  But I don't think that will help you because:

> Next I am hoping the see the power consumption my mA or something like
> that?

You can find out what the device _says_ it will consume, but there is no
way to actually determine how much power the device is drawing without a
physical device to measure the power, sorry.  This is not something that
is possible for the OS to know as there is no hardware in the system to
measure it.

sorry,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux