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 Original line Diff line number Diff line
@@ -46,7 +46,7 @@ static struct device *mmc_device;
#define TUSB6010_GPIO_ENABLE	0
#define TUSB6010_GPIO_ENABLE	0
#define TUSB6010_DMACHAN	0x3f
#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
 * 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
 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
+34 −25
Original line number Original line Diff line number Diff line
@@ -6,7 +6,6 @@
# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
config USB_MUSB_HDRC
	depends on USB && USB_GADGET
	depends on USB && USB_GADGET
	depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
	select TWL4030_USB if MACH_OMAP_3430SDP
	select TWL4030_USB if MACH_OMAP_3430SDP
	select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
	select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
@@ -45,7 +44,6 @@ config USB_MUSB_DA8XX


config USB_MUSB_TUSB6010
config USB_MUSB_TUSB6010
	tristate "TUSB6010"
	tristate "TUSB6010"
	depends on ARCH_OMAP


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


endchoice
endchoice


config MUSB_PIO_ONLY
choice
	bool 'Disable DMA (always use PIO)'
	prompt 'MUSB DMA mode'
	depends on USB_MUSB_HDRC
	default USB_UX500_DMA if USB_MUSB_UX500
	default USB_MUSB_TUSB6010 || USB_MUSB_DA8XX || USB_MUSB_AM35X
	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
	help
	  All data is copied between memory and FIFO by the CPU.
	  Unfortunately, only one option can be enabled here. Ideally one
	  DMA controllers are ignored.
	  should be able to build all these drivers into one kernel to

	  allow using DMA on multiplatform kernels.
	  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_UX500_DMA
config USB_UX500_DMA
	bool
	bool 'ST Ericsson U8500 and U5500'
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	depends on USB_MUSB_HDRC
	default USB_MUSB_UX500
	depends on USB_MUSB_UX500
	help
	help
	  Enable DMA transfers on UX500 platforms.
	  Enable DMA transfers on UX500 platforms.


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


config USB_TI_CPPI_DMA
config USB_TI_CPPI_DMA
	bool
	bool 'TI CPPI (Davinci)'
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	depends on USB_MUSB_HDRC
	default USB_MUSB_DAVINCI
	depends on USB_MUSB_DAVINCI
	help
	help
	  Enable DMA transfers when TI CPPI DMA is available.
	  Enable DMA transfers when TI CPPI DMA is available.


config USB_TUSB_OMAP_DMA
config USB_TUSB_OMAP_DMA
	bool
	bool 'TUSB 6010'
	depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY
	depends on USB_MUSB_HDRC
	depends on USB_MUSB_TUSB6010
	depends on USB_MUSB_TUSB6010
	depends on ARCH_OMAP
	depends on ARCH_OMAP
	default y
	help
	help
	  Enable DMA transfers on TUSB 6010 when OMAP DMA is available.
	  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 Original line Diff line number Diff line
@@ -24,25 +24,7 @@ obj-$(CONFIG_USB_MUSB_UX500) += ux500.o
# PIO only, or DMA (several potential schemes).
# PIO only, or DMA (several potential schemes).
# though PIO is always there to back up DMA, and for ep0
# though PIO is always there to back up DMA, and for ep0


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

musb_hdrc-$(CONFIG_USB_TI_CPPI_DMA)		+= cppi_dma.o
  ifeq ($(CONFIG_USB_INVENTRA_DMA),y)
musb_hdrc-$(CONFIG_USB_TUSB_OMAP_DMA)		+= tusb6010_omap.o
    musb_hdrc-y			+= musbhsdma.o
musb_hdrc-$(CONFIG_USB_UX500_DMA)		+= ux500_dma.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
+4 −1
Original line number Original line 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;
		struct musb_hw_ep	*hw_ep = musb->endpoints + i;


		hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
		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_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i);
		hw_ep->fifo_sync_va =
		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
#else
#define use_dma			0
#define use_dma			0
@@ -2157,6 +2158,7 @@ static void musb_save_context(struct musb *musb)
		if (!epio)
		if (!epio)
			continue;
			continue;


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


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


	u8 devctl, busctl, misc;
	u8 devctl, busctl, misc;
	u32 otg_interfsel;


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


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


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


	struct otg_transceiver	*xceiv;
	struct otg_transceiver	*xceiv;
	u8			xceiv_event;


	int nIrq;
	int nIrq;
	unsigned		irq_wake:1;
	unsigned		irq_wake:1;
Loading