#
# USB Dual Role (OTG-ready) Controller Drivers
# for silicon based on Mentor Graphics INVENTRA designs
#

comment "Enable Host or Gadget support to see Inventra options"
	depends on !USB && USB_GADGET=n

# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
	depends on (USB || USB_GADGET) && HAVE_CLK
	depends on !SUPERH
	select TWL4030_USB if MACH_OMAP_3430SDP
	select USB_OTG_UTILS
	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
	help
	  Say Y here if your system has a dual role high speed USB
	  controller based on the Mentor Graphics silicon IP.  Then
	  configure options to match your silicon and the board
	  it's being used with, including the USB peripheral role,
	  or the USB host role, or both.

	  Texas Instruments parts using this IP include DaVinci 644x,
	  OMAP 243x, OMAP 343x, and TUSB 6010.

	  Analog Devices parts using this IP include Blackfin BF54x,
	  BF525 and BF527.

	  If you do not know what this is, please say N.

	  To compile this driver as a module, choose M here; the
	  module will be called "musb_hdrc".

config USB_MUSB_SOC
	boolean
	depends on USB_MUSB_HDRC
	default y if ARCH_DAVINCI
	default y if ARCH_OMAP2430
	default y if ARCH_OMAP34XX
	default y if (BF54x && !BF544)
	default y if (BF52x && !BF522 && !BF523)

comment "DaVinci 644x USB support"
	depends on USB_MUSB_HDRC && ARCH_DAVINCI

comment "OMAP 243x high speed USB support"
	depends on USB_MUSB_HDRC && ARCH_OMAP2430

comment "OMAP 343x high speed USB support"
	depends on USB_MUSB_HDRC && ARCH_OMAP34XX

comment "Blackfin high speed USB Support"
	depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523))

config USB_TUSB6010
	boolean "TUSB 6010 support"
	depends on USB_MUSB_HDRC && !USB_MUSB_SOC
	default y
	help
	  The TUSB 6010 chip, from Texas Instruments, connects a discrete
	  HDRC core using a 16-bit parallel bus (NOR flash style) or VLYNQ
	  (a high speed serial link).  It can use system-specific external
	  DMA controllers.

choice
	prompt "Driver Mode"
	depends on USB_MUSB_HDRC
	help
	  Dual-Role devices can support both host and peripheral roles,
	  as well as a the special "OTG Device" role which can switch
	  between both roles as needed.

# use USB_MUSB_HDRC_HCD not USB_MUSB_HOST to #ifdef host side support;
# OTG needs both roles, not just USB_MUSB_HOST.
config USB_MUSB_HOST
	depends on USB
	bool "USB Host"
	help
	  Say Y here if your system supports the USB host role.
	  If it has a USB "A" (rectangular), "Mini-A" (uncommon),
	  or "Mini-AB" connector, it supports the host role.
	  (With a "Mini-AB" connector, you should enable USB OTG.)

# use USB_GADGET_MUSB_HDRC not USB_MUSB_PERIPHERAL to #ifdef peripheral
# side support ... OTG needs both roles
config USB_MUSB_PERIPHERAL
	depends on USB_GADGET
	bool "USB Peripheral (gadget stack)"
	select USB_GADGET_MUSB_HDRC
	help
	  Say Y here if your system supports the USB peripheral role.
	  If it has a USB "B" (squarish), "Mini-B", or "Mini-AB"
	  connector, it supports the peripheral role.
	  (With a "Mini-AB" connector, you should enable USB OTG.)

config USB_MUSB_OTG
	depends on USB && USB_GADGET && PM && EXPERIMENTAL
	bool "Both host and peripheral:  USB OTG (On The Go) Device"
	select USB_GADGET_MUSB_HDRC
	select USB_OTG
	help
	   The most notable feature of USB OTG is support for a
	   "Dual-Role" device, which can act as either a device
	   or a host.  The initial role choice can be changed
	   later, when two dual-role devices talk to each other.

	   At this writing, the OTG support in this driver is incomplete,
	   omitting the mandatory HNP or SRP protocols.  However, some
	   of the cable based role switching works.  (That is, grounding
	   the ID pin switches the controller to host mode, while leaving
	   it floating leaves it in peripheral mode.)

	   Select this if your system has a Mini-AB connector, or
	   to simplify certain kinds of configuration.

	   To implement your OTG Targeted Peripherals List (TPL), enable
	   USB_OTG_WHITELIST and update "drivers/usb/core/otg_whitelist.h"
	   to match your requirements.

endchoice

# enable peripheral support (including with OTG)
config USB_GADGET_MUSB_HDRC
	bool
	depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
#	default y
#	select USB_GADGET_DUALSPEED
#	select USB_GADGET_SELECTED

# enables host support (including with OTG)
config USB_MUSB_HDRC_HCD
	bool
	depends on USB_MUSB_HDRC && (USB_MUSB_HOST || USB_MUSB_OTG)
	select USB_OTG if USB_GADGET_MUSB_HDRC
	default y


config MUSB_PIO_ONLY
	bool 'Disable DMA (always use PIO)'
	depends on USB_MUSB_HDRC
	default y if USB_TUSB6010
	help
	  All data is copied between memory and FIFO by the CPU.
	  DMA controllers are ignored.

	  Do not select 'n' here unless DMA support for your SOC or board
	  is unavailable (or unstable).  When DMA is enabled at compile time,
	  you can still disable it at run time using the "use_dma=n" module
	  parameter.

config USB_INVENTRA_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default ARCH_OMAP2430 || ARCH_OMAP34XX || BLACKFIN
	help
	  Enable DMA transfers using Mentor's engine.

config USB_TI_CPPI_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default ARCH_DAVINCI
	help
	  Enable DMA transfers when TI CPPI DMA is available.

config USB_TUSB_OMAP_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	depends on USB_TUSB6010
	depends on ARCH_OMAP
	default y
	help
	  Enable DMA transfers on TUSB 6010 when OMAP DMA is available.

config	USB_MUSB_DEBUG
	depends on USB_MUSB_HDRC
	bool "Enable debugging messages"
	default n
	help
	  This enables musb debugging. To set the logging level use the debug
	  module parameter. Starting at level 3, per-transfer (urb, usb_request,
	  packet, or dma transfer) tracing may kick in.
