| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 | 
							- /*
 
-  * usb-host.c - OMAP USB Host
 
-  *
 
-  * This file will contain the board specific details for the
 
-  * Synopsys EHCI/OHCI host controller on OMAP3430 and onwards
 
-  *
 
-  * Copyright (C) 2007-2011 Texas Instruments
 
-  * Author: Vikram Pandita <vikram.pandita@ti.com>
 
-  * Author: Keshava Munegowda <keshava_mgowda@ti.com>
 
-  *
 
-  * Generalization by:
 
-  * Felipe Balbi <balbi@ti.com>
 
-  *
 
-  * This program is free software; you can redistribute it and/or modify
 
-  * it under the terms of the GNU General Public License version 2 as
 
-  * published by the Free Software Foundation.
 
-  */
 
- #include <linux/types.h>
 
- #include <linux/errno.h>
 
- #include <linux/delay.h>
 
- #include <linux/platform_device.h>
 
- #include <linux/slab.h>
 
- #include <linux/dma-mapping.h>
 
- #include <asm/io.h>
 
- #include "soc.h"
 
- #include "omap_device.h"
 
- #include "mux.h"
 
- #include "usb.h"
 
- #ifdef CONFIG_MFD_OMAP_USB_HOST
 
- #define OMAP_USBHS_DEVICE	"usbhs_omap"
 
- #define OMAP_USBTLL_DEVICE	"usbhs_tll"
 
- #define	USBHS_UHH_HWMODNAME	"usb_host_hs"
 
- #define USBHS_TLL_HWMODNAME	"usb_tll_hs"
 
- static struct usbhs_omap_platform_data		usbhs_data;
 
- static struct usbtll_omap_platform_data		usbtll_data;
 
- static struct ehci_hcd_omap_platform_data	ehci_data;
 
- static struct ohci_hcd_omap_platform_data	ohci_data;
 
- static struct omap_device_pm_latency omap_uhhtll_latency[] = {
 
- 	  {
 
- 		.deactivate_func = omap_device_idle_hwmods,
 
- 		.activate_func	 = omap_device_enable_hwmods,
 
- 		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 
- 	  },
 
- };
 
- /* MUX settings for EHCI pins */
 
- /*
 
-  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
 
-  */
 
- static void __init setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
 
- {
 
- 	switch (port_mode[0]) {
 
- 	case OMAP_EHCI_PORT_MODE_PHY:
 
- 		omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT);
 
- 		omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT);
 
- 		omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_nxt", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data0", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data1", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data2", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data3", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data4", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data5", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN);
 
- 		break;
 
- 	case OMAP_EHCI_PORT_MODE_TLL:
 
- 		omap_mux_init_signal("hsusb1_tll_stp",
 
- 			OMAP_PIN_INPUT_PULLUP);
 
- 		omap_mux_init_signal("hsusb1_tll_clk",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_dir",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_nxt",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data0",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data1",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data2",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data3",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data4",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data5",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data6",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb1_tll_data7",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		break;
 
- 	case OMAP_USBHS_PORT_MODE_UNUSED:
 
- 		/* FALLTHROUGH */
 
- 	default:
 
- 		break;
 
- 	}
 
- 	switch (port_mode[1]) {
 
- 	case OMAP_EHCI_PORT_MODE_PHY:
 
- 		omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT);
 
- 		omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT);
 
- 		omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_nxt", OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data0",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data1",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data2",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data3",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data4",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data5",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data6",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		omap_mux_init_signal("hsusb2_data7",
 
- 			OMAP_PIN_INPUT_PULLDOWN);
 
- 		break;
 
- 	case OMAP_EHCI_PORT_MODE_TLL:
 
- 		omap_mux_init_signal("hsusb2_tll_stp",
 
 
  |