Re: [linux-usb-devel] [PATCH] : Allow embedded developers USBoptions normally reserved for OTG

From: Felipe Balbi
Date: Wed Jan 02 2008 - 14:32:45 EST


On Wed, Jan 02, 2008 at 10:47:15AM -0800, David Brownell wrote:
> On Wednesday 02 January 2008, Robin Getz wrote:
> > From: Robin Getz <rgetz@xxxxxxxxxxxxxxxxxxxx>
> >
> > Allow embedded developers to turn support for USB Hubs off even if they have a
> > full root hub. This saves the overhead (RAM and Flash size).
>
> ISTR that it won't save very much code though ... the Linux USB
> stack structures all its enumeration logic around hubs.
>
>
> > Allow embedded developers the capabilities of the "otg_whitelist.h" - a
> > product whitelist, so USB peripherals not listed there will be rejected
> > during enumeration. This is the desired operation for many embedded products.
> >
> > Signed-off-by: Robin Getz <rgetz@xxxxxxxxxxxxxxxxxxxx>
>
> This is probably the right thing to do. Correct me if I'm wrong,
> but USB-IF recently put out some specs about "embedded hosts" which
> basically boil down to saying you can adopt the same functionality
> restrictions that used to be OTG-only. Which is why now there are
> embedded developers who'd like this option. :)

otg whitelist is not a blocker. A device that is not listed on TPL
might or might not work. The logic around that should be something like:

parse_whitelist()
if (!listed) {
match_class_with_tpled_devices();
if (match_any)
check_power_need();
if (power_need <= 100mA)
allow_enumeration();
else
deny_enumaration_and_message();

If you check n810, you'll see that even though a usb memory stick is not
listed on its TPL, we allow it to enumerate as long as it draws less
then 100mA and this is true on something around 95% of usb memory
sticks.

I'm kinda busy with other tasks right now, but when I finish formating
proper patches for current mainline head, I'll release some code adding
support for dynamic otg tpl. The problem I see here is that my only
"user" is musb driver, currently only available on linux-omap git tree.

Maybe it's time to send it to mainline, what do you think Dave?

In any case, I'll format such patches when I'm done with twl4030 and
isp1301 development, something around 3 ~ 4 weeks from now.

Even though, embedded hosts should have the same behavior.

Best Regards,

Felipe Balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/