aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-09-11 04:53:23 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:40:59 -0400
commitc767c1c6f1febbd1351cc152bba6e37889322d17 (patch)
tree8385c715dbdeef2b90f11dcef7b3e0dcdf49992a /drivers
parent64ca44a65adf131c4df5124fe0fcdc3896f0f0dc (diff)
usb: musb_hdrc build fixes
Minor musb_hdrc updates: - so it'll build on DaVinci, given relevant platform updates; * remove support for an un-shipped OTG prototype * rely on gpiolib framework conversion for the I2C GPIOs * the <asm/arch/hdrc_cnf.h> mechanism has been removed - catch comments up to the recent removal of the per-SOC header with the silicon configuration data; - and remove two inappropriate "inline" declarations which just bloat host side code. There are still some more <asm/arch/XYZ.h> ==> <mach/XYZ.h> changes needed in this driver, catching up to the relocation of most of the include/asm-arm/arch-* contents. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Cc: stable <stable@kernel.org> [2.6.27] Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/musb/Kconfig4
-rw-r--r--drivers/usb/musb/cppi_dma.h4
-rw-r--r--drivers/usb/musb/davinci.c20
-rw-r--r--drivers/usb/musb/musb_core.c8
-rw-r--r--drivers/usb/musb/musb_host.c6
5 files changed, 13 insertions, 29 deletions
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 58b2b8fc9439..4b9542bbb35c 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -33,10 +33,6 @@ config USB_MUSB_SOC
33 default y if ARCH_DAVINCI 33 default y if ARCH_DAVINCI
34 default y if ARCH_OMAP2430 34 default y if ARCH_OMAP2430
35 default y if ARCH_OMAP34XX 35 default y if ARCH_OMAP34XX
36 help
37 Use a static <asm/arch/hdrc_cnf.h> file to describe how the
38 controller is configured (endpoints, mechanisms, etc) on the
39 current iteration of a given system-on-chip.
40 36
41comment "DaVinci 644x USB support" 37comment "DaVinci 644x USB support"
42 depends on USB_MUSB_HDRC && ARCH_DAVINCI 38 depends on USB_MUSB_HDRC && ARCH_DAVINCI
diff --git a/drivers/usb/musb/cppi_dma.h b/drivers/usb/musb/cppi_dma.h
index fc5216b5d2c5..729b4071787b 100644
--- a/drivers/usb/musb/cppi_dma.h
+++ b/drivers/usb/musb/cppi_dma.h
@@ -119,8 +119,8 @@ struct cppi {
119 void __iomem *mregs; /* Mentor regs */ 119 void __iomem *mregs; /* Mentor regs */
120 void __iomem *tibase; /* TI/CPPI regs */ 120 void __iomem *tibase; /* TI/CPPI regs */
121 121
122 struct cppi_channel tx[MUSB_C_NUM_EPT - 1]; 122 struct cppi_channel tx[4];
123 struct cppi_channel rx[MUSB_C_NUM_EPR - 1]; 123 struct cppi_channel rx[4];
124 124
125 struct dma_pool *pool; 125 struct dma_pool *pool;
126 126
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 75baf181a8cd..dfb3bcbe00fc 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -30,6 +30,7 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/gpio.h>
33 34
34#include <asm/arch/hardware.h> 35#include <asm/arch/hardware.h>
35#include <asm/arch/memory.h> 36#include <asm/arch/memory.h>
@@ -39,7 +40,7 @@
39#include "musb_core.h" 40#include "musb_core.h"
40 41
41#ifdef CONFIG_MACH_DAVINCI_EVM 42#ifdef CONFIG_MACH_DAVINCI_EVM
42#include <asm/arch/i2c-client.h> 43#define GPIO_nVBUS_DRV 87
43#endif 44#endif
44 45
45#include "davinci.h" 46#include "davinci.h"
@@ -138,7 +139,6 @@ static int vbus_state = -1;
138/* VBUS SWITCHING IS BOARD-SPECIFIC */ 139/* VBUS SWITCHING IS BOARD-SPECIFIC */
139 140
140#ifdef CONFIG_MACH_DAVINCI_EVM 141#ifdef CONFIG_MACH_DAVINCI_EVM
141#ifndef CONFIG_MACH_DAVINCI_EVM_OTG
142 142
143/* I2C operations are always synchronous, and require a task context. 143/* I2C operations are always synchronous, and require a task context.
144 * With unloaded systems, using the shared workqueue seems to suffice 144 * With unloaded systems, using the shared workqueue seems to suffice
@@ -146,12 +146,11 @@ static int vbus_state = -1;
146 */ 146 */
147static void evm_deferred_drvvbus(struct work_struct *ignored) 147static void evm_deferred_drvvbus(struct work_struct *ignored)
148{ 148{
149 davinci_i2c_expander_op(0x3a, USB_DRVVBUS, vbus_state); 149 gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
150 vbus_state = !vbus_state; 150 vbus_state = !vbus_state;
151} 151}
152static DECLARE_WORK(evm_vbus_work, evm_deferred_drvvbus); 152static DECLARE_WORK(evm_vbus_work, evm_deferred_drvvbus);
153 153
154#endif /* modified board */
155#endif /* EVM */ 154#endif /* EVM */
156 155
157static void davinci_source_power(struct musb *musb, int is_on, int immediate) 156static void davinci_source_power(struct musb *musb, int is_on, int immediate)
@@ -165,21 +164,10 @@ static void davinci_source_power(struct musb *musb, int is_on, int immediate)
165 164
166#ifdef CONFIG_MACH_DAVINCI_EVM 165#ifdef CONFIG_MACH_DAVINCI_EVM
167 if (machine_is_davinci_evm()) { 166 if (machine_is_davinci_evm()) {
168#ifdef CONFIG_MACH_DAVINCI_EVM_OTG
169 /* modified EVM board switching VBUS with GPIO(6) not I2C
170 * NOTE: PINMUX0.RGB888 (bit23) must be clear
171 */
172 if (is_on)
173 gpio_set(GPIO(6));
174 else
175 gpio_clear(GPIO(6));
176 immediate = 1;
177#else
178 if (immediate) 167 if (immediate)
179 davinci_i2c_expander_op(0x3a, USB_DRVVBUS, !is_on); 168 gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
180 else 169 else
181 schedule_work(&evm_vbus_work); 170 schedule_work(&evm_vbus_work);
182#endif
183 } 171 }
184#endif 172#endif
185 if (immediate) 173 if (immediate)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index bd82253a3329..d5af6b0d8af5 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -82,9 +82,9 @@
82/* 82/*
83 * This gets many kinds of configuration information: 83 * This gets many kinds of configuration information:
84 * - Kconfig for everything user-configurable 84 * - Kconfig for everything user-configurable
85 * - <asm/arch/hdrc_cnf.h> for SOC or family details
86 * - platform_device for addressing, irq, and platform_data 85 * - platform_device for addressing, irq, and platform_data
87 * - platform_data is mostly for board-specific informarion 86 * - platform_data is mostly for board-specific informarion
87 * (plus recentrly, SOC or family details)
88 * 88 *
89 * Most of the conditional compilation will (someday) vanish. 89 * Most of the conditional compilation will (someday) vanish.
90 */ 90 */
@@ -974,9 +974,9 @@ static void musb_shutdown(struct platform_device *pdev)
974/* 974/*
975 * The silicon either has hard-wired endpoint configurations, or else 975 * The silicon either has hard-wired endpoint configurations, or else
976 * "dynamic fifo" sizing. The driver has support for both, though at this 976 * "dynamic fifo" sizing. The driver has support for both, though at this
977 * writing only the dynamic sizing is very well tested. We use normal 977 * writing only the dynamic sizing is very well tested. Since we switched
978 * idioms to so both modes are compile-tested, but dead code elimination 978 * away from compile-time hardware parameters, we can no longer rely on
979 * leaves only the relevant one in the object file. 979 * dead code elimination to leave only the relevant one in the object file.
980 * 980 *
981 * We don't currently use dynamic fifo setup capability to do anything 981 * We don't currently use dynamic fifo setup capability to do anything
982 * more than selecting one of a bunch of predefined configurations. 982 * more than selecting one of a bunch of predefined configurations.
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 17b5c189250e..3133990f04ec 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -108,7 +108,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
108/* 108/*
109 * Clear TX fifo. Needed to avoid BABBLE errors. 109 * Clear TX fifo. Needed to avoid BABBLE errors.
110 */ 110 */
111static inline void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) 111static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep)
112{ 112{
113 void __iomem *epio = ep->regs; 113 void __iomem *epio = ep->regs;
114 u16 csr; 114 u16 csr;
@@ -435,7 +435,7 @@ musb_advance_schedule(struct musb *musb, struct urb *urb,
435 } 435 }
436} 436}
437 437
438static inline u16 musb_h_flush_rxfifo(struct musb_hw_ep *hw_ep, u16 csr) 438static u16 musb_h_flush_rxfifo(struct musb_hw_ep *hw_ep, u16 csr)
439{ 439{
440 /* we don't want fifo to fill itself again; 440 /* we don't want fifo to fill itself again;
441 * ignore dma (various models), 441 * ignore dma (various models),
@@ -1004,7 +1004,7 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb)
1004 1004
1005/* 1005/*
1006 * Handle default endpoint interrupt as host. Only called in IRQ time 1006 * Handle default endpoint interrupt as host. Only called in IRQ time
1007 * from the LinuxIsr() interrupt service routine. 1007 * from musb_interrupt().
1008 * 1008 *
1009 * called with controller irqlocked 1009 * called with controller irqlocked
1010 */ 1010 */