diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/host/isp1362-hcd.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/host/isp1362-hcd.c')
-rw-r--r-- | drivers/usb/host/isp1362-hcd.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 0587ad4ce5c2..9c37dad3e816 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c | |||
@@ -70,7 +70,6 @@ | |||
70 | #include <linux/ioport.h> | 70 | #include <linux/ioport.h> |
71 | #include <linux/sched.h> | 71 | #include <linux/sched.h> |
72 | #include <linux/slab.h> | 72 | #include <linux/slab.h> |
73 | #include <linux/smp_lock.h> | ||
74 | #include <linux/errno.h> | 73 | #include <linux/errno.h> |
75 | #include <linux/init.h> | 74 | #include <linux/init.h> |
76 | #include <linux/list.h> | 75 | #include <linux/list.h> |
@@ -82,6 +81,7 @@ | |||
82 | #include <linux/pm.h> | 81 | #include <linux/pm.h> |
83 | #include <linux/io.h> | 82 | #include <linux/io.h> |
84 | #include <linux/bitmap.h> | 83 | #include <linux/bitmap.h> |
84 | #include <linux/prefetch.h> | ||
85 | 85 | ||
86 | #include <asm/irq.h> | 86 | #include <asm/irq.h> |
87 | #include <asm/system.h> | 87 | #include <asm/system.h> |
@@ -227,7 +227,6 @@ static int claim_ptd_buffers(struct isp1362_ep_queue *epq, | |||
227 | 227 | ||
228 | static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1362_ep *ep) | 228 | static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1362_ep *ep) |
229 | { | 229 | { |
230 | int index = ep->ptd_index; | ||
231 | int last = ep->ptd_index + ep->num_ptds; | 230 | int last = ep->ptd_index + ep->num_ptds; |
232 | 231 | ||
233 | if (last > epq->buf_count) | 232 | if (last > epq->buf_count) |
@@ -237,10 +236,8 @@ static inline void release_ptd_buffers(struct isp1362_ep_queue *epq, struct isp1 | |||
237 | epq->buf_map, epq->skip_map); | 236 | epq->buf_map, epq->skip_map); |
238 | BUG_ON(last > epq->buf_count); | 237 | BUG_ON(last > epq->buf_count); |
239 | 238 | ||
240 | for (; index < last; index++) { | 239 | bitmap_clear(&epq->buf_map, ep->ptd_index, ep->num_ptds); |
241 | __clear_bit(index, &epq->buf_map); | 240 | bitmap_set(&epq->skip_map, ep->ptd_index, ep->num_ptds); |
242 | __set_bit(index, &epq->skip_map); | ||
243 | } | ||
244 | epq->buf_avail += ep->num_ptds; | 241 | epq->buf_avail += ep->num_ptds; |
245 | epq->ptd_count--; | 242 | epq->ptd_count--; |
246 | 243 | ||
@@ -550,7 +547,7 @@ static void postproc_ep(struct isp1362_hcd *isp1362_hcd, struct isp1362_ep *ep) | |||
550 | if (usb_pipecontrol(urb->pipe)) { | 547 | if (usb_pipecontrol(urb->pipe)) { |
551 | ep->nextpid = USB_PID_ACK; | 548 | ep->nextpid = USB_PID_ACK; |
552 | /* save the data underrun error code for later and | 549 | /* save the data underrun error code for later and |
553 | * procede with the status stage | 550 | * proceed with the status stage |
554 | */ | 551 | */ |
555 | urb->actual_length += PTD_GET_COUNT(ptd); | 552 | urb->actual_length += PTD_GET_COUNT(ptd); |
556 | BUG_ON(urb->actual_length > urb->transfer_buffer_length); | 553 | BUG_ON(urb->actual_length > urb->transfer_buffer_length); |
@@ -1556,9 +1553,9 @@ static void isp1362_hub_descriptor(struct isp1362_hcd *isp1362_hcd, | |||
1556 | desc->wHubCharacteristics = cpu_to_le16((reg >> 8) & 0x1f); | 1553 | desc->wHubCharacteristics = cpu_to_le16((reg >> 8) & 0x1f); |
1557 | DBG(0, "%s: hubcharacteristics = %02x\n", __func__, cpu_to_le16((reg >> 8) & 0x1f)); | 1554 | DBG(0, "%s: hubcharacteristics = %02x\n", __func__, cpu_to_le16((reg >> 8) & 0x1f)); |
1558 | desc->bPwrOn2PwrGood = (reg >> 24) & 0xff; | 1555 | desc->bPwrOn2PwrGood = (reg >> 24) & 0xff; |
1559 | /* two bitmaps: ports removable, and legacy PortPwrCtrlMask */ | 1556 | /* ports removable, and legacy PortPwrCtrlMask */ |
1560 | desc->bitmap[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1; | 1557 | desc->u.hs.DeviceRemovable[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1; |
1561 | desc->bitmap[1] = ~0; | 1558 | desc->u.hs.DeviceRemovable[1] = ~0; |
1562 | 1559 | ||
1563 | DBG(3, "%s: exit\n", __func__); | 1560 | DBG(3, "%s: exit\n", __func__); |
1564 | } | 1561 | } |
@@ -1676,13 +1673,6 @@ static int isp1362_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
1676 | switch (wValue) { | 1673 | switch (wValue) { |
1677 | case USB_PORT_FEAT_SUSPEND: | 1674 | case USB_PORT_FEAT_SUSPEND: |
1678 | _DBG(0, "USB_PORT_FEAT_SUSPEND\n"); | 1675 | _DBG(0, "USB_PORT_FEAT_SUSPEND\n"); |
1679 | #ifdef CONFIG_USB_OTG | ||
1680 | if (ohci->hcd.self.otg_port == (wIndex + 1) && | ||
1681 | ohci->hcd.self.b_hnp_enable) { | ||
1682 | start_hnp(ohci); | ||
1683 | break; | ||
1684 | } | ||
1685 | #endif | ||
1686 | spin_lock_irqsave(&isp1362_hcd->lock, flags); | 1676 | spin_lock_irqsave(&isp1362_hcd->lock, flags); |
1687 | isp1362_write_reg32(isp1362_hcd, HCRHPORT1 + wIndex, RH_PS_PSS); | 1677 | isp1362_write_reg32(isp1362_hcd, HCRHPORT1 + wIndex, RH_PS_PSS); |
1688 | isp1362_hcd->rhport[wIndex] = | 1678 | isp1362_hcd->rhport[wIndex] = |
@@ -2656,8 +2646,6 @@ static struct hc_driver isp1362_hc_driver = { | |||
2656 | 2646 | ||
2657 | /*-------------------------------------------------------------------------*/ | 2647 | /*-------------------------------------------------------------------------*/ |
2658 | 2648 | ||
2659 | #define resource_len(r) (((r)->end - (r)->start) + 1) | ||
2660 | |||
2661 | static int __devexit isp1362_remove(struct platform_device *pdev) | 2649 | static int __devexit isp1362_remove(struct platform_device *pdev) |
2662 | { | 2650 | { |
2663 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 2651 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
@@ -2679,12 +2667,12 @@ static int __devexit isp1362_remove(struct platform_device *pdev) | |||
2679 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 2667 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
2680 | DBG(0, "%s: release mem_region: %08lx\n", __func__, (long unsigned int)res->start); | 2668 | DBG(0, "%s: release mem_region: %08lx\n", __func__, (long unsigned int)res->start); |
2681 | if (res) | 2669 | if (res) |
2682 | release_mem_region(res->start, resource_len(res)); | 2670 | release_mem_region(res->start, resource_size(res)); |
2683 | 2671 | ||
2684 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2672 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2685 | DBG(0, "%s: release mem_region: %08lx\n", __func__, (long unsigned int)res->start); | 2673 | DBG(0, "%s: release mem_region: %08lx\n", __func__, (long unsigned int)res->start); |
2686 | if (res) | 2674 | if (res) |
2687 | release_mem_region(res->start, resource_len(res)); | 2675 | release_mem_region(res->start, resource_size(res)); |
2688 | 2676 | ||
2689 | DBG(0, "%s: put_hcd\n", __func__); | 2677 | DBG(0, "%s: put_hcd\n", __func__); |
2690 | usb_put_hcd(hcd); | 2678 | usb_put_hcd(hcd); |
@@ -2693,7 +2681,7 @@ static int __devexit isp1362_remove(struct platform_device *pdev) | |||
2693 | return 0; | 2681 | return 0; |
2694 | } | 2682 | } |
2695 | 2683 | ||
2696 | static int __init isp1362_probe(struct platform_device *pdev) | 2684 | static int __devinit isp1362_probe(struct platform_device *pdev) |
2697 | { | 2685 | { |
2698 | struct usb_hcd *hcd; | 2686 | struct usb_hcd *hcd; |
2699 | struct isp1362_hcd *isp1362_hcd; | 2687 | struct isp1362_hcd *isp1362_hcd; |
@@ -2730,21 +2718,21 @@ static int __init isp1362_probe(struct platform_device *pdev) | |||
2730 | goto err1; | 2718 | goto err1; |
2731 | } | 2719 | } |
2732 | 2720 | ||
2733 | if (!request_mem_region(addr->start, resource_len(addr), hcd_name)) { | 2721 | if (!request_mem_region(addr->start, resource_size(addr), hcd_name)) { |
2734 | retval = -EBUSY; | 2722 | retval = -EBUSY; |
2735 | goto err1; | 2723 | goto err1; |
2736 | } | 2724 | } |
2737 | addr_reg = ioremap(addr->start, resource_len(addr)); | 2725 | addr_reg = ioremap(addr->start, resource_size(addr)); |
2738 | if (addr_reg == NULL) { | 2726 | if (addr_reg == NULL) { |
2739 | retval = -ENOMEM; | 2727 | retval = -ENOMEM; |
2740 | goto err2; | 2728 | goto err2; |
2741 | } | 2729 | } |
2742 | 2730 | ||
2743 | if (!request_mem_region(data->start, resource_len(data), hcd_name)) { | 2731 | if (!request_mem_region(data->start, resource_size(data), hcd_name)) { |
2744 | retval = -EBUSY; | 2732 | retval = -EBUSY; |
2745 | goto err3; | 2733 | goto err3; |
2746 | } | 2734 | } |
2747 | data_reg = ioremap(data->start, resource_len(data)); | 2735 | data_reg = ioremap(data->start, resource_size(data)); |
2748 | if (data_reg == NULL) { | 2736 | if (data_reg == NULL) { |
2749 | retval = -ENOMEM; | 2737 | retval = -ENOMEM; |
2750 | goto err4; | 2738 | goto err4; |
@@ -2802,13 +2790,13 @@ static int __init isp1362_probe(struct platform_device *pdev) | |||
2802 | iounmap(data_reg); | 2790 | iounmap(data_reg); |
2803 | err4: | 2791 | err4: |
2804 | DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)data->start); | 2792 | DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)data->start); |
2805 | release_mem_region(data->start, resource_len(data)); | 2793 | release_mem_region(data->start, resource_size(data)); |
2806 | err3: | 2794 | err3: |
2807 | DBG(0, "%s: Unmapping addr_reg @ %p\n", __func__, addr_reg); | 2795 | DBG(0, "%s: Unmapping addr_reg @ %p\n", __func__, addr_reg); |
2808 | iounmap(addr_reg); | 2796 | iounmap(addr_reg); |
2809 | err2: | 2797 | err2: |
2810 | DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)addr->start); | 2798 | DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)addr->start); |
2811 | release_mem_region(addr->start, resource_len(addr)); | 2799 | release_mem_region(addr->start, resource_size(addr)); |
2812 | err1: | 2800 | err1: |
2813 | pr_err("%s: init error, %d\n", __func__, retval); | 2801 | pr_err("%s: init error, %d\n", __func__, retval); |
2814 | 2802 | ||