Here are a bunch of USB patches for 3.3-rc1.

Nothing major, largest thing here is the removal of some drivers that
 did not work at all.  Other than that, the normal collection of bugfixes
 and new device ids.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk8m8JEACgkQMUfUDdst+ymCFQCeNhTHopHy1PQbuCDwk8bSH4DW
 1/YAn2k0YaaCrOo0HCzOslAVX18vGnWl
 =TNNB
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Here are a bunch of USB patches for 3.3-rc1.

Nothing major, largest thing here is the removal of some drivers that
did not work at all.  Other than that, the normal collection of bugfixes
and new device ids.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

* tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (52 commits)
  uwb & wusb: fix kconfig error
  USB: Realtek cr: fix autopm scheduling while atomic
  USB: ftdi_sio: Add more identifiers
  xHCI: Cleanup isoc transfer ring when TD length mismatch found
  usb: musb: omap2430: minor cleanups.
  qcaux: add more Pantech UML190 and UML290 ports
  Revert "drivers: usb: Fix dependency for USB_HWA_HCD"
  usb: mv-otg - Fix build if CONFIG_USB is not set
  USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
  usb: add support for STA2X11 host driver
  drivers: usb: Fix dependency for USB_HWA_HCD
  kernel-doc: fix new warning in usb.h
  USB: OHCI: fix new compiler warnings
  usb: serial: kobil_sct: fix compile warning:
  drivers/usb/host/ehci-fsl.c: add missing iounmap
  USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
  USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal
  USB: cdc-wdm: use two mutexes to allow simultaneous read and write
  USB: cdc-wdm: updating desc->length must be protected by spin_lock
  USB: usbsevseg: fix max length
  ...
This commit is contained in:
Linus Torvalds 2012-01-30 11:38:28 -08:00
commit 6bc2b95ee6
37 changed files with 223 additions and 2731 deletions

View File

@ -57,6 +57,8 @@ MODULE_DEVICE_TABLE (usb, wdm_ids);
#define WDM_MAX 16 #define WDM_MAX 16
/* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 decimal (0x100)" */
#define WDM_DEFAULT_BUFSIZE 256
static DEFINE_MUTEX(wdm_mutex); static DEFINE_MUTEX(wdm_mutex);
@ -88,7 +90,8 @@ struct wdm_device {
int count; int count;
dma_addr_t shandle; dma_addr_t shandle;
dma_addr_t ihandle; dma_addr_t ihandle;
struct mutex lock; struct mutex wlock;
struct mutex rlock;
wait_queue_head_t wait; wait_queue_head_t wait;
struct work_struct rxwork; struct work_struct rxwork;
int werr; int werr;
@ -323,7 +326,7 @@ static ssize_t wdm_write
} }
/* concurrent writes and disconnect */ /* concurrent writes and disconnect */
r = mutex_lock_interruptible(&desc->lock); r = mutex_lock_interruptible(&desc->wlock);
rv = -ERESTARTSYS; rv = -ERESTARTSYS;
if (r) { if (r) {
kfree(buf); kfree(buf);
@ -386,7 +389,7 @@ static ssize_t wdm_write
out: out:
usb_autopm_put_interface(desc->intf); usb_autopm_put_interface(desc->intf);
outnp: outnp:
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
outnl: outnl:
return rv < 0 ? rv : count; return rv < 0 ? rv : count;
} }
@ -399,7 +402,7 @@ static ssize_t wdm_read
struct wdm_device *desc = file->private_data; struct wdm_device *desc = file->private_data;
rv = mutex_lock_interruptible(&desc->lock); /*concurrent reads */ rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
if (rv < 0) if (rv < 0)
return -ERESTARTSYS; return -ERESTARTSYS;
@ -467,14 +470,16 @@ retry:
for (i = 0; i < desc->length - cntr; i++) for (i = 0; i < desc->length - cntr; i++)
desc->ubuf[i] = desc->ubuf[i + cntr]; desc->ubuf[i] = desc->ubuf[i + cntr];
spin_lock_irq(&desc->iuspin);
desc->length -= cntr; desc->length -= cntr;
spin_unlock_irq(&desc->iuspin);
/* in case we had outstanding data */ /* in case we had outstanding data */
if (!desc->length) if (!desc->length)
clear_bit(WDM_READ, &desc->flags); clear_bit(WDM_READ, &desc->flags);
rv = cntr; rv = cntr;
err: err:
mutex_unlock(&desc->lock); mutex_unlock(&desc->rlock);
return rv; return rv;
} }
@ -540,7 +545,8 @@ static int wdm_open(struct inode *inode, struct file *file)
} }
intf->needs_remote_wakeup = 1; intf->needs_remote_wakeup = 1;
mutex_lock(&desc->lock); /* using write lock to protect desc->count */
mutex_lock(&desc->wlock);
if (!desc->count++) { if (!desc->count++) {
desc->werr = 0; desc->werr = 0;
desc->rerr = 0; desc->rerr = 0;
@ -553,7 +559,7 @@ static int wdm_open(struct inode *inode, struct file *file)
} else { } else {
rv = 0; rv = 0;
} }
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
usb_autopm_put_interface(desc->intf); usb_autopm_put_interface(desc->intf);
out: out:
mutex_unlock(&wdm_mutex); mutex_unlock(&wdm_mutex);
@ -565,9 +571,11 @@ static int wdm_release(struct inode *inode, struct file *file)
struct wdm_device *desc = file->private_data; struct wdm_device *desc = file->private_data;
mutex_lock(&wdm_mutex); mutex_lock(&wdm_mutex);
mutex_lock(&desc->lock);
/* using write lock to protect desc->count */
mutex_lock(&desc->wlock);
desc->count--; desc->count--;
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
if (!desc->count) { if (!desc->count) {
dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
@ -630,7 +638,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
struct usb_cdc_dmm_desc *dmhd; struct usb_cdc_dmm_desc *dmhd;
u8 *buffer = intf->altsetting->extra; u8 *buffer = intf->altsetting->extra;
int buflen = intf->altsetting->extralen; int buflen = intf->altsetting->extralen;
u16 maxcom = 0; u16 maxcom = WDM_DEFAULT_BUFSIZE;
if (!buffer) if (!buffer)
goto out; goto out;
@ -665,7 +673,8 @@ next_desc:
desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL); desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL);
if (!desc) if (!desc)
goto out; goto out;
mutex_init(&desc->lock); mutex_init(&desc->rlock);
mutex_init(&desc->wlock);
spin_lock_init(&desc->iuspin); spin_lock_init(&desc->iuspin);
init_waitqueue_head(&desc->wait); init_waitqueue_head(&desc->wait);
desc->wMaxCommand = maxcom; desc->wMaxCommand = maxcom;
@ -716,7 +725,7 @@ next_desc:
goto err; goto err;
desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf), desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
desc->bMaxPacketSize0, desc->wMaxCommand,
GFP_KERNEL, GFP_KERNEL,
&desc->response->transfer_dma); &desc->response->transfer_dma);
if (!desc->inbuf) if (!desc->inbuf)
@ -779,11 +788,13 @@ static void wdm_disconnect(struct usb_interface *intf)
/* to terminate pending flushes */ /* to terminate pending flushes */
clear_bit(WDM_IN_USE, &desc->flags); clear_bit(WDM_IN_USE, &desc->flags);
spin_unlock_irqrestore(&desc->iuspin, flags); spin_unlock_irqrestore(&desc->iuspin, flags);
mutex_lock(&desc->lock); wake_up_all(&desc->wait);
mutex_lock(&desc->rlock);
mutex_lock(&desc->wlock);
kill_urbs(desc); kill_urbs(desc);
cancel_work_sync(&desc->rxwork); cancel_work_sync(&desc->rxwork);
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
wake_up_all(&desc->wait); mutex_unlock(&desc->rlock);
if (!desc->count) if (!desc->count)
cleanup(desc); cleanup(desc);
mutex_unlock(&wdm_mutex); mutex_unlock(&wdm_mutex);
@ -798,8 +809,10 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor);
/* if this is an autosuspend the caller does the locking */ /* if this is an autosuspend the caller does the locking */
if (!PMSG_IS_AUTO(message)) if (!PMSG_IS_AUTO(message)) {
mutex_lock(&desc->lock); mutex_lock(&desc->rlock);
mutex_lock(&desc->wlock);
}
spin_lock_irq(&desc->iuspin); spin_lock_irq(&desc->iuspin);
if (PMSG_IS_AUTO(message) && if (PMSG_IS_AUTO(message) &&
@ -815,8 +828,10 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
kill_urbs(desc); kill_urbs(desc);
cancel_work_sync(&desc->rxwork); cancel_work_sync(&desc->rxwork);
} }
if (!PMSG_IS_AUTO(message)) if (!PMSG_IS_AUTO(message)) {
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
mutex_unlock(&desc->rlock);
}
return rv; return rv;
} }
@ -854,7 +869,8 @@ static int wdm_pre_reset(struct usb_interface *intf)
{ {
struct wdm_device *desc = usb_get_intfdata(intf); struct wdm_device *desc = usb_get_intfdata(intf);
mutex_lock(&desc->lock); mutex_lock(&desc->rlock);
mutex_lock(&desc->wlock);
kill_urbs(desc); kill_urbs(desc);
/* /*
@ -876,7 +892,8 @@ static int wdm_post_reset(struct usb_interface *intf)
int rv; int rv;
rv = recover_from_urb_loss(desc); rv = recover_from_urb_loss(desc);
mutex_unlock(&desc->lock); mutex_unlock(&desc->wlock);
mutex_unlock(&desc->rlock);
return 0; return 0;
} }

View File

@ -126,7 +126,6 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,
struct dwc3_request *req) struct dwc3_request *req)
{ {
struct dwc3 *dwc = dep->dwc; struct dwc3 *dwc = dep->dwc;
u32 type;
int ret = 0; int ret = 0;
req->request.actual = 0; req->request.actual = 0;
@ -149,20 +148,14 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,
direction = !!(dep->flags & DWC3_EP0_DIR_IN); direction = !!(dep->flags & DWC3_EP0_DIR_IN);
if (dwc->ep0state == EP0_STATUS_PHASE) { if (dwc->ep0state != EP0_DATA_PHASE) {
type = dwc->three_stage_setup dev_WARN(dwc->dev, "Unexpected pending request\n");
? DWC3_TRBCTL_CONTROL_STATUS3
: DWC3_TRBCTL_CONTROL_STATUS2;
} else if (dwc->ep0state == EP0_DATA_PHASE) {
type = DWC3_TRBCTL_CONTROL_DATA;
} else {
/* should never happen */
WARN_ON(1);
return 0; return 0;
} }
ret = dwc3_ep0_start_trans(dwc, direction, ret = dwc3_ep0_start_trans(dwc, direction,
req->request.dma, req->request.length, type); req->request.dma, req->request.length,
DWC3_TRBCTL_CONTROL_DATA);
dep->flags &= ~(DWC3_EP_PENDING_REQUEST | dep->flags &= ~(DWC3_EP_PENDING_REQUEST |
DWC3_EP0_DIR_IN); DWC3_EP0_DIR_IN);
} else if (dwc->delayed_status) { } else if (dwc->delayed_status) {

View File

@ -101,7 +101,7 @@ void dwc3_unmap_buffer_from_dma(struct dwc3_request *req)
if (req->request.num_mapped_sgs) { if (req->request.num_mapped_sgs) {
req->request.dma = DMA_ADDR_INVALID; req->request.dma = DMA_ADDR_INVALID;
dma_unmap_sg(dwc->dev, req->request.sg, dma_unmap_sg(dwc->dev, req->request.sg,
req->request.num_sgs, req->request.num_mapped_sgs,
req->direction ? DMA_TO_DEVICE req->direction ? DMA_TO_DEVICE
: DMA_FROM_DEVICE); : DMA_FROM_DEVICE);

View File

@ -175,13 +175,12 @@ ep_found:
_ep->comp_desc = comp_desc; _ep->comp_desc = comp_desc;
if (g->speed == USB_SPEED_SUPER) { if (g->speed == USB_SPEED_SUPER) {
switch (usb_endpoint_type(_ep->desc)) { switch (usb_endpoint_type(_ep->desc)) {
case USB_ENDPOINT_XFER_BULK:
case USB_ENDPOINT_XFER_INT:
_ep->maxburst = comp_desc->bMaxBurst;
break;
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
/* mult: bits 1:0 of bmAttributes */ /* mult: bits 1:0 of bmAttributes */
_ep->mult = comp_desc->bmAttributes & 0x3; _ep->mult = comp_desc->bmAttributes & 0x3;
case USB_ENDPOINT_XFER_BULK:
case USB_ENDPOINT_XFER_INT:
_ep->maxburst = comp_desc->bMaxBurst;
break; break;
default: default:
/* Do nothing for control endpoints */ /* Do nothing for control endpoints */

View File

@ -126,7 +126,7 @@ ep_matches (
* descriptor and see if the EP matches it * descriptor and see if the EP matches it
*/ */
if (usb_endpoint_xfer_bulk(desc)) { if (usb_endpoint_xfer_bulk(desc)) {
if (ep_comp) { if (ep_comp && gadget->max_speed >= USB_SPEED_SUPER) {
num_req_streams = ep_comp->bmAttributes & 0x1f; num_req_streams = ep_comp->bmAttributes & 0x1f;
if (num_req_streams > ep->max_streams) if (num_req_streams > ep->max_streams)
return 0; return 0;

View File

@ -3123,15 +3123,15 @@ fsg_add(struct usb_composite_dev *cdev, struct usb_configuration *c,
struct fsg_module_parameters { struct fsg_module_parameters {
char *file[FSG_MAX_LUNS]; char *file[FSG_MAX_LUNS];
int ro[FSG_MAX_LUNS]; bool ro[FSG_MAX_LUNS];
int removable[FSG_MAX_LUNS]; bool removable[FSG_MAX_LUNS];
int cdrom[FSG_MAX_LUNS]; bool cdrom[FSG_MAX_LUNS];
int nofua[FSG_MAX_LUNS]; bool nofua[FSG_MAX_LUNS];
unsigned int file_count, ro_count, removable_count, cdrom_count; unsigned int file_count, ro_count, removable_count, cdrom_count;
unsigned int nofua_count; unsigned int nofua_count;
unsigned int luns; /* nluns */ unsigned int luns; /* nluns */
int stall; /* can_stall */ bool stall; /* can_stall */
}; };
#define _FSG_MODULE_PARAM_ARRAY(prefix, params, name, type, desc) \ #define _FSG_MODULE_PARAM_ARRAY(prefix, params, name, type, desc) \

View File

@ -1430,7 +1430,7 @@ static void setup_received_irq(struct fsl_udc *udc,
int pipe = get_pipe_by_windex(wIndex); int pipe = get_pipe_by_windex(wIndex);
struct fsl_ep *ep; struct fsl_ep *ep;
if (wValue != 0 || wLength != 0 || pipe > udc->max_ep) if (wValue != 0 || wLength != 0 || pipe >= udc->max_ep)
break; break;
ep = get_ep_by_pipe(udc, pipe); ep = get_ep_by_pipe(udc, pipe);
@ -1673,7 +1673,7 @@ static void dtd_complete_irq(struct fsl_udc *udc)
if (!bit_pos) if (!bit_pos)
return; return;
for (i = 0; i < udc->max_ep * 2; i++) { for (i = 0; i < udc->max_ep; i++) {
ep_num = i >> 1; ep_num = i >> 1;
direction = i % 2; direction = i % 2;

View File

@ -11,11 +11,6 @@
/* #undef DEBUG */ /* #undef DEBUG */
/* #undef VERBOSE_DEBUG */ /* #undef VERBOSE_DEBUG */
#if defined(CONFIG_USB_LANGWELL_OTG)
#define OTG_TRANSCEIVER
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
@ -1522,8 +1517,7 @@ static void langwell_udc_stop(struct langwell_udc *dev)
/* stop all USB activities */ /* stop all USB activities */
static void stop_activity(struct langwell_udc *dev, static void stop_activity(struct langwell_udc *dev)
struct usb_gadget_driver *driver)
{ {
struct langwell_ep *ep; struct langwell_ep *ep;
dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__);
@ -1535,9 +1529,9 @@ static void stop_activity(struct langwell_udc *dev,
} }
/* report disconnect; the driver is already quiesced */ /* report disconnect; the driver is already quiesced */
if (driver) { if (dev->driver) {
spin_unlock(&dev->lock); spin_unlock(&dev->lock);
driver->disconnect(&dev->gadget); dev->driver->disconnect(&dev->gadget);
spin_lock(&dev->lock); spin_lock(&dev->lock);
} }
@ -1925,11 +1919,10 @@ static int langwell_stop(struct usb_gadget *g,
/* stop all usb activities */ /* stop all usb activities */
dev->gadget.speed = USB_SPEED_UNKNOWN; dev->gadget.speed = USB_SPEED_UNKNOWN;
stop_activity(dev, driver);
spin_unlock_irqrestore(&dev->lock, flags);
dev->gadget.dev.driver = NULL; dev->gadget.dev.driver = NULL;
dev->driver = NULL; dev->driver = NULL;
stop_activity(dev);
spin_unlock_irqrestore(&dev->lock, flags);
device_remove_file(&dev->pdev->dev, &dev_attr_function); device_remove_file(&dev->pdev->dev, &dev_attr_function);
@ -2315,13 +2308,9 @@ static void handle_setup_packet(struct langwell_udc *dev,
if (!gadget_is_otg(&dev->gadget)) if (!gadget_is_otg(&dev->gadget))
break; break;
else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE) { else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE)
dev->gadget.b_hnp_enable = 1; dev->gadget.b_hnp_enable = 1;
#ifdef OTG_TRANSCEIVER else if (setup->bRequest == USB_DEVICE_A_HNP_SUPPORT)
if (!dev->lotg->otg.default_a)
dev->lotg->hsm.b_hnp_enable = 1;
#endif
} else if (setup->bRequest == USB_DEVICE_A_HNP_SUPPORT)
dev->gadget.a_hnp_support = 1; dev->gadget.a_hnp_support = 1;
else if (setup->bRequest == else if (setup->bRequest ==
USB_DEVICE_A_ALT_HNP_SUPPORT) USB_DEVICE_A_ALT_HNP_SUPPORT)
@ -2733,7 +2722,7 @@ static void handle_usb_reset(struct langwell_udc *dev)
dev->bus_reset = 1; dev->bus_reset = 1;
/* reset all the queues, stop all USB activities */ /* reset all the queues, stop all USB activities */
stop_activity(dev, dev->driver); stop_activity(dev);
dev->usb_state = USB_STATE_DEFAULT; dev->usb_state = USB_STATE_DEFAULT;
} else { } else {
dev_vdbg(&dev->pdev->dev, "device controller reset\n"); dev_vdbg(&dev->pdev->dev, "device controller reset\n");
@ -2741,7 +2730,7 @@ static void handle_usb_reset(struct langwell_udc *dev)
langwell_udc_reset(dev); langwell_udc_reset(dev);
/* reset all the queues, stop all USB activities */ /* reset all the queues, stop all USB activities */
stop_activity(dev, dev->driver); stop_activity(dev);
/* reset ep0 dQH and endptctrl */ /* reset ep0 dQH and endptctrl */
ep0_reset(dev); ep0_reset(dev);
@ -2752,12 +2741,6 @@ static void handle_usb_reset(struct langwell_udc *dev)
dev->usb_state = USB_STATE_ATTACHED; dev->usb_state = USB_STATE_ATTACHED;
} }
#ifdef OTG_TRANSCEIVER
/* refer to USB OTG 6.6.2.3 b_hnp_en is cleared */
if (!dev->lotg->otg.default_a)
dev->lotg->hsm.b_hnp_enable = 0;
#endif
dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__); dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__);
} }
@ -2770,29 +2753,6 @@ static void handle_bus_suspend(struct langwell_udc *dev)
dev->resume_state = dev->usb_state; dev->resume_state = dev->usb_state;
dev->usb_state = USB_STATE_SUSPENDED; dev->usb_state = USB_STATE_SUSPENDED;
#ifdef OTG_TRANSCEIVER
if (dev->lotg->otg.default_a) {
if (dev->lotg->hsm.b_bus_suspend_vld == 1) {
dev->lotg->hsm.b_bus_suspend = 1;
/* notify transceiver the state changes */
if (spin_trylock(&dev->lotg->wq_lock)) {
langwell_update_transceiver();
spin_unlock(&dev->lotg->wq_lock);
}
}
dev->lotg->hsm.b_bus_suspend_vld++;
} else {
if (!dev->lotg->hsm.a_bus_suspend) {
dev->lotg->hsm.a_bus_suspend = 1;
/* notify transceiver the state changes */
if (spin_trylock(&dev->lotg->wq_lock)) {
langwell_update_transceiver();
spin_unlock(&dev->lotg->wq_lock);
}
}
}
#endif
/* report suspend to the driver */ /* report suspend to the driver */
if (dev->driver) { if (dev->driver) {
if (dev->driver->suspend) { if (dev->driver->suspend) {
@ -2823,11 +2783,6 @@ static void handle_bus_resume(struct langwell_udc *dev)
if (dev->pdev->device != 0x0829) if (dev->pdev->device != 0x0829)
langwell_phy_low_power(dev, 0); langwell_phy_low_power(dev, 0);
#ifdef OTG_TRANSCEIVER
if (dev->lotg->otg.default_a == 0)
dev->lotg->hsm.a_bus_suspend = 0;
#endif
/* report resume to the driver */ /* report resume to the driver */
if (dev->driver) { if (dev->driver) {
if (dev->driver->resume) { if (dev->driver->resume) {
@ -3020,7 +2975,6 @@ static void langwell_udc_remove(struct pci_dev *pdev)
dev->done = &done; dev->done = &done;
#ifndef OTG_TRANSCEIVER
/* free dTD dma_pool and dQH */ /* free dTD dma_pool and dQH */
if (dev->dtd_pool) if (dev->dtd_pool)
dma_pool_destroy(dev->dtd_pool); dma_pool_destroy(dev->dtd_pool);
@ -3032,7 +2986,6 @@ static void langwell_udc_remove(struct pci_dev *pdev)
/* release SRAM caching */ /* release SRAM caching */
if (dev->has_sram && dev->got_sram) if (dev->has_sram && dev->got_sram)
sram_deinit(dev); sram_deinit(dev);
#endif
if (dev->status_req) { if (dev->status_req) {
kfree(dev->status_req->req.buf); kfree(dev->status_req->req.buf);
@ -3045,7 +2998,6 @@ static void langwell_udc_remove(struct pci_dev *pdev)
if (dev->got_irq) if (dev->got_irq)
free_irq(pdev->irq, dev); free_irq(pdev->irq, dev);
#ifndef OTG_TRANSCEIVER
if (dev->cap_regs) if (dev->cap_regs)
iounmap(dev->cap_regs); iounmap(dev->cap_regs);
@ -3055,13 +3007,6 @@ static void langwell_udc_remove(struct pci_dev *pdev)
if (dev->enabled) if (dev->enabled)
pci_disable_device(pdev); pci_disable_device(pdev);
#else
if (dev->transceiver) {
otg_put_transceiver(dev->transceiver);
dev->transceiver = NULL;
dev->lotg = NULL;
}
#endif
dev->cap_regs = NULL; dev->cap_regs = NULL;
@ -3072,9 +3017,7 @@ static void langwell_udc_remove(struct pci_dev *pdev)
device_remove_file(&pdev->dev, &dev_attr_langwell_udc); device_remove_file(&pdev->dev, &dev_attr_langwell_udc);
device_remove_file(&pdev->dev, &dev_attr_remote_wakeup); device_remove_file(&pdev->dev, &dev_attr_remote_wakeup);
#ifndef OTG_TRANSCEIVER
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
#endif
/* free dev, wait for the release() finished */ /* free dev, wait for the release() finished */
wait_for_completion(&done); wait_for_completion(&done);
@ -3089,9 +3032,7 @@ static int langwell_udc_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
struct langwell_udc *dev; struct langwell_udc *dev;
#ifndef OTG_TRANSCEIVER
unsigned long resource, len; unsigned long resource, len;
#endif
void __iomem *base = NULL; void __iomem *base = NULL;
size_t size; size_t size;
int retval; int retval;
@ -3109,16 +3050,6 @@ static int langwell_udc_probe(struct pci_dev *pdev,
dev->pdev = pdev; dev->pdev = pdev;
dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__);
#ifdef OTG_TRANSCEIVER
/* PCI device is already enabled by otg_transceiver driver */
dev->enabled = 1;
/* mem region and register base */
dev->region = 1;
dev->transceiver = otg_get_transceiver();
dev->lotg = otg_to_langwell(dev->transceiver);
base = dev->lotg->regs;
#else
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
/* now all the pci goodies ... */ /* now all the pci goodies ... */
@ -3139,7 +3070,6 @@ static int langwell_udc_probe(struct pci_dev *pdev,
dev->region = 1; dev->region = 1;
base = ioremap_nocache(resource, len); base = ioremap_nocache(resource, len);
#endif
if (base == NULL) { if (base == NULL) {
dev_err(&dev->pdev->dev, "can't map memory\n"); dev_err(&dev->pdev->dev, "can't map memory\n");
retval = -EFAULT; retval = -EFAULT;
@ -3163,7 +3093,6 @@ static int langwell_udc_probe(struct pci_dev *pdev,
dev->got_sram = 0; dev->got_sram = 0;
dev_vdbg(&dev->pdev->dev, "dev->has_sram: %d\n", dev->has_sram); dev_vdbg(&dev->pdev->dev, "dev->has_sram: %d\n", dev->has_sram);
#ifndef OTG_TRANSCEIVER
/* enable SRAM caching if detected */ /* enable SRAM caching if detected */
if (dev->has_sram && !dev->got_sram) if (dev->has_sram && !dev->got_sram)
sram_init(dev); sram_init(dev);
@ -3182,7 +3111,6 @@ static int langwell_udc_probe(struct pci_dev *pdev,
goto error; goto error;
} }
dev->got_irq = 1; dev->got_irq = 1;
#endif
/* set stopped bit */ /* set stopped bit */
dev->stopped = 1; dev->stopped = 1;
@ -3257,10 +3185,8 @@ static int langwell_udc_probe(struct pci_dev *pdev,
dev->remote_wakeup = 0; dev->remote_wakeup = 0;
dev->dev_status = 1 << USB_DEVICE_SELF_POWERED; dev->dev_status = 1 << USB_DEVICE_SELF_POWERED;
#ifndef OTG_TRANSCEIVER
/* reset device controller */ /* reset device controller */
langwell_udc_reset(dev); langwell_udc_reset(dev);
#endif
/* initialize gadget structure */ /* initialize gadget structure */
dev->gadget.ops = &langwell_ops; /* usb_gadget_ops */ dev->gadget.ops = &langwell_ops; /* usb_gadget_ops */
@ -3268,9 +3194,6 @@ static int langwell_udc_probe(struct pci_dev *pdev,
INIT_LIST_HEAD(&dev->gadget.ep_list); /* ep_list */ INIT_LIST_HEAD(&dev->gadget.ep_list); /* ep_list */
dev->gadget.speed = USB_SPEED_UNKNOWN; /* speed */ dev->gadget.speed = USB_SPEED_UNKNOWN; /* speed */
dev->gadget.max_speed = USB_SPEED_HIGH; /* support dual speed */ dev->gadget.max_speed = USB_SPEED_HIGH; /* support dual speed */
#ifdef OTG_TRANSCEIVER
dev->gadget.is_otg = 1; /* support otg mode */
#endif
/* the "gadget" abstracts/virtualizes the controller */ /* the "gadget" abstracts/virtualizes the controller */
dev_set_name(&dev->gadget.dev, "gadget"); dev_set_name(&dev->gadget.dev, "gadget");
@ -3282,10 +3205,8 @@ static int langwell_udc_probe(struct pci_dev *pdev,
/* controller endpoints reinit */ /* controller endpoints reinit */
eps_reinit(dev); eps_reinit(dev);
#ifndef OTG_TRANSCEIVER
/* reset ep0 dQH and endptctrl */ /* reset ep0 dQH and endptctrl */
ep0_reset(dev); ep0_reset(dev);
#endif
/* create dTD dma_pool resource */ /* create dTD dma_pool resource */
dev->dtd_pool = dma_pool_create("langwell_dtd", dev->dtd_pool = dma_pool_create("langwell_dtd",
@ -3367,7 +3288,7 @@ static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state)
spin_lock_irq(&dev->lock); spin_lock_irq(&dev->lock);
/* stop all usb activities */ /* stop all usb activities */
stop_activity(dev, dev->driver); stop_activity(dev);
spin_unlock_irq(&dev->lock); spin_unlock_irq(&dev->lock);
/* free dTD dma_pool and dQH */ /* free dTD dma_pool and dQH */
@ -3525,22 +3446,14 @@ static struct pci_driver langwell_pci_driver = {
static int __init init(void) static int __init init(void)
{ {
#ifdef OTG_TRANSCEIVER
return langwell_register_peripheral(&langwell_pci_driver);
#else
return pci_register_driver(&langwell_pci_driver); return pci_register_driver(&langwell_pci_driver);
#endif
} }
module_init(init); module_init(init);
static void __exit cleanup(void) static void __exit cleanup(void)
{ {
#ifdef OTG_TRANSCEIVER
return langwell_unregister_peripheral(&langwell_pci_driver);
#else
pci_unregister_driver(&langwell_pci_driver); pci_unregister_driver(&langwell_pci_driver);
#endif
} }
module_exit(cleanup); module_exit(cleanup);

View File

@ -8,7 +8,6 @@
*/ */
#include <linux/usb/langwell_udc.h> #include <linux/usb/langwell_udc.h>
#include <linux/usb/langwell_otg.h>
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

View File

@ -598,16 +598,16 @@ static __maybe_unused struct usb_ss_cap_descriptor fsg_ss_cap_desc = {
| USB_5GBPS_OPERATION), | USB_5GBPS_OPERATION),
.bFunctionalitySupport = USB_LOW_SPEED_OPERATION, .bFunctionalitySupport = USB_LOW_SPEED_OPERATION,
.bU1devExitLat = USB_DEFAULT_U1_DEV_EXIT_LAT, .bU1devExitLat = USB_DEFAULT_U1_DEV_EXIT_LAT,
.bU2DevExitLat = USB_DEFAULT_U2_DEV_EXIT_LAT, .bU2DevExitLat = cpu_to_le16(USB_DEFAULT_U2_DEV_EXIT_LAT),
}; };
static __maybe_unused struct usb_bos_descriptor fsg_bos_desc = { static __maybe_unused struct usb_bos_descriptor fsg_bos_desc = {
.bLength = USB_DT_BOS_SIZE, .bLength = USB_DT_BOS_SIZE,
.bDescriptorType = USB_DT_BOS, .bDescriptorType = USB_DT_BOS,
.wTotalLength = USB_DT_BOS_SIZE .wTotalLength = cpu_to_le16(USB_DT_BOS_SIZE
+ USB_DT_USB_EXT_CAP_SIZE + USB_DT_USB_EXT_CAP_SIZE
+ USB_DT_USB_SS_CAP_SIZE, + USB_DT_USB_SS_CAP_SIZE),
.bNumDeviceCaps = 2, .bNumDeviceCaps = 2,
}; };

View File

@ -125,7 +125,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
*/ */
if (pdata->init && pdata->init(pdev)) { if (pdata->init && pdata->init(pdev)) {
retval = -ENODEV; retval = -ENODEV;
goto err3; goto err4;
} }
/* Enable USB controller, 83xx or 8536 */ /* Enable USB controller, 83xx or 8536 */

View File

@ -276,6 +276,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
/* Serial Bus Release Number is at PCI 0x60 offset */ /* Serial Bus Release Number is at PCI 0x60 offset */
pci_read_config_byte(pdev, 0x60, &ehci->sbrn); pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
if (pdev->vendor == PCI_VENDOR_ID_STMICRO
&& pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
ehci->sbrn = 0x20; /* ConneXT has no sbrn register */
/* Keep this around for a while just in case some EHCI /* Keep this around for a while just in case some EHCI
* implementation uses legacy PCI PM support. This test * implementation uses legacy PCI PM support. This test
@ -526,6 +529,9 @@ static const struct pci_device_id pci_ids [] = { {
/* handle any USB 2.0 EHCI controller */ /* handle any USB 2.0 EHCI controller */
PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_EHCI, ~0), PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_EHCI, ~0),
.driver_data = (unsigned long) &ehci_pci_hc_driver, .driver_data = (unsigned long) &ehci_pci_hc_driver,
}, {
PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_USB_HOST),
.driver_data = (unsigned long) &ehci_pci_hc_driver,
}, },
{ /* end: all zeroes */ } { /* end: all zeroes */ }
}; };

View File

@ -82,6 +82,14 @@ urb_print(struct urb * urb, char * str, int small, int status)
ohci_dbg(ohci,format, ## arg ); \ ohci_dbg(ohci,format, ## arg ); \
} while (0); } while (0);
/* Version for use where "next" is the address of a local variable */
#define ohci_dbg_nosw(ohci, next, size, format, arg...) \
do { \
unsigned s_len; \
s_len = scnprintf(*next, *size, format, ## arg); \
*size -= s_len; *next += s_len; \
} while (0);
static void ohci_dump_intr_mask ( static void ohci_dump_intr_mask (
struct ohci_hcd *ohci, struct ohci_hcd *ohci,
@ -653,7 +661,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
/* dump driver info, then registers in spec order */ /* dump driver info, then registers in spec order */
ohci_dbg_sw (ohci, &next, &size, ohci_dbg_nosw(ohci, &next, &size,
"bus %s, device %s\n" "bus %s, device %s\n"
"%s\n" "%s\n"
"%s\n", "%s\n",
@ -672,7 +680,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
/* hcca */ /* hcca */
if (ohci->hcca) if (ohci->hcca)
ohci_dbg_sw (ohci, &next, &size, ohci_dbg_nosw(ohci, &next, &size,
"hcca frame 0x%04x\n", ohci_frame_no(ohci)); "hcca frame 0x%04x\n", ohci_frame_no(ohci));
/* other registers mostly affect frame timings */ /* other registers mostly affect frame timings */

View File

@ -397,6 +397,10 @@ static const struct pci_device_id pci_ids [] = { {
/* handle any USB OHCI controller */ /* handle any USB OHCI controller */
PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_OHCI, ~0), PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_OHCI, ~0),
.driver_data = (unsigned long) &ohci_pci_hc_driver, .driver_data = (unsigned long) &ohci_pci_hc_driver,
}, {
/* The device in the ConneXT I/O hub has no class reg */
PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_USB_OHCI),
.driver_data = (unsigned long) &ohci_pci_hc_driver,
}, { /* end: all zeroes */ } }, { /* end: all zeroes */ }
}; };
MODULE_DEVICE_TABLE (pci, pci_ids); MODULE_DEVICE_TABLE (pci, pci_ids);

View File

@ -1204,6 +1204,7 @@ static void handle_vendor_event(struct xhci_hcd *xhci,
* *
* Returns a zero-based port number, which is suitable for indexing into each of * Returns a zero-based port number, which is suitable for indexing into each of
* the split roothubs' port arrays and bus state arrays. * the split roothubs' port arrays and bus state arrays.
* Add one to it in order to call xhci_find_slot_id_by_port.
*/ */
static unsigned int find_faked_portnum_from_hw_portnum(struct usb_hcd *hcd, static unsigned int find_faked_portnum_from_hw_portnum(struct usb_hcd *hcd,
struct xhci_hcd *xhci, u32 port_id) struct xhci_hcd *xhci, u32 port_id)
@ -1324,7 +1325,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
xhci_set_link_state(xhci, port_array, faked_port_index, xhci_set_link_state(xhci, port_array, faked_port_index,
XDEV_U0); XDEV_U0);
slot_id = xhci_find_slot_id_by_port(hcd, xhci, slot_id = xhci_find_slot_id_by_port(hcd, xhci,
faked_port_index); faked_port_index + 1);
if (!slot_id) { if (!slot_id) {
xhci_dbg(xhci, "slot_id is zero\n"); xhci_dbg(xhci, "slot_id is zero\n");
goto cleanup; goto cleanup;
@ -3323,7 +3324,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
/* Check TD length */ /* Check TD length */
if (running_total != td_len) { if (running_total != td_len) {
xhci_err(xhci, "ISOC TD length unmatch\n"); xhci_err(xhci, "ISOC TD length unmatch\n");
return -EINVAL; ret = -EINVAL;
goto cleanup;
} }
} }

View File

@ -37,9 +37,6 @@ static int emi26_set_reset(struct usb_device *dev, unsigned char reset_bit);
static int emi26_load_firmware (struct usb_device *dev); static int emi26_load_firmware (struct usb_device *dev);
static int emi26_probe(struct usb_interface *intf, const struct usb_device_id *id); static int emi26_probe(struct usb_interface *intf, const struct usb_device_id *id);
static void emi26_disconnect(struct usb_interface *intf); static void emi26_disconnect(struct usb_interface *intf);
static int __init emi26_init (void);
static void __exit emi26_exit (void);
/* thanks to drivers/usb/serial/keyspan_pda.c code */ /* thanks to drivers/usb/serial/keyspan_pda.c code */
static int emi26_writememory (struct usb_device *dev, int address, static int emi26_writememory (struct usb_device *dev, int address,

View File

@ -46,9 +46,6 @@ static int emi62_set_reset(struct usb_device *dev, unsigned char reset_bit);
static int emi62_load_firmware (struct usb_device *dev); static int emi62_load_firmware (struct usb_device *dev);
static int emi62_probe(struct usb_interface *intf, const struct usb_device_id *id); static int emi62_probe(struct usb_interface *intf, const struct usb_device_id *id);
static void emi62_disconnect(struct usb_interface *intf); static void emi62_disconnect(struct usb_interface *intf);
static int __init emi62_init (void);
static void __exit emi62_exit (void);
/* thanks to drivers/usb/serial/keyspan_pda.c code */ /* thanks to drivers/usb/serial/keyspan_pda.c code */
static int emi62_writememory(struct usb_device *dev, int address, static int emi62_writememory(struct usb_device *dev, int address,

View File

@ -24,7 +24,7 @@
#define VENDOR_ID 0x0fc5 #define VENDOR_ID 0x0fc5
#define PRODUCT_ID 0x1227 #define PRODUCT_ID 0x1227
#define MAXLEN 6 #define MAXLEN 8
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static const struct usb_device_id id_table[] = { static const struct usb_device_id id_table[] = {

View File

@ -33,9 +33,6 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <mach/hardware.h>
#include <mach/memory.h>
#include <asm/gpio.h>
#include <mach/cputype.h> #include <mach/cputype.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>

View File

@ -981,6 +981,9 @@ static void musb_shutdown(struct platform_device *pdev)
unsigned long flags; unsigned long flags;
pm_runtime_get_sync(musb->controller); pm_runtime_get_sync(musb->controller);
musb_gadget_cleanup(musb);
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
musb_platform_disable(musb); musb_platform_disable(musb);
musb_generic_disable(musb); musb_generic_disable(musb);
@ -1827,8 +1830,6 @@ static void musb_free(struct musb *musb)
sysfs_remove_group(&musb->controller->kobj, &musb_attr_group); sysfs_remove_group(&musb->controller->kobj, &musb_attr_group);
#endif #endif
musb_gadget_cleanup(musb);
if (musb->nIrq >= 0) { if (musb->nIrq >= 0) {
if (musb->irq_wake) if (musb->irq_wake)
disable_irq_wake(musb->nIrq); disable_irq_wake(musb->nIrq);

View File

@ -222,7 +222,6 @@ static inline void omap2430_low_level_init(struct musb *musb)
musb_writel(musb->mregs, OTG_FORCESTDBY, l); musb_writel(musb->mregs, OTG_FORCESTDBY, l);
} }
/* blocking notifier support */
static int musb_otg_notifications(struct notifier_block *nb, static int musb_otg_notifications(struct notifier_block *nb,
unsigned long event, void *unused) unsigned long event, void *unused)
{ {
@ -231,7 +230,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
musb->xceiv_event = event; musb->xceiv_event = event;
schedule_work(&musb->otg_notifier_work); schedule_work(&musb->otg_notifier_work);
return 0; return NOTIFY_OK;
} }
static void musb_otg_notifier_work(struct work_struct *data_notifier_work) static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
@ -386,6 +385,7 @@ static void omap2430_musb_disable(struct musb *musb)
static int omap2430_musb_exit(struct musb *musb) static int omap2430_musb_exit(struct musb *musb)
{ {
del_timer_sync(&musb_idle_timer); del_timer_sync(&musb_idle_timer);
cancel_work_sync(&musb->otg_notifier_work);
omap2430_low_level_exit(musb); omap2430_low_level_exit(musb);
otg_put_transceiver(musb->xceiv); otg_put_transceiver(musb->xceiv);

View File

@ -86,20 +86,6 @@ config NOP_USB_XCEIV
built-in with usb ip or which are autonomous and doesn't require any built-in with usb ip or which are autonomous and doesn't require any
phy programming such as ISP1x04 etc. phy programming such as ISP1x04 etc.
config USB_LANGWELL_OTG
tristate "Intel Langwell USB OTG dual-role support"
depends on USB && PCI && INTEL_SCU_IPC
select USB_OTG
select USB_OTG_UTILS
help
Say Y here if you want to build Intel Langwell USB OTG
transciever driver in kernel. This driver implements role
switch between EHCI host driver and Langwell USB OTG
client driver.
To compile this driver as a module, choose M here: the
module will be called langwell_otg.
config USB_MSM_OTG config USB_MSM_OTG
tristate "OTG support for Qualcomm on-chip USB controller" tristate "OTG support for Qualcomm on-chip USB controller"
depends on (USB || USB_GADGET) && ARCH_MSM depends on (USB || USB_GADGET) && ARCH_MSM
@ -124,7 +110,7 @@ config AB8500_USB
config FSL_USB2_OTG config FSL_USB2_OTG
bool "Freescale USB OTG Transceiver Driver" bool "Freescale USB OTG Transceiver Driver"
depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 && USB_SUSPEND
select USB_OTG select USB_OTG
select USB_OTG_UTILS select USB_OTG_UTILS
help help
@ -132,7 +118,7 @@ config FSL_USB2_OTG
config USB_MV_OTG config USB_MV_OTG
tristate "Marvell USB OTG support" tristate "Marvell USB OTG support"
depends on USB_MV_UDC depends on USB_MV_UDC && USB_SUSPEND
select USB_OTG select USB_OTG
select USB_OTG_UTILS select USB_OTG_UTILS
help help

View File

@ -13,7 +13,6 @@ obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o
obj-$(CONFIG_TWL6030_USB) += twl6030-usb.o obj-$(CONFIG_TWL6030_USB) += twl6030-usb.o
obj-$(CONFIG_USB_LANGWELL_OTG) += langwell_otg.o
obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o
obj-$(CONFIG_USB_ULPI) += ulpi.o obj-$(CONFIG_USB_ULPI) += ulpi.o
obj-$(CONFIG_USB_ULPI_VIEWPORT) += ulpi_viewport.o obj-$(CONFIG_USB_ULPI_VIEWPORT) += ulpi_viewport.o

File diff suppressed because it is too large Load Diff

View File

@ -202,6 +202,7 @@ static void mv_otg_init_irq(struct mv_otg *mvotg)
static void mv_otg_start_host(struct mv_otg *mvotg, int on) static void mv_otg_start_host(struct mv_otg *mvotg, int on)
{ {
#ifdef CONFIG_USB
struct otg_transceiver *otg = &mvotg->otg; struct otg_transceiver *otg = &mvotg->otg;
struct usb_hcd *hcd; struct usb_hcd *hcd;
@ -216,6 +217,7 @@ static void mv_otg_start_host(struct mv_otg *mvotg, int on)
usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
else else
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
#endif /* CONFIG_USB */
} }
static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on) static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)

View File

@ -425,7 +425,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
struct usbhs_pipe *pipe; struct usbhs_pipe *pipe;
int recip = ctrl->bRequestType & USB_RECIP_MASK; int recip = ctrl->bRequestType & USB_RECIP_MASK;
int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK; int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK;
int ret; int ret = 0;
int (*func)(struct usbhs_priv *priv, struct usbhsg_uep *uep, int (*func)(struct usbhs_priv *priv, struct usbhsg_uep *uep,
struct usb_ctrlrequest *ctrl); struct usb_ctrlrequest *ctrl);
char *msg; char *msg;

View File

@ -39,6 +39,8 @@ static void cp210x_get_termios(struct tty_struct *,
struct usb_serial_port *port); struct usb_serial_port *port);
static void cp210x_get_termios_port(struct usb_serial_port *port, static void cp210x_get_termios_port(struct usb_serial_port *port,
unsigned int *cflagp, unsigned int *baudp); unsigned int *cflagp, unsigned int *baudp);
static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
struct ktermios *);
static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *, static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *,
struct ktermios*); struct ktermios*);
static int cp210x_tiocmget(struct tty_struct *); static int cp210x_tiocmget(struct tty_struct *);
@ -138,6 +140,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
{ USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
{ USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
{ } /* Terminating Entry */ { } /* Terminating Entry */
}; };
@ -201,6 +204,8 @@ static struct usb_serial_driver cp210x_device = {
#define CP210X_EMBED_EVENTS 0x15 #define CP210X_EMBED_EVENTS 0x15
#define CP210X_GET_EVENTSTATE 0x16 #define CP210X_GET_EVENTSTATE 0x16
#define CP210X_SET_CHARS 0x19 #define CP210X_SET_CHARS 0x19
#define CP210X_GET_BAUDRATE 0x1D
#define CP210X_SET_BAUDRATE 0x1E
/* CP210X_IFC_ENABLE */ /* CP210X_IFC_ENABLE */
#define UART_ENABLE 0x0001 #define UART_ENABLE 0x0001
@ -360,8 +365,8 @@ static inline int cp210x_set_config_single(struct usb_serial_port *port,
* Quantises the baud rate as per AN205 Table 1 * Quantises the baud rate as per AN205 Table 1
*/ */
static unsigned int cp210x_quantise_baudrate(unsigned int baud) { static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
if (baud <= 56) baud = 0; if (baud <= 300)
else if (baud <= 300) baud = 300; baud = 300;
else if (baud <= 600) baud = 600; else if (baud <= 600) baud = 600;
else if (baud <= 1200) baud = 1200; else if (baud <= 1200) baud = 1200;
else if (baud <= 1800) baud = 1800; else if (baud <= 1800) baud = 1800;
@ -389,10 +394,10 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
else if (baud <= 491520) baud = 460800; else if (baud <= 491520) baud = 460800;
else if (baud <= 567138) baud = 500000; else if (baud <= 567138) baud = 500000;
else if (baud <= 670254) baud = 576000; else if (baud <= 670254) baud = 576000;
else if (baud <= 1053257) baud = 921600; else if (baud < 1000000)
else if (baud <= 1474560) baud = 1228800; baud = 921600;
else if (baud <= 2457600) baud = 1843200; else if (baud > 2000000)
else baud = 3686400; baud = 2000000;
return baud; return baud;
} }
@ -409,13 +414,14 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
return result; return result;
} }
result = usb_serial_generic_open(tty, port);
if (result)
return result;
/* Configure the termios structure */ /* Configure the termios structure */
cp210x_get_termios(tty, port); cp210x_get_termios(tty, port);
return 0;
/* The baud rate must be initialised on cp2104 */
if (tty)
cp210x_change_speed(tty, port, NULL);
return usb_serial_generic_open(tty, port);
} }
static void cp210x_close(struct usb_serial_port *port) static void cp210x_close(struct usb_serial_port *port)
@ -467,10 +473,7 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);
cp210x_get_config(port, CP210X_GET_BAUDDIV, &baud, 2); cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
/* Convert to baudrate */
if (baud)
baud = cp210x_quantise_baudrate((BAUD_RATE_GEN_FREQ + baud/2)/ baud);
dbg("%s - baud rate = %d", __func__, baud); dbg("%s - baud rate = %d", __func__, baud);
*baudp = baud; *baudp = baud;
@ -579,11 +582,64 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
*cflagp = cflag; *cflagp = cflag;
} }
/*
* CP2101 supports the following baud rates:
*
* 300, 600, 1200, 1800, 2400, 4800, 7200, 9600, 14400, 19200, 28800,
* 38400, 56000, 57600, 115200, 128000, 230400, 460800, 921600
*
* CP2102 and CP2103 support the following additional rates:
*
* 4000, 16000, 51200, 64000, 76800, 153600, 250000, 256000, 500000,
* 576000
*
* The device will map a requested rate to a supported one, but the result
* of requests for rates greater than 1053257 is undefined (see AN205).
*
* CP2104, CP2105 and CP2110 support most rates up to 2M, 921k and 1M baud,
* respectively, with an error less than 1%. The actual rates are determined
* by
*
* div = round(freq / (2 x prescale x request))
* actual = freq / (2 x prescale x div)
*
* For CP2104 and CP2105 freq is 48Mhz and prescale is 4 for request <= 365bps
* or 1 otherwise.
* For CP2110 freq is 24Mhz and prescale is 4 for request <= 300bps or 1
* otherwise.
*/
static void cp210x_change_speed(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios)
{
u32 baud;
baud = tty->termios->c_ospeed;
/* This maps the requested rate to a rate valid on cp2102 or cp2103,
* or to an arbitrary rate in [1M,2M].
*
* NOTE: B0 is not implemented.
*/
baud = cp210x_quantise_baudrate(baud);
dbg("%s - setting baud rate to %u", __func__, baud);
if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
sizeof(baud))) {
dev_warn(&port->dev, "failed to set baud rate to %u\n", baud);
if (old_termios)
baud = old_termios->c_ospeed;
else
baud = 9600;
}
tty_encode_baud_rate(tty, baud, baud);
}
static void cp210x_set_termios(struct tty_struct *tty, static void cp210x_set_termios(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios) struct usb_serial_port *port, struct ktermios *old_termios)
{ {
unsigned int cflag, old_cflag; unsigned int cflag, old_cflag;
unsigned int baud = 0, bits; unsigned int bits;
unsigned int modem_ctl[4]; unsigned int modem_ctl[4];
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);
@ -593,20 +649,9 @@ static void cp210x_set_termios(struct tty_struct *tty,
cflag = tty->termios->c_cflag; cflag = tty->termios->c_cflag;
old_cflag = old_termios->c_cflag; old_cflag = old_termios->c_cflag;
baud = cp210x_quantise_baudrate(tty_get_baud_rate(tty));
/* If the baud rate is to be updated*/ if (tty->termios->c_ospeed != old_termios->c_ospeed)
if (baud != tty_termios_baud_rate(old_termios) && baud != 0) { cp210x_change_speed(tty, port, old_termios);
dbg("%s - Setting baud rate to %d baud", __func__,
baud);
if (cp210x_set_config_single(port, CP210X_SET_BAUDDIV,
((BAUD_RATE_GEN_FREQ + baud/2) / baud))) {
dbg("Baud rate requested not supported by device");
baud = tty_termios_baud_rate(old_termios);
}
}
/* Report back the resulting baud rate */
tty_encode_baud_rate(tty, baud, baud);
/* If the number of data bits is to be updated */ /* If the number of data bits is to be updated */
if ((cflag & CSIZE) != (old_cflag & CSIZE)) { if ((cflag & CSIZE) != (old_cflag & CSIZE)) {

View File

@ -797,6 +797,7 @@ static struct usb_device_id id_table_combined [] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(HORNBY_VID, HORNBY_ELITE_PID) },
{ USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) },
{ USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
@ -805,6 +806,8 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) },
{ USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, TI_XDS100V2_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) },
{ USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) },
{ USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) },
@ -841,6 +844,7 @@ static struct usb_device_id id_table_combined [] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(ST_VID, ST_STMCLT1030_PID), { USB_DEVICE(ST_VID, ST_STMCLT1030_PID),
.driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_RF_R106) },
{ }, /* Optional parameter entry */ { }, /* Optional parameter entry */
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
@ -1333,8 +1337,7 @@ static int set_serial_info(struct tty_struct *tty,
goto check_and_exit; goto check_and_exit;
} }
if ((new_serial.baud_base != priv->baud_base) && if (new_serial.baud_base != priv->baud_base) {
(new_serial.baud_base < 9600)) {
mutex_unlock(&priv->cfg_lock); mutex_unlock(&priv->cfg_lock);
return -EINVAL; return -EINVAL;
} }
@ -1824,6 +1827,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct ktermios dummy;
struct usb_device *dev = port->serial->dev; struct usb_device *dev = port->serial->dev;
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
int result; int result;
@ -1842,8 +1846,10 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
This is same behaviour as serial.c/rs_open() - Kuba */ This is same behaviour as serial.c/rs_open() - Kuba */
/* ftdi_set_termios will send usb control messages */ /* ftdi_set_termios will send usb control messages */
if (tty) if (tty) {
ftdi_set_termios(tty, port, tty->termios); memset(&dummy, 0, sizeof(dummy));
ftdi_set_termios(tty, port, &dummy);
}
/* Start reading from the device */ /* Start reading from the device */
result = usb_serial_generic_open(tty, port); result = usb_serial_generic_open(tty, port);

View File

@ -39,6 +39,13 @@
/* www.candapter.com Ewert Energy Systems CANdapter device */ /* www.candapter.com Ewert Energy Systems CANdapter device */
#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */ #define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
/*
* Texas Instruments XDS100v2 JTAG / BeagleBone A3
* http://processors.wiki.ti.com/index.php/XDS100
* http://beagleboard.org/bone
*/
#define TI_XDS100V2_PID 0xa6d0
#define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */ #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */
/* US Interface Navigator (http://www.usinterface.com/) */ /* US Interface Navigator (http://www.usinterface.com/) */
@ -524,6 +531,12 @@
#define ADI_GNICE_PID 0xF000 #define ADI_GNICE_PID 0xF000
#define ADI_GNICEPLUS_PID 0xF001 #define ADI_GNICEPLUS_PID 0xF001
/*
* Hornby Elite
*/
#define HORNBY_VID 0x04D8
#define HORNBY_ELITE_PID 0x000A
/* /*
* RATOC REX-USB60F * RATOC REX-USB60F
*/ */
@ -1168,3 +1181,9 @@
*/ */
/* TagTracer MIFARE*/ /* TagTracer MIFARE*/
#define FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID 0xF7C0 #define FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID 0xF7C0
/*
* Rainforest Automation
*/
/* ZigBee controller */
#define FTDI_RF_R106 0x8A28

View File

@ -2657,15 +2657,7 @@ cleanup:
static void edge_disconnect(struct usb_serial *serial) static void edge_disconnect(struct usb_serial *serial)
{ {
int i;
struct edgeport_port *edge_port;
dbg("%s", __func__); dbg("%s", __func__);
for (i = 0; i < serial->num_ports; ++i) {
edge_port = usb_get_serial_port_data(serial->port[i]);
edge_remove_sysfs_attrs(edge_port->port);
}
} }
static void edge_release(struct usb_serial *serial) static void edge_release(struct usb_serial *serial)
@ -2744,6 +2736,7 @@ static struct usb_serial_driver edgeport_1port_device = {
.disconnect = edge_disconnect, .disconnect = edge_disconnect,
.release = edge_release, .release = edge_release,
.port_probe = edge_create_sysfs_attrs, .port_probe = edge_create_sysfs_attrs,
.port_remove = edge_remove_sysfs_attrs,
.ioctl = edge_ioctl, .ioctl = edge_ioctl,
.set_termios = edge_set_termios, .set_termios = edge_set_termios,
.tiocmget = edge_tiocmget, .tiocmget = edge_tiocmget,
@ -2775,6 +2768,7 @@ static struct usb_serial_driver edgeport_2port_device = {
.disconnect = edge_disconnect, .disconnect = edge_disconnect,
.release = edge_release, .release = edge_release,
.port_probe = edge_create_sysfs_attrs, .port_probe = edge_create_sysfs_attrs,
.port_remove = edge_remove_sysfs_attrs,
.ioctl = edge_ioctl, .ioctl = edge_ioctl,
.set_termios = edge_set_termios, .set_termios = edge_set_termios,
.tiocmget = edge_tiocmget, .tiocmget = edge_tiocmget,

View File

@ -38,7 +38,7 @@
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include "kobil_sct.h" #include "kobil_sct.h"
static int debug; static bool debug;
/* Version Information */ /* Version Information */
#define DRIVER_VERSION "21/05/2004" #define DRIVER_VERSION "21/05/2004"

View File

@ -480,6 +480,10 @@ static void option_instat_callback(struct urb *urb);
#define ZD_VENDOR_ID 0x0685 #define ZD_VENDOR_ID 0x0685
#define ZD_PRODUCT_7000 0x7000 #define ZD_PRODUCT_7000 0x7000
/* LG products */
#define LG_VENDOR_ID 0x1004
#define LG_PRODUCT_L02C 0x618f
/* some devices interfaces need special handling due to a number of reasons */ /* some devices interfaces need special handling due to a number of reasons */
enum option_blacklist_reason { enum option_blacklist_reason {
OPTION_BLACKLIST_NONE = 0, OPTION_BLACKLIST_NONE = 0,
@ -1183,6 +1187,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) },
{ USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
{ USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE(usb, option_ids); MODULE_DEVICE_TABLE(usb, option_ids);

View File

@ -36,6 +36,7 @@
#define UTSTARCOM_PRODUCT_UM175_V1 0x3712 #define UTSTARCOM_PRODUCT_UM175_V1 0x3712
#define UTSTARCOM_PRODUCT_UM175_V2 0x3714 #define UTSTARCOM_PRODUCT_UM175_V2 0x3714
#define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715
#define PANTECH_PRODUCT_UML190_VZW 0x3716
#define PANTECH_PRODUCT_UML290_VZW 0x3718 #define PANTECH_PRODUCT_UML290_VZW 0x3718
/* CMOTECH devices */ /* CMOTECH devices */
@ -67,7 +68,11 @@ static struct usb_device_id id_table[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) },
{ USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) },
{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) },
{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xfe, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfd, 0xff) }, /* NMEA */
{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfe, 0xff) }, /* WMC */
{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, /* DIAG */
{ }, { },
}; };
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);

View File

@ -789,7 +789,7 @@ static void rts51x_suspend_timer_fn(unsigned long data)
rts51x_set_stat(chip, RTS51X_STAT_SS); rts51x_set_stat(chip, RTS51X_STAT_SS);
/* ignore mass storage interface's children */ /* ignore mass storage interface's children */
pm_suspend_ignore_children(&us->pusb_intf->dev, true); pm_suspend_ignore_children(&us->pusb_intf->dev, true);
usb_autopm_put_interface(us->pusb_intf); usb_autopm_put_interface_async(us->pusb_intf);
US_DEBUGP("%s: RTS51X_STAT_SS 01," US_DEBUGP("%s: RTS51X_STAT_SS 01,"
"intf->pm_usage_cnt:%d, power.usage:%d\n", "intf->pm_usage_cnt:%d, power.usage:%d\n",
__func__, __func__,

View File

@ -27,8 +27,6 @@
#define USB_SKEL_VENDOR_ID 0xfff0 #define USB_SKEL_VENDOR_ID 0xfff0
#define USB_SKEL_PRODUCT_ID 0xfff0 #define USB_SKEL_PRODUCT_ID 0xfff0
static DEFINE_MUTEX(skel_mutex);
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static const struct usb_device_id skel_table[] = { static const struct usb_device_id skel_table[] = {
{ USB_DEVICE(USB_SKEL_VENDOR_ID, USB_SKEL_PRODUCT_ID) }, { USB_DEVICE(USB_SKEL_VENDOR_ID, USB_SKEL_PRODUCT_ID) },
@ -101,25 +99,18 @@ static int skel_open(struct inode *inode, struct file *file)
goto exit; goto exit;
} }
mutex_lock(&skel_mutex);
dev = usb_get_intfdata(interface); dev = usb_get_intfdata(interface);
if (!dev) { if (!dev) {
mutex_unlock(&skel_mutex);
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
} }
/* increment our usage count for the device */ /* increment our usage count for the device */
kref_get(&dev->kref); kref_get(&dev->kref);
mutex_unlock(&skel_mutex);
/* lock the device to allow correctly handling errors /* lock the device to allow correctly handling errors
* in resumption */ * in resumption */
mutex_lock(&dev->io_mutex); mutex_lock(&dev->io_mutex);
if (!dev->interface) {
retval = -ENODEV;
goto out_err;
}
retval = usb_autopm_get_interface(interface); retval = usb_autopm_get_interface(interface);
if (retval) if (retval)
@ -127,11 +118,7 @@ static int skel_open(struct inode *inode, struct file *file)
/* save our object in the file's private structure */ /* save our object in the file's private structure */
file->private_data = dev; file->private_data = dev;
out_err:
mutex_unlock(&dev->io_mutex); mutex_unlock(&dev->io_mutex);
if (retval)
kref_put(&dev->kref, skel_delete);
exit: exit:
return retval; return retval;
@ -611,6 +598,7 @@ static void skel_disconnect(struct usb_interface *interface)
int minor = interface->minor; int minor = interface->minor;
dev = usb_get_intfdata(interface); dev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
/* give back our minor */ /* give back our minor */
usb_deregister_dev(interface, &skel_class); usb_deregister_dev(interface, &skel_class);
@ -622,12 +610,8 @@ static void skel_disconnect(struct usb_interface *interface)
usb_kill_anchored_urbs(&dev->submitted); usb_kill_anchored_urbs(&dev->submitted);
mutex_lock(&skel_mutex);
usb_set_intfdata(interface, NULL);
/* decrement our usage count */ /* decrement our usage count */
kref_put(&dev->kref, skel_delete); kref_put(&dev->kref, skel_delete);
mutex_unlock(&skel_mutex);
dev_info(&interface->dev, "USB Skeleton #%d now disconnected", minor); dev_info(&interface->dev, "USB Skeleton #%d now disconnected", minor);
} }

View File

@ -6,7 +6,7 @@ config USB_WUSB
depends on EXPERIMENTAL depends on EXPERIMENTAL
depends on USB depends on USB
depends on PCI depends on PCI
select UWB depends on UWB
select CRYPTO select CRYPTO
select CRYPTO_BLKCIPHER select CRYPTO_BLKCIPHER
select CRYPTO_CBC select CRYPTO_CBC

View File

@ -1,139 +0,0 @@
/*
* Intel Langwell USB OTG transceiver driver
* Copyright (C) 2008 - 2010, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __LANGWELL_OTG_H
#define __LANGWELL_OTG_H
#include <linux/usb/intel_mid_otg.h>
#define CI_USBCMD 0x30
# define USBCMD_RST BIT(1)
# define USBCMD_RS BIT(0)
#define CI_USBSTS 0x34
# define USBSTS_SLI BIT(8)
# define USBSTS_URI BIT(6)
# define USBSTS_PCI BIT(2)
#define CI_PORTSC1 0x74
# define PORTSC_PP BIT(12)
# define PORTSC_LS (BIT(11) | BIT(10))
# define PORTSC_SUSP BIT(7)
# define PORTSC_CCS BIT(0)
#define CI_HOSTPC1 0xb4
# define HOSTPC1_PHCD BIT(22)
#define CI_OTGSC 0xf4
# define OTGSC_DPIE BIT(30)
# define OTGSC_1MSE BIT(29)
# define OTGSC_BSEIE BIT(28)
# define OTGSC_BSVIE BIT(27)
# define OTGSC_ASVIE BIT(26)
# define OTGSC_AVVIE BIT(25)
# define OTGSC_IDIE BIT(24)
# define OTGSC_DPIS BIT(22)
# define OTGSC_1MSS BIT(21)
# define OTGSC_BSEIS BIT(20)
# define OTGSC_BSVIS BIT(19)
# define OTGSC_ASVIS BIT(18)
# define OTGSC_AVVIS BIT(17)
# define OTGSC_IDIS BIT(16)
# define OTGSC_DPS BIT(14)
# define OTGSC_1MST BIT(13)
# define OTGSC_BSE BIT(12)
# define OTGSC_BSV BIT(11)
# define OTGSC_ASV BIT(10)
# define OTGSC_AVV BIT(9)
# define OTGSC_ID BIT(8)
# define OTGSC_HABA BIT(7)
# define OTGSC_HADP BIT(6)
# define OTGSC_IDPU BIT(5)
# define OTGSC_DP BIT(4)
# define OTGSC_OT BIT(3)
# define OTGSC_HAAR BIT(2)
# define OTGSC_VC BIT(1)
# define OTGSC_VD BIT(0)
# define OTGSC_INTEN_MASK (0x7f << 24)
# define OTGSC_INT_MASK (0x5f << 24)
# define OTGSC_INTSTS_MASK (0x7f << 16)
#define CI_USBMODE 0xf8
# define USBMODE_CM (BIT(1) | BIT(0))
# define USBMODE_IDLE 0
# define USBMODE_DEVICE 0x2
# define USBMODE_HOST 0x3
#define USBCFG_ADDR 0xff10801c
#define USBCFG_LEN 4
# define USBCFG_VBUSVAL BIT(14)
# define USBCFG_AVALID BIT(13)
# define USBCFG_BVALID BIT(12)
# define USBCFG_SESEND BIT(11)
#define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI)
enum langwell_otg_timer_type {
TA_WAIT_VRISE_TMR,
TA_WAIT_BCON_TMR,
TA_AIDL_BDIS_TMR,
TB_ASE0_BRST_TMR,
TB_SE0_SRP_TMR,
TB_SRP_INIT_TMR,
TB_SRP_FAIL_TMR,
TB_BUS_SUSPEND_TMR
};
#define TA_WAIT_VRISE 100
#define TA_WAIT_BCON 30000
#define TA_AIDL_BDIS 15000
#define TB_ASE0_BRST 5000
#define TB_SE0_SRP 2
#define TB_SRP_INIT 100
#define TB_SRP_FAIL 5500
#define TB_BUS_SUSPEND 500
struct langwell_otg_timer {
unsigned long expires; /* Number of count increase to timeout */
unsigned long count; /* Tick counter */
void (*function)(unsigned long); /* Timeout function */
unsigned long data; /* Data passed to function */
struct list_head list;
};
struct langwell_otg {
struct intel_mid_otg_xceiv iotg;
struct device *dev;
void __iomem *usbcfg; /* SCCBUSB config Reg */
unsigned region;
unsigned cfg_region;
struct work_struct work;
struct workqueue_struct *qwork;
struct timer_list hsm_timer;
spinlock_t lock;
spinlock_t wq_lock;
struct notifier_block iotg_notifier;
};
static inline
struct langwell_otg *mid_xceiv_to_lnw(struct intel_mid_otg_xceiv *iotg)
{
return container_of(iotg, struct langwell_otg, iotg);
}
#endif /* __LANGWELL_OTG_H__ */