mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge 4.1-rc7 into usb-next
This resolves a merge issue in musb_core.c and we want the fixes that were in Linus's tree in this branch as well for testing. Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
commit
19915e6234
501 changed files with 4530 additions and 2386 deletions
|
|
@ -349,7 +349,7 @@
|
|||
#define DWC3_DGCMD_SET_ENDPOINT_NRDY 0x0c
|
||||
#define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK 0x10
|
||||
|
||||
#define DWC3_DGCMD_STATUS(n) (((n) >> 15) & 1)
|
||||
#define DWC3_DGCMD_STATUS(n) (((n) >> 12) & 0x0F)
|
||||
#define DWC3_DGCMD_CMDACT (1 << 10)
|
||||
#define DWC3_DGCMD_CMDIOC (1 << 8)
|
||||
|
||||
|
|
@ -365,7 +365,7 @@
|
|||
#define DWC3_DEPCMD_PARAM_SHIFT 16
|
||||
#define DWC3_DEPCMD_PARAM(x) ((x) << DWC3_DEPCMD_PARAM_SHIFT)
|
||||
#define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 0x7f)
|
||||
#define DWC3_DEPCMD_STATUS(x) (((x) >> 15) & 1)
|
||||
#define DWC3_DEPCMD_STATUS(x) (((x) >> 12) & 0x0F)
|
||||
#define DWC3_DEPCMD_HIPRI_FORCERM (1 << 11)
|
||||
#define DWC3_DEPCMD_CMDACT (1 << 10)
|
||||
#define DWC3_DEPCMD_CMDIOC (1 << 8)
|
||||
|
|
|
|||
|
|
@ -315,7 +315,6 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags);
|
||||
return len;
|
||||
}
|
||||
break;
|
||||
|
|
@ -847,7 +846,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
|||
ret = ep->status;
|
||||
if (io_data->read && ret > 0) {
|
||||
ret = copy_to_iter(data, ret, &io_data->data);
|
||||
if (unlikely(iov_iter_count(&io_data->data)))
|
||||
if (!ret)
|
||||
ret = -EFAULT;
|
||||
}
|
||||
}
|
||||
|
|
@ -1463,8 +1462,7 @@ static void ffs_data_clear(struct ffs_data *ffs)
|
|||
{
|
||||
ENTER();
|
||||
|
||||
if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags))
|
||||
ffs_closed(ffs);
|
||||
ffs_closed(ffs);
|
||||
|
||||
BUG_ON(ffs->gadget);
|
||||
|
||||
|
|
@ -3422,9 +3420,13 @@ static int ffs_ready(struct ffs_data *ffs)
|
|||
ffs_obj->desc_ready = true;
|
||||
ffs_obj->ffs_data = ffs;
|
||||
|
||||
if (ffs_obj->ffs_ready_callback)
|
||||
if (ffs_obj->ffs_ready_callback) {
|
||||
ret = ffs_obj->ffs_ready_callback(ffs);
|
||||
if (ret)
|
||||
goto done;
|
||||
}
|
||||
|
||||
set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags);
|
||||
done:
|
||||
ffs_dev_unlock();
|
||||
return ret;
|
||||
|
|
@ -3444,7 +3446,8 @@ static void ffs_closed(struct ffs_data *ffs)
|
|||
|
||||
ffs_obj->desc_ready = false;
|
||||
|
||||
if (ffs_obj->ffs_closed_callback)
|
||||
if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) &&
|
||||
ffs_obj->ffs_closed_callback)
|
||||
ffs_obj->ffs_closed_callback(ffs);
|
||||
|
||||
if (ffs_obj->opts)
|
||||
|
|
|
|||
|
|
@ -973,7 +973,13 @@ static ssize_t f_midi_opts_id_show(struct f_midi_opts *opts, char *page)
|
|||
int result;
|
||||
|
||||
mutex_lock(&opts->lock);
|
||||
result = strlcpy(page, opts->id, PAGE_SIZE);
|
||||
if (opts->id) {
|
||||
result = strlcpy(page, opts->id, PAGE_SIZE);
|
||||
} else {
|
||||
page[0] = 0;
|
||||
result = 0;
|
||||
}
|
||||
|
||||
mutex_unlock(&opts->lock);
|
||||
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -588,7 +588,10 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
|||
|
||||
if (intf == 1) {
|
||||
if (alt == 1) {
|
||||
config_ep_by_speed(cdev->gadget, f, out_ep);
|
||||
err = config_ep_by_speed(cdev->gadget, f, out_ep);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
usb_ep_enable(out_ep);
|
||||
out_ep->driver_data = audio;
|
||||
audio->copy_buf = f_audio_buffer_alloc(audio_buf_size);
|
||||
|
|
|
|||
|
|
@ -304,8 +304,10 @@ static int functionfs_ready_callback(struct ffs_data *ffs)
|
|||
gfs_registered = true;
|
||||
|
||||
ret = usb_composite_probe(&gfs_driver);
|
||||
if (unlikely(ret < 0))
|
||||
if (unlikely(ret < 0)) {
|
||||
++missing_funcs;
|
||||
gfs_registered = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1485,7 +1485,7 @@ static int s3c2410_udc_pullup(struct usb_gadget *gadget, int is_on)
|
|||
|
||||
dprintk(DEBUG_NORMAL, "%s()\n", __func__);
|
||||
|
||||
s3c2410_udc_set_pullup(udc, is_on ? 0 : 1);
|
||||
s3c2410_udc_set_pullup(udc, is_on);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3682,18 +3682,21 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|||
{
|
||||
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
int ret, slot_id;
|
||||
struct xhci_command *command;
|
||||
|
||||
command = xhci_alloc_command(xhci, false, false, GFP_KERNEL);
|
||||
if (!command)
|
||||
return 0;
|
||||
|
||||
/* xhci->slot_id and xhci->addr_dev are not thread-safe */
|
||||
mutex_lock(&xhci->mutex);
|
||||
spin_lock_irqsave(&xhci->lock, flags);
|
||||
command->completion = &xhci->addr_dev;
|
||||
ret = xhci_queue_slot_control(xhci, command, TRB_ENABLE_SLOT, 0);
|
||||
if (ret) {
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
mutex_unlock(&xhci->mutex);
|
||||
xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
|
||||
kfree(command);
|
||||
return 0;
|
||||
|
|
@ -3702,8 +3705,10 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
|
||||
wait_for_completion(command->completion);
|
||||
slot_id = xhci->slot_id;
|
||||
mutex_unlock(&xhci->mutex);
|
||||
|
||||
if (!xhci->slot_id || command->status != COMP_SUCCESS) {
|
||||
if (!slot_id || command->status != COMP_SUCCESS) {
|
||||
xhci_err(xhci, "Error while assigning device slot ID\n");
|
||||
xhci_err(xhci, "Max number of devices this xHCI host supports is %u.\n",
|
||||
HCS_MAX_SLOTS(
|
||||
|
|
@ -3728,11 +3733,11 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|||
* xhci_discover_or_reset_device(), which may be called as part of
|
||||
* mass storage driver error handling.
|
||||
*/
|
||||
if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_NOIO)) {
|
||||
if (!xhci_alloc_virt_device(xhci, slot_id, udev, GFP_NOIO)) {
|
||||
xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n");
|
||||
goto disable_slot;
|
||||
}
|
||||
udev->slot_id = xhci->slot_id;
|
||||
udev->slot_id = slot_id;
|
||||
|
||||
#ifndef CONFIG_USB_DEFAULT_PERSIST
|
||||
/*
|
||||
|
|
@ -3776,12 +3781,15 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
struct xhci_slot_ctx *slot_ctx;
|
||||
struct xhci_input_control_ctx *ctrl_ctx;
|
||||
u64 temp_64;
|
||||
struct xhci_command *command;
|
||||
struct xhci_command *command = NULL;
|
||||
|
||||
mutex_lock(&xhci->mutex);
|
||||
|
||||
if (!udev->slot_id) {
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_address,
|
||||
"Bad Slot ID %d", udev->slot_id);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
virt_dev = xhci->devs[udev->slot_id];
|
||||
|
|
@ -3794,7 +3802,8 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
*/
|
||||
xhci_warn(xhci, "Virt dev invalid for slot_id 0x%x!\n",
|
||||
udev->slot_id);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (setup == SETUP_CONTEXT_ONLY) {
|
||||
|
|
@ -3802,13 +3811,15 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) ==
|
||||
SLOT_STATE_DEFAULT) {
|
||||
xhci_dbg(xhci, "Slot already in default state\n");
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
command = xhci_alloc_command(xhci, false, false, GFP_KERNEL);
|
||||
if (!command)
|
||||
return -ENOMEM;
|
||||
if (!command) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
command->in_ctx = virt_dev->in_ctx;
|
||||
command->completion = &xhci->addr_dev;
|
||||
|
|
@ -3818,8 +3829,8 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
if (!ctrl_ctx) {
|
||||
xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
|
||||
__func__);
|
||||
kfree(command);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* If this is the first Set Address since device plug-in or
|
||||
|
|
@ -3846,8 +3857,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_address,
|
||||
"FIXME: allocate a command ring segment");
|
||||
kfree(command);
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
xhci_ring_cmd_db(xhci);
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
|
|
@ -3894,10 +3904,8 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (ret) {
|
||||
kfree(command);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto out;
|
||||
temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_address,
|
||||
"Op regs DCBAA ptr = %#016llx", temp_64);
|
||||
|
|
@ -3930,8 +3938,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
xhci_dbg_trace(xhci, trace_xhci_dbg_address,
|
||||
"Internal device address = %d",
|
||||
le32_to_cpu(slot_ctx->dev_state) & DEV_ADDR_MASK);
|
||||
out:
|
||||
mutex_unlock(&xhci->mutex);
|
||||
kfree(command);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
|
||||
|
|
@ -4850,6 +4860,7 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
|
|||
return 0;
|
||||
}
|
||||
|
||||
mutex_init(&xhci->mutex);
|
||||
xhci->cap_regs = hcd->regs;
|
||||
xhci->op_regs = hcd->regs +
|
||||
HC_LENGTH(readl(&xhci->cap_regs->hc_capbase));
|
||||
|
|
@ -5013,4 +5024,12 @@ static int __init xhci_hcd_init(void)
|
|||
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If an init function is provided, an exit function must also be provided
|
||||
* to allow module unload.
|
||||
*/
|
||||
static void __exit xhci_hcd_fini(void) { }
|
||||
|
||||
module_init(xhci_hcd_init);
|
||||
module_exit(xhci_hcd_fini);
|
||||
|
|
|
|||
|
|
@ -1497,6 +1497,8 @@ struct xhci_hcd {
|
|||
struct list_head lpm_failed_devs;
|
||||
|
||||
/* slot enabling and address device helpers */
|
||||
/* these are not thread safe so use mutex */
|
||||
struct mutex mutex;
|
||||
struct completion addr_dev;
|
||||
int slot_id;
|
||||
/* For USB 3.0 LPM enable/disable. */
|
||||
|
|
|
|||
|
|
@ -2032,7 +2032,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
|
|||
if (musb->ops->quirks)
|
||||
musb->io.quirks = musb->ops->quirks;
|
||||
|
||||
/* Set default ep access to indexed offset or flat offset ops */
|
||||
/* Most devices use indexed offset or flat offset */
|
||||
if (musb->io.quirks & MUSB_INDEXED_EP) {
|
||||
musb->io.ep_offset = musb_indexed_ep_offset;
|
||||
musb->io.ep_select = musb_indexed_ep_select;
|
||||
|
|
@ -2046,6 +2046,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
|
|||
if (musb->ops->ep_select)
|
||||
musb->io.ep_select = musb->ops->ep_select;
|
||||
|
||||
/* At least tusb6010 has its own offsets */
|
||||
if (musb->ops->ep_offset)
|
||||
musb->io.ep_offset = musb->ops->ep_offset;
|
||||
if (musb->ops->ep_select)
|
||||
musb->io.ep_select = musb->ops->ep_select;
|
||||
|
||||
if (musb->ops->fifo_mode)
|
||||
fifo_mode = musb->ops->fifo_mode;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1179,7 +1179,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
|
|||
}
|
||||
err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||
ab8500_usb_link_status_irq,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
|
||||
"usb-link-status", ab);
|
||||
if (err < 0) {
|
||||
dev_err(ab->dev, "request_irq failed for link status irq\n");
|
||||
|
|
@ -1195,7 +1195,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
|
|||
}
|
||||
err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||
ab8500_usb_disconnect_irq,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
|
||||
"usb-id-fall", ab);
|
||||
if (err < 0) {
|
||||
dev_err(ab->dev, "request_irq failed for ID fall irq\n");
|
||||
|
|
@ -1211,7 +1211,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
|
|||
}
|
||||
err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||
ab8500_usb_disconnect_irq,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED,
|
||||
IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
|
||||
"usb-vbus-fall", ab);
|
||||
if (err < 0) {
|
||||
dev_err(ab->dev, "request_irq failed for Vbus fall irq\n");
|
||||
|
|
|
|||
|
|
@ -401,7 +401,8 @@ static int tahvo_usb_probe(struct platform_device *pdev)
|
|||
dev_set_drvdata(&pdev->dev, tu);
|
||||
|
||||
tu->irq = platform_get_irq(pdev, 0);
|
||||
ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, 0,
|
||||
ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt,
|
||||
IRQF_ONESHOT,
|
||||
"tahvo-vbus", tu);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "could not register tahvo-vbus irq: %d\n",
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ static const struct usb_device_id id_table[] = {
|
|||
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
|
||||
{ USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */
|
||||
{ USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */
|
||||
{ USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
|
||||
{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
|
||||
{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
|
||||
|
|
|
|||
|
|
@ -699,6 +699,7 @@ static const struct usb_device_id id_table_combined[] = {
|
|||
{ USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) },
|
||||
{ USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
|
||||
{ USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@
|
|||
#define XSENS_AWINDA_STATION_PID 0x0101
|
||||
#define XSENS_AWINDA_DONGLE_PID 0x0102
|
||||
#define XSENS_MTW_PID 0x0200 /* Xsens MTw */
|
||||
#define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */
|
||||
#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */
|
||||
|
||||
/* Xsens devices using FTDI VID */
|
||||
|
|
|
|||
Loading…
Reference in a new issue