diff options
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/gadget/g_dnl.c | 17 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-mx5.c | 15 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-omap.c | 33 | ||||
| -rw-r--r-- | drivers/usb/musb-new/linux-compat.h | 16 | 
4 files changed, 45 insertions, 36 deletions
| diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index cbfcb2d07..a3e05a872 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -31,8 +31,10 @@  #define STRING_MANUFACTURER 25  #define STRING_PRODUCT 2 +/* Index of String Descriptor describing this configuration */  #define STRING_USBDOWN 2 -#define CONFIG_USBDOWNLOADER 2 +/* Number of supported configurations */ +#define CONFIGURATION_NUMBER 1  #define DRIVER_VERSION		"usb_dnl 2.0" @@ -54,11 +56,14 @@ static struct usb_device_descriptor device_desc = {  	.bNumConfigurations = 1,  }; -/* static strings, in UTF-8 */ +/* + * static strings, in UTF-8 + * IDs for those strings are assigned dynamically at g_dnl_bind() + */  static struct usb_string g_dnl_string_defs[] = { -	{ 0, manufacturer, }, -	{ 1, product, }, -	{  }		/* end of list */ +	{.s = manufacturer}, +	{.s = product}, +	{ }		/* end of list */  };  static struct usb_gadget_strings g_dnl_string_tab = { @@ -104,7 +109,7 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)  	static struct usb_configuration config = {  		.label = "usb_dnload",  		.bmAttributes =	USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, -		.bConfigurationValue =	CONFIG_USBDOWNLOADER, +		.bConfigurationValue =	CONFIGURATION_NUMBER,  		.iConfiguration =	STRING_USBDOWN,  		.bind = g_dnl_do_config, diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c index 3548620ec..dd11f535a 100644 --- a/drivers/usb/host/ehci-mx5.c +++ b/drivers/usb/host/ehci-mx5.c @@ -221,21 +221,12 @@ void __weak board_ehci_hcd_postinit(struct usb_ehci *ehci, int port)  int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)  {  	struct usb_ehci *ehci; -#ifdef CONFIG_MX53 -	struct clkctl *sc_regs = (struct clkctl *)CCM_BASE_ADDR; -	u32 reg; - -	reg = __raw_readl(&sc_regs->cscmr1) & ~(1 << 26); -	/* derive USB PHY clock multiplexer from PLL3 */ -	reg |= 1 << 26; -	__raw_writel(reg, &sc_regs->cscmr1); -#endif  	set_usboh3_clk(); -	enable_usboh3_clk(1); +	enable_usboh3_clk(true);  	set_usb_phy_clk(); -	enable_usb_phy1_clk(1); -	enable_usb_phy2_clk(1); +	enable_usb_phy1_clk(true); +	enable_usb_phy2_clk(true);  	mdelay(1);  	/* Do board specific initialization */ diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 032d5e5ec..3c58f9e65 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -79,6 +79,7 @@ static void omap_usbhs_hsic_init(int port)  	writel(reg, &usbtll->channel_conf + port);  } +#ifdef CONFIG_USB_ULPI  static void omap_ehci_soft_phy_reset(int port)  {  	struct ulpi_viewport ulpi_vp; @@ -88,6 +89,12 @@ static void omap_ehci_soft_phy_reset(int port)  	ulpi_reset(&ulpi_vp);  } +#else +static void omap_ehci_soft_phy_reset(int port) +{ +	return; +} +#endif  inline int __board_usb_init(void)  { @@ -96,7 +103,8 @@ inline int __board_usb_init(void)  int board_usb_init(void) __attribute__((weak, alias("__board_usb_init")));  #if defined(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO) || \ -	defined(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO) +	defined(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO) || \ +	defined(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO)  /* controls PHY(s) reset signal(s) */  static inline void omap_ehci_phy_reset(int on, int delay)  { @@ -115,6 +123,10 @@ static inline void omap_ehci_phy_reset(int on, int delay)  	gpio_request(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, "USB PHY2 reset");  	gpio_direction_output(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, !on);  #endif +#ifdef CONFIG_OMAP_EHCI_PHY3_RESET_GPIO +	gpio_request(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, "USB PHY3 reset"); +	gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, !on); +#endif  	/* Hold the PHY in RESET for enough time till DIR is high */  	/* Refer: ISSUE1 */ @@ -198,10 +210,27 @@ int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata,  		else  			setbits_le32(®, OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS);  	} else if (rev == OMAP_USBHS_REV2) { +  		clrsetbits_le32(®, (OMAP_P1_MODE_CLEAR | OMAP_P2_MODE_CLEAR),  					OMAP4_UHH_HOSTCONFIG_APP_START_CLK); -		/* Clear port mode fields for PHY mode*/ +		/* Clear port mode fields for PHY mode */ + +		if (is_ehci_hsic_mode(usbhs_pdata->port_mode[0])) +			setbits_le32(®, OMAP_P1_MODE_HSIC); + +		if (is_ehci_hsic_mode(usbhs_pdata->port_mode[1])) +			setbits_le32(®, OMAP_P2_MODE_HSIC); + +	} else if (rev == OMAP_USBHS_REV2_1) { + +		clrsetbits_le32(®, +				(OMAP_P1_MODE_CLEAR | +				 OMAP_P2_MODE_CLEAR | +				 OMAP_P3_MODE_CLEAR), +				OMAP4_UHH_HOSTCONFIG_APP_START_CLK); + +		/* Clear port mode fields for PHY mode */  		if (is_ehci_hsic_mode(usbhs_pdata->port_mode[0]))  			setbits_le32(®, OMAP_P1_MODE_HSIC); diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h index 72c8c2bad..d7a5663de 100644 --- a/drivers/usb/musb-new/linux-compat.h +++ b/drivers/usb/musb-new/linux-compat.h @@ -39,15 +39,6 @@ typedef unsigned long dmaaddr_t;  #define cpu_relax() do {} while (0)  #define pr_debug(fmt, args...) debug(fmt, ##args) -#define dev_dbg(dev, fmt, args...)		\ -	debug(fmt, ##args) -#define dev_vdbg(dev, fmt, args...)		\ -	debug(fmt, ##args) -#define dev_info(dev, fmt, args...)		\ -	printf(fmt, ##args) -#define dev_err(dev, fmt, args...)		\ -	printf(fmt, ##args) -#define printk printf  #define WARN(condition, fmt, args...) ({	\  	int ret_warn = !!condition;		\ @@ -55,13 +46,6 @@ typedef unsigned long dmaaddr_t;  		printf(fmt, ##args);		\  	ret_warn; }) -#define KERN_DEBUG -#define KERN_NOTICE -#define KERN_WARNING -#define KERN_ERR - -#define kfree(ptr) free(ptr) -  #define pm_runtime_get_sync(dev) do {} while (0)  #define pm_runtime_put(dev) do {} while (0)  #define pm_runtime_put_sync(dev) do {} while (0) |