Re: [PATCH] usb: musb: fix HOST or PERIPHERAL only mode

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

 



On Wed, May 05, 2010 at 03:46:10AM +0200, ext Ming Lei wrote:
2010/5/5 Sergei Shtylyov <sshtylyov@xxxxxxxxxx>:
Hello.

tom.leiming@xxxxxxxxx wrote:

From: Ming Lei <tom.leiming@xxxxxxxxx>

The plat->mode passed from platform_data always is MUSB_OTG,
so the init failures below will happen if we configure musb as
HOST or PERIPHERAL mode in Kconfig:

       "incompatible Kconfig role setting"

The patch fixes the issue by degrading otg mode to
host or peripheral mode in such case.


 Why not fix your platform data instead to pass the needed role like the
DaVinci code does (see arch/arm/mach-davinci/usb.c)?


IMO, this fix is better than the fix in board code:
       -do not need to fix all board code which may support musb
       -OTG mode means the hardware has the host-only or peripheral-only
capability

generally we want to keep SDPs or EVMs as OTG, so we can test all possible scenarios, but real products are either peripheral only, otg or host-only, and that's a real HW characteristic, not something we can change easily. Take n900 for example, if you build it with otg support you're doing nothing but bloating the kernel with useless code since it'll never support the host role unless you route the id pin to the correct place by hand on the PCB.

still, i think this patch is ok for mainline, that would allow developers to play with other stuff but I'd like to see a big fat warning when that happens. Can you update the patch ?

--
balbi

DefectiveByDesign.org
--
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