Felipe, > -----Original Message----- > From: Menon, Nishanth > Sent: Thursday, October 29, 2009 11:06 AM > To: Gupta, Ajay Kumar; Gadiyar, Anand; linux-omap@xxxxxxxxxxxxxxx > Cc: felipe.balbi@xxxxxxxxx; tony@xxxxxxxxxxx > Subject: RE: [PATCH 3/3] omap3evm: musb: Update power capability for > OMAP3EVM (Rev >= E) > > > From: Gupta, Ajay Kumar > > Sent: Thursday, October 29, 2009 7:10 AM > > > > > > > From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap- > > > > > owner@xxxxxxxxxxxxxxx] On Behalf Of Gupta, Ajay Kumar > > > > > Sent: Wednesday, October 28, 2009 5:13 PM > > > > > > > > > [...] > > > > > diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach- > > omap2/usb- > > > > > musb.c > > > > > index a80441d..529e2b1 100644 > > > > > --- a/arch/arm/mach-omap2/usb-musb.c > > > > > +++ b/arch/arm/mach-omap2/usb-musb.c > > > > > @@ -148,10 +148,14 @@ static struct platform_device musb_device = > { > > > > > > > > > > void __init usb_musb_init(void) > > > > > { > > > > > - if (cpu_is_omap243x()) > > > > > + if (cpu_is_omap243x()) { > > > > > musb_resources[0].start = OMAP243X_HS_BASE; > > > > > - else > > > > > + } else { > > > > Do you need {} for a one liner? Checkpatch should have warned you I > > > think.. > > > > > > > > > > Er, CodingStyle says you need to do this, if the else clause > > > has brackets. > > > > Correct and also checkpatch didn't give any warning for this. > Thanks.. > > > > > > > > > > > musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; > > > > > + /* OMAP3EVM Rev >= E can source 500mA */ > > > > > + if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) > > > > > + musb_plat.power = 250; > > > > > + } Felipe, How about moving the platform specific data (musb_hdrc_platform_data) moved to board-x.c file from usb-musb.c (same as ehci). This would avoid using omap3evm specific check in usb-musb.c files. -Ajay > > > > > musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; > > > > > > > > > > /* > > > > > diff --git a/drivers/usb/musb/musb_regs.h > > > b/drivers/usb/musb/musb_regs.h > > > > > index cc1d71b..a0314df 100644 > > > > > --- a/drivers/usb/musb/musb_regs.h > > > > > +++ b/drivers/usb/musb/musb_regs.h > > > > > @@ -72,6 +72,10 @@ > > > > > #define MUSB_DEVCTL_HR 0x02 > > > > > #define MUSB_DEVCTL_SESSION 0x01 > > > > > > > > > > +/* ULPI VBUSCONTROL */ > > > > > +#define ULPI_USE_EXTVBUS 0x01 > > > > > +#define ULPI_USE_EXTVBUSIND 0x02 > > > > > + > > > > > /* TESTMODE */ > > > > > #define MUSB_TEST_FORCE_HOST 0x80 > > > > > #define MUSB_TEST_FIFO_ACCESS 0x40 > > > > > @@ -246,6 +250,7 @@ > > > > > > > > > > /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at > > 0x68 > > > */ > > > > > #define MUSB_HWVERS 0x6C /* 8 bit */ > > > > > +#define MUSB_ULPI_BUSCONTROL 0x70 /* 8 bit */ > > > > > > > > > > #define MUSB_EPINFO 0x78 /* 8 bit */ > > > > > #define MUSB_RAMINFO 0x79 /* 8 bit */ > > > > > diff --git a/drivers/usb/musb/omap2430.c > > b/drivers/usb/musb/omap2430.c > > > > > index 6761d20..c5fcc30 100644 > > > > > --- a/drivers/usb/musb/omap2430.c > > > > > +++ b/drivers/usb/musb/omap2430.c > > > > > @@ -36,6 +36,7 @@ > > > > > #include <asm/mach-types.h> > > > > > #include <mach/hardware.h> > > > > > #include <plat/mux.h> > > > > > +#include <plat/board.h> > > > > > > > > > > #include "musb_core.h" > > > > > #include "omap2430.h" > > > > > @@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, > u8 > > > > > musb_mode) > > > > > int __init musb_platform_init(struct musb *musb) > > > > > { > > > > > u32 l; > > > > > + u8 val; > > > > > > > > > > #if defined(CONFIG_ARCH_OMAP2430) > > > > > omap_cfg_reg(AE5_2430_USB0HS_STP); > > > > > @@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb > > *musb) > > > > > l |= ULPI_12PIN; > > > > > omap_writel(l, OTG_INTERFSEL); > > > > > > > > > > + /* Program PHY to use external Vbus supply for OMAP3EVM Rev > >= > > E > > > */ > > > > > + if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { > > > > > + val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL); > > > > > + val |= ULPI_USE_EXTVBUS; > > > > > + musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val); > > > > > + } > > > > Do we want to do board specific logic inside a IP logic? Wont it be > > > better to do it some way else? > > > > We need to access musb controller register to program this so It has to > be > > In musb_platform_init() only but As Anand suggested we can use some flag > > From board file to avoid omap3_evm specific check here. > > > > > > > > Maybe add a flag to pass down from the board files? I think other > > > boards might also end up using this. > > > > Looks good. I will take this in next revision. > Thanks again.. that might be a good thing to have. > > Regards, > Nishanth Menon -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html