Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1016ce3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge branch 'for-next/musb' of...

Merge branch 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

* 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb:
  usb: musb: omap2430: fix compile warning
  usb: musb: fix pm_runtime calls while atomic
  usb: musb: drop ARCH dependency
  usb: musb: headers cleanup
  usb: musb: allow building USB_MUSB_TUSB6010 as a module
  usb: musb: use a Kconfig choice to pick the right DMA method
  usb: musb: omap2+: save and restore OTG_INTERFSEL
  usb: musb: omap2+: fix context api's
  usb: musb: ux500: optimize DMA callback routine
parents 007d00d4 e7f4e732
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ static struct device *mmc_device;
#define TUSB6010_GPIO_ENABLE	0
#define TUSB6010_DMACHAN	0x3f

#ifdef CONFIG_USB_MUSB_TUSB6010
#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
/*
 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
+34 −25
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
	depends on USB && USB_GADGET
	depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
	select TWL4030_USB if MACH_OMAP_3430SDP
	select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
@@ -45,7 +44,6 @@ config USB_MUSB_DA8XX

config USB_MUSB_TUSB6010
	tristate "TUSB6010"
	depends on ARCH_OMAP

config USB_MUSB_OMAP2PLUS
	tristate "OMAP2430 and onwards"
@@ -65,46 +63,57 @@ config USB_MUSB_UX500

endchoice

config MUSB_PIO_ONLY
	bool 'Disable DMA (always use PIO)'
	depends on USB_MUSB_HDRC
	default USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X
choice
	prompt 'MUSB DMA mode'
	default USB_UX500_DMA if USB_MUSB_UX500
	default USB_INVENTRA_DMA if USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN
	default USB_TI_CPPI_DMA if USB_MUSB_DAVINCI
	default USB_TUSB_OMAP_DMA if USB_MUSB_TUSB6010
	default MUSB_PIO_ONLY if USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X
	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.
	  Unfortunately, only one option can be enabled here. Ideally one
	  should be able to build all these drivers into one kernel to
	  allow using DMA on multiplatform kernels.

config USB_UX500_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default USB_MUSB_UX500
	bool 'ST Ericsson U8500 and U5500'
	depends on USB_MUSB_HDRC
	depends on USB_MUSB_UX500
	help
	  Enable DMA transfers on UX500 platforms.

config USB_INVENTRA_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN
	bool 'Inventra'
	depends on USB_MUSB_HDRC
	depends on USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN
	help
	  Enable DMA transfers using Mentor's engine.

config USB_TI_CPPI_DMA
	bool
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	default USB_MUSB_DAVINCI
	bool 'TI CPPI (Davinci)'
	depends on USB_MUSB_HDRC
	depends on USB_MUSB_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
	bool 'TUSB 6010'
	depends on USB_MUSB_HDRC
	depends on USB_MUSB_TUSB6010
	depends on ARCH_OMAP
	default y
	help
	  Enable DMA transfers on TUSB 6010 when OMAP DMA is available.

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

	  Do not choose this 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.

endchoice
+4 −22
Original line number Diff line number Diff line
@@ -24,25 +24,7 @@ obj-$(CONFIG_USB_MUSB_UX500) += ux500.o
# PIO only, or DMA (several potential schemes).
# though PIO is always there to back up DMA, and for ep0

ifneq ($(CONFIG_MUSB_PIO_ONLY),y)

  ifeq ($(CONFIG_USB_INVENTRA_DMA),y)
    musb_hdrc-y			+= musbhsdma.o

  else
    ifeq ($(CONFIG_USB_TI_CPPI_DMA),y)
      musb_hdrc-y		+= cppi_dma.o

    else
      ifeq ($(CONFIG_USB_TUSB_OMAP_DMA),y)
	musb_hdrc-y		+= tusb6010_omap.o

      else
        ifeq ($(CONFIG_USB_UX500_DMA),y)
	  musb_hdrc-y		+= ux500_dma.o

        endif
      endif
    endif
  endif
endif
musb_hdrc-$(CONFIG_USB_INVENTRA_DMA)		+= musbhsdma.o
musb_hdrc-$(CONFIG_USB_TI_CPPI_DMA)		+= cppi_dma.o
musb_hdrc-$(CONFIG_USB_TUSB_OMAP_DMA)		+= tusb6010_omap.o
musb_hdrc-$(CONFIG_USB_UX500_DMA)		+= ux500_dma.o
+4 −1
Original line number Diff line number Diff line
@@ -1431,7 +1431,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
		struct musb_hw_ep	*hw_ep = musb->endpoints + i;

		hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
#ifdef CONFIG_USB_MUSB_TUSB6010
#if defined(CONFIG_USB_MUSB_TUSB6010) || defined (CONFIG_USB_MUSB_TUSB6010_MODULE)
		hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync_va =
@@ -1630,6 +1630,7 @@ void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit)
		}
	}
}
EXPORT_SYMBOL_GPL(musb_dma_completion);

#else
#define use_dma			0
@@ -2157,6 +2158,7 @@ static void musb_save_context(struct musb *musb)
		if (!epio)
			continue;

		musb_writeb(musb_base, MUSB_INDEX, i);
		musb->context.index_regs[i].txmaxp =
			musb_readw(epio, MUSB_TXMAXP);
		musb->context.index_regs[i].txcsr =
@@ -2232,6 +2234,7 @@ static void musb_restore_context(struct musb *musb)
		if (!epio)
			continue;

		musb_writeb(musb_base, MUSB_INDEX, i);
		musb_writew(epio, MUSB_TXMAXP,
			musb->context.index_regs[i].txmaxp);
		musb_writew(epio, MUSB_TXCSR,
+3 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
@@ -311,6 +310,7 @@ struct musb_context_registers {
	u8 index, testmode;

	u8 devctl, busctl, misc;
	u32 otg_interfsel;

	struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
};
@@ -327,6 +327,7 @@ struct musb {

	irqreturn_t		(*isr)(int, void *);
	struct work_struct	irq_work;
	struct work_struct	otg_notifier_work;
	u16			hwvers;

/* this hub status bit is reserved by USB 2.0 and not seen by usbcore */
@@ -372,6 +373,7 @@ struct musb {
	u16			int_tx;

	struct otg_transceiver	*xceiv;
	u8			xceiv_event;

	int nIrq;
	unsigned		irq_wake:1;
Loading