aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/dwc3-omap.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
commita481991467d38afb43c3921d5b5b59ccb61b04ba (patch)
treea4b0b9a14da6fd5ef7b9b512bb32dbfcfcf2cd71 /drivers/usb/dwc3/dwc3-omap.c
parentf6a26ae7699416d86bea8cb68ce413571e9cab3c (diff)
parentcda4db53e9c28061c100400e1a4d273ea61dfba9 (diff)
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman: "Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window. It's touches a lot of different parts of the kernel, all USB drivers, due to some API cleanups (getting rid of the ancient err() macro) and some changes that are needed for USB 3.0 power management updates. There are also lots of new drivers, pimarily gadget, but others as well. We deleted a staging driver, which was nice, and finally dropped the obsolete usbfs code, which will make Al happy to never have to touch that again. There were some build errors in the tree that linux-next found a few days ago, but those were fixed by the most recent changes (all were due to us not building with CONFIG_PM disabled.) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits) xhci: Fix DIV_ROUND_UP compile error. xhci: Fix compile with CONFIG_USB_SUSPEND=n USB: Fix core compile with CONFIG_USB_SUSPEND=n brcm80211: Fix compile error for .disable_hub_initiated_lpm. Revert "USB: EHCI: work around bug in the Philips ISP1562 controller" MAINTAINERS: Add myself as maintainer to the USB PHY Layer USB: EHCI: fix command register configuration lost problem USB: Remove races in devio.c USB: ehci-platform: remove update_device USB: Disable hub-initiated LPM for comms devices. xhci: Add Intel U1/U2 timeout policy. xhci: Add infrastructure for host-specific LPM policies. USB: Add macros for interrupt endpoint types. xhci: Reserve one command for USB3 LPM disable. xhci: Some Evaluate Context commands must succeed. USB: Disable USB 3.0 LPM in critical sections. USB: Add support to enable/disable USB3 link states. USB: Allow drivers to disable hub-initiated LPM. USB: Calculate USB 3.0 exit latencies for LPM. USB: Refactor code to set LPM support flag. ... Conflicts: arch/arm/mach-exynos/mach-nuri.c arch/arm/mach-exynos/mach-universal_c210.c drivers/net/wireless/ath/ath6kl/usb.c
Diffstat (limited to 'drivers/usb/dwc3/dwc3-omap.c')
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index d7d9c0ec9515..479dc047da3a 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -49,7 +49,6 @@
49#include <linux/of.h> 49#include <linux/of.h>
50 50
51#include "core.h" 51#include "core.h"
52#include "io.h"
53 52
54/* 53/*
55 * All these registers belong to OMAP's Wrapper around the 54 * All these registers belong to OMAP's Wrapper around the
@@ -143,6 +142,17 @@ struct dwc3_omap {
143 u32 dma_status:1; 142 u32 dma_status:1;
144}; 143};
145 144
145static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
146{
147 return readl(base + offset);
148}
149
150static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
151{
152 writel(value, base + offset);
153}
154
155
146static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap) 156static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
147{ 157{
148 struct dwc3_omap *omap = _omap; 158 struct dwc3_omap *omap = _omap;
@@ -150,7 +160,7 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
150 160
151 spin_lock(&omap->lock); 161 spin_lock(&omap->lock);
152 162
153 reg = dwc3_readl(omap->base, USBOTGSS_IRQSTATUS_1); 163 reg = dwc3_omap_readl(omap->base, USBOTGSS_IRQSTATUS_1);
154 164
155 if (reg & USBOTGSS_IRQ1_DMADISABLECLR) { 165 if (reg & USBOTGSS_IRQ1_DMADISABLECLR) {
156 dev_dbg(omap->dev, "DMA Disable was Cleared\n"); 166 dev_dbg(omap->dev, "DMA Disable was Cleared\n");
@@ -184,10 +194,10 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
184 if (reg & USBOTGSS_IRQ1_IDPULLUP_FALL) 194 if (reg & USBOTGSS_IRQ1_IDPULLUP_FALL)
185 dev_dbg(omap->dev, "IDPULLUP Fall\n"); 195 dev_dbg(omap->dev, "IDPULLUP Fall\n");
186 196
187 dwc3_writel(omap->base, USBOTGSS_IRQSTATUS_1, reg); 197 dwc3_omap_writel(omap->base, USBOTGSS_IRQSTATUS_1, reg);
188 198
189 reg = dwc3_readl(omap->base, USBOTGSS_IRQSTATUS_0); 199 reg = dwc3_omap_readl(omap->base, USBOTGSS_IRQSTATUS_0);
190 dwc3_writel(omap->base, USBOTGSS_IRQSTATUS_0, reg); 200 dwc3_omap_writel(omap->base, USBOTGSS_IRQSTATUS_0, reg);
191 201
192 spin_unlock(&omap->lock); 202 spin_unlock(&omap->lock);
193 203
@@ -270,7 +280,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
270 omap->base = base; 280 omap->base = base;
271 omap->dwc3 = dwc3; 281 omap->dwc3 = dwc3;
272 282
273 reg = dwc3_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS); 283 reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
274 284
275 utmi_mode = of_get_property(node, "utmi-mode", &size); 285 utmi_mode = of_get_property(node, "utmi-mode", &size);
276 if (utmi_mode && size == sizeof(*utmi_mode)) { 286 if (utmi_mode && size == sizeof(*utmi_mode)) {
@@ -293,10 +303,10 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
293 } 303 }
294 } 304 }
295 305
296 dwc3_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS, reg); 306 dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS, reg);
297 307
298 /* check the DMA Status */ 308 /* check the DMA Status */
299 reg = dwc3_readl(omap->base, USBOTGSS_SYSCONFIG); 309 reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
300 omap->dma_status = !!(reg & USBOTGSS_SYSCONFIG_DMADISABLE); 310 omap->dma_status = !!(reg & USBOTGSS_SYSCONFIG_DMADISABLE);
301 311
302 /* Set No-Idle and No-Standby */ 312 /* Set No-Idle and No-Standby */
@@ -306,7 +316,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
306 reg |= (USBOTGSS_SYSCONFIG_STANDBYMODE(USBOTGSS_STANDBYMODE_NO_STANDBY) 316 reg |= (USBOTGSS_SYSCONFIG_STANDBYMODE(USBOTGSS_STANDBYMODE_NO_STANDBY)
307 | USBOTGSS_SYSCONFIG_IDLEMODE(USBOTGSS_IDLEMODE_NO_IDLE)); 317 | USBOTGSS_SYSCONFIG_IDLEMODE(USBOTGSS_IDLEMODE_NO_IDLE));
308 318
309 dwc3_writel(omap->base, USBOTGSS_SYSCONFIG, reg); 319 dwc3_omap_writel(omap->base, USBOTGSS_SYSCONFIG, reg);
310 320
311 ret = devm_request_irq(dev, omap->irq, dwc3_omap_interrupt, 0, 321 ret = devm_request_irq(dev, omap->irq, dwc3_omap_interrupt, 0,
312 "dwc3-omap", omap); 322 "dwc3-omap", omap);
@@ -318,7 +328,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
318 328
319 /* enable all IRQs */ 329 /* enable all IRQs */
320 reg = USBOTGSS_IRQO_COREIRQ_ST; 330 reg = USBOTGSS_IRQO_COREIRQ_ST;
321 dwc3_writel(omap->base, USBOTGSS_IRQENABLE_SET_0, reg); 331 dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_0, reg);
322 332
323 reg = (USBOTGSS_IRQ1_OEVT | 333 reg = (USBOTGSS_IRQ1_OEVT |
324 USBOTGSS_IRQ1_DRVVBUS_RISE | 334 USBOTGSS_IRQ1_DRVVBUS_RISE |
@@ -330,7 +340,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
330 USBOTGSS_IRQ1_DISCHRGVBUS_FALL | 340 USBOTGSS_IRQ1_DISCHRGVBUS_FALL |
331 USBOTGSS_IRQ1_IDPULLUP_FALL); 341 USBOTGSS_IRQ1_IDPULLUP_FALL);
332 342
333 dwc3_writel(omap->base, USBOTGSS_IRQENABLE_SET_1, reg); 343 dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_1, reg);
334 344
335 ret = platform_device_add_resources(dwc3, pdev->resource, 345 ret = platform_device_add_resources(dwc3, pdev->resource,
336 pdev->num_resources); 346 pdev->num_resources);