~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/usb/gadget/imx_udc.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <linux/clk.h>
30
30
#include <linux/delay.h>
31
31
#include <linux/timer.h>
 
32
#include <linux/slab.h>
32
33
 
33
34
#include <linux/usb/ch9.h>
34
35
#include <linux/usb/gadget.h>
1190
1191
        return IRQ_HANDLED;
1191
1192
}
1192
1193
 
 
1194
#ifndef MX1_INT_USBD0
 
1195
#define MX1_INT_USBD0 MX1_USBD_INT0
 
1196
#endif
 
1197
 
1193
1198
static irqreturn_t imx_udc_bulk_irq(int irq, void *dev)
1194
1199
{
1195
1200
        struct imx_udc_struct *imx_usb = dev;
1196
 
        struct imx_ep_struct *imx_ep = &imx_usb->imx_ep[irq - USBD_INT0];
 
1201
        struct imx_ep_struct *imx_ep = &imx_usb->imx_ep[irq - MX1_INT_USBD0];
1197
1202
        int intr = __raw_readl(imx_usb->base + USB_EP_INTR(EP_NO(imx_ep)));
1198
1203
 
1199
 
        dump_ep_intr(__func__, irq - USBD_INT0, intr, imx_usb->dev);
 
1204
        dump_ep_intr(__func__, irq - MX1_INT_USBD0, intr, imx_usb->dev);
1200
1205
 
1201
1206
        if (!imx_usb->driver) {
1202
1207
                __raw_writel(intr, imx_usb->base + USB_EP_INTR(EP_NO(imx_ep)));
1315
1320
};
1316
1321
 
1317
1322
/*******************************************************************************
1318
 
 * USB gadged driver functions
 
1323
 * USB gadget driver functions
1319
1324
 *******************************************************************************
1320
1325
 */
1321
 
int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
1326
int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
 
1327
                int (*bind)(struct usb_gadget *))
1322
1328
{
1323
1329
        struct imx_udc_struct *imx_usb = &controller;
1324
1330
        int retval;
1325
1331
 
1326
1332
        if (!driver
1327
1333
                || driver->speed < USB_SPEED_FULL
1328
 
                || !driver->bind
 
1334
                || !bind
1329
1335
                || !driver->disconnect
1330
1336
                || !driver->setup)
1331
1337
                        return -EINVAL;
1341
1347
        retval = device_add(&imx_usb->gadget.dev);
1342
1348
        if (retval)
1343
1349
                goto fail;
1344
 
        retval = driver->bind(&imx_usb->gadget);
 
1350
        retval = bind(&imx_usb->gadget);
1345
1351
        if (retval) {
1346
1352
                D_ERR(imx_usb->dev, "<%s> bind to driver %s --> error %d\n",
1347
1353
                        __func__, driver->driver.name, retval);
1361
1367
        imx_usb->gadget.dev.driver = NULL;
1362
1368
        return retval;
1363
1369
}
1364
 
EXPORT_SYMBOL(usb_gadget_register_driver);
 
1370
EXPORT_SYMBOL(usb_gadget_probe_driver);
1365
1371
 
1366
1372
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1367
1373
{