Hi Søren,

2010/8/29 Søren Steen Christensen <lists@ssc-solutions.dk>
Hi Morten,

> Furthermore in kernel version 2.6.33 i had to change
> line 108 from "       musb_plat.power = board_data->power >> 1; " to
"musb_plat.power = board_data->power;"
> I am not sure if this is still necessary but this prohibited me from
specifying a supply of more than 250 mA
> removing the right shift allowed me to specify 500 mA.

First of all, I have to admit that I didn’t check the actual code, but are
you completely sure about the “>> 1” change?

In the USB-descriptor needed power is specified in steps of 2mA in the range
0-250 equal which equals 0-500mA in order to keep the field a 1-byte value.
I would expect that the right shift one actually tries to account for this
since you are entering real-world-mA in the board data specification?

After digging around in the source code, i know why i had to remove the >>1,
when i first did the change i did not notice that in arch/arm/plat-omap/usb.h 
the omap_musb_board_data structure has power defined as a u8 which combined with
right shift will give you maximum of 254 mA. Therefore instead of doing the change below i just removed
the right-shift and specified the power as mA/2  directly in board-overo.c.

I guess the correct change is to define the field "power" in the struct omap_musb_board_data in  arch/arm/plat-omap/usb.h as a u16 field instead, and leave the >> 1 which is correct according to the documentation in include/linux/usb/musb.h 

Am I correct about this?

Best regards and thanks

SSC Solutions ApS - Denmark - www.ssc-solutions.dk

Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
gumstix-users mailing list

Regards Morten Larsen