Ticket #260 (closed defect: fixed)
implement 100mA charging in Linux
| Reported by: | laforge@… | Owned by: | stefan@… |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | kernel | Version: | current svn head |
| Severity: | normal | Keywords: | |
| Cc: | buglog@…, werner@… | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
Linux should export two USB configuration descriptors that are completely
identical, with one difference: power consumption. The first config descriptor
should indicate 250 units (500mA), whereas the second one should indicate 50
units (100mA).
Please also note that we should verify that the 'self powered' flag in both
configurations is switched off.
Currently, we only export one descriptor with 500mA. This means that if you
attach your fully-booted Neo1973 to a bus-powered hub (such as the DebugBoard?
v2), it will not enumerate on the USB [since the host cannot provde 500mA but
the device only exports one configuration with that high current].
Attachments
Change History
comment:2 Changed 6 years ago by laforge@…
Yes, since this needs to be done for all drivers, I guess a quick hack should do
fine now. In the long term it's interesting to think of something more generic,
i.e. a part of the core gadget layer that can re-export the same config
descriptor multiple times, but with different power settings.
comment:3 Changed 6 years ago by stefan@…
After a chat with one of the g_ether authors I have some more ideas for the long
term solution.
We have three different types of power settings: Selfpowered, 100mA and 500mA.
For device safety we should be able to define the highest power limit during
compile time. (No override for this limit).
Beside setting the value during compile time a sysfs entry should allow setting
all values within the limit.
To have this functionality available in all gadget drivers it should be done in
the gadget core files which every driver use to build the config.
comment:4 Changed 6 years ago by stefan@…
I've send a short term patch to openmoko-kernel.
http://lists.openmoko.org/pipermail/openmoko-kernel/2007-March/000082.html
Changed 6 years ago by stefan@…
- Attachment two-usb-power-configs.patch added
Two configs, oine for high and one for low power

We need to implemet this in all gadget driver we like to use. Current drivers do
the following:
g_ether: 50 units (250 units in our tree due to Haralds high power patch)
g_serial: 1 unit, selfpowered
g_file_storage: 1 unit, selfpowered
gmidi and zero are also selfpowered only, but uninteresting for us.
I'll start with g_ether, as this is the one we use in our standard images and
makes most sense.