diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-11 13:45:21 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-11 13:45:21 -0400 |
| commit | 254c44ea822066e24ab5efbdff1e43b8fe45ae76 (patch) | |
| tree | 547f6fd4ce1bd6dba6a5cc5184df28501d550795 /drivers | |
| parent | 7b76415375ba91f5a06f8d5179278c03d6151d16 (diff) | |
| parent | 6ac77e469e991e9dd91b28e503fa24b5609eedba (diff) | |
Merge branch 'gic-fasteoi' of git://linux-arm.org/linux-2.6-wd into devel-stable
Diffstat (limited to 'drivers')
63 files changed, 486 insertions, 162 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 16dc3645291c..3e904717c1c0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq, | |||
| 777 | ops, | 777 | ops, |
| 778 | false, | 778 | false, |
| 779 | GFP_NOIO, pages, bio); | 779 | GFP_NOIO, pages, bio); |
| 780 | if (IS_ERR(req)) { | 780 | if (!req) { |
| 781 | up_read(&header->snap_rwsem); | 781 | up_read(&header->snap_rwsem); |
| 782 | ret = PTR_ERR(req); | 782 | ret = -ENOMEM; |
| 783 | goto done_pages; | 783 | goto done_pages; |
| 784 | } | 784 | } |
| 785 | 785 | ||
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index f903d7b6f34a..23d1468ad253 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -2199,7 +2199,6 @@ static int ohci_set_config_rom(struct fw_card *card, | |||
| 2199 | { | 2199 | { |
| 2200 | struct fw_ohci *ohci; | 2200 | struct fw_ohci *ohci; |
| 2201 | unsigned long flags; | 2201 | unsigned long flags; |
| 2202 | int ret = -EBUSY; | ||
| 2203 | __be32 *next_config_rom; | 2202 | __be32 *next_config_rom; |
| 2204 | dma_addr_t uninitialized_var(next_config_rom_bus); | 2203 | dma_addr_t uninitialized_var(next_config_rom_bus); |
| 2205 | 2204 | ||
| @@ -2240,22 +2239,37 @@ static int ohci_set_config_rom(struct fw_card *card, | |||
| 2240 | 2239 | ||
| 2241 | spin_lock_irqsave(&ohci->lock, flags); | 2240 | spin_lock_irqsave(&ohci->lock, flags); |
| 2242 | 2241 | ||
| 2242 | /* | ||
| 2243 | * If there is not an already pending config_rom update, | ||
| 2244 | * push our new allocation into the ohci->next_config_rom | ||
| 2245 | * and then mark the local variable as null so that we | ||
| 2246 | * won't deallocate the new buffer. | ||
| 2247 | * | ||
| 2248 | * OTOH, if there is a pending config_rom update, just | ||
| 2249 | * use that buffer with the new config_rom data, and | ||
| 2250 | * let this routine free the unused DMA allocation. | ||
| 2251 | */ | ||
| 2252 | |||
| 2243 | if (ohci->next_config_rom == NULL) { | 2253 | if (ohci->next_config_rom == NULL) { |
| 2244 | ohci->next_config_rom = next_config_rom; | 2254 | ohci->next_config_rom = next_config_rom; |
| 2245 | ohci->next_config_rom_bus = next_config_rom_bus; | 2255 | ohci->next_config_rom_bus = next_config_rom_bus; |
| 2256 | next_config_rom = NULL; | ||
| 2257 | } | ||
| 2246 | 2258 | ||
| 2247 | copy_config_rom(ohci->next_config_rom, config_rom, length); | 2259 | copy_config_rom(ohci->next_config_rom, config_rom, length); |
| 2248 | 2260 | ||
| 2249 | ohci->next_header = config_rom[0]; | 2261 | ohci->next_header = config_rom[0]; |
| 2250 | ohci->next_config_rom[0] = 0; | 2262 | ohci->next_config_rom[0] = 0; |
| 2251 | 2263 | ||
| 2252 | reg_write(ohci, OHCI1394_ConfigROMmap, | 2264 | reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus); |
| 2253 | ohci->next_config_rom_bus); | ||
| 2254 | ret = 0; | ||
| 2255 | } | ||
| 2256 | 2265 | ||
| 2257 | spin_unlock_irqrestore(&ohci->lock, flags); | 2266 | spin_unlock_irqrestore(&ohci->lock, flags); |
| 2258 | 2267 | ||
| 2268 | /* If we didn't use the DMA allocation, delete it. */ | ||
| 2269 | if (next_config_rom != NULL) | ||
| 2270 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | ||
| 2271 | next_config_rom, next_config_rom_bus); | ||
| 2272 | |||
| 2259 | /* | 2273 | /* |
| 2260 | * Now initiate a bus reset to have the changes take | 2274 | * Now initiate a bus reset to have the changes take |
| 2261 | * effect. We clean up the old config rom memory and DMA | 2275 | * effect. We clean up the old config rom memory and DMA |
| @@ -2263,13 +2277,10 @@ static int ohci_set_config_rom(struct fw_card *card, | |||
| 2263 | * controller could need to access it before the bus reset | 2277 | * controller could need to access it before the bus reset |
| 2264 | * takes effect. | 2278 | * takes effect. |
| 2265 | */ | 2279 | */ |
| 2266 | if (ret == 0) | ||
| 2267 | fw_schedule_bus_reset(&ohci->card, true, true); | ||
| 2268 | else | ||
| 2269 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | ||
| 2270 | next_config_rom, next_config_rom_bus); | ||
| 2271 | 2280 | ||
| 2272 | return ret; | 2281 | fw_schedule_bus_reset(&ohci->card, true, true); |
| 2282 | |||
| 2283 | return 0; | ||
| 2273 | } | 2284 | } |
| 2274 | 2285 | ||
| 2275 | static void ohci_send_request(struct fw_card *card, struct fw_packet *packet) | 2286 | static void ohci_send_request(struct fw_card *card, struct fw_packet *packet) |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 741457bd1c46..a1f12cb043de 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -932,11 +932,34 @@ EXPORT_SYMBOL(drm_vblank_put); | |||
| 932 | 932 | ||
| 933 | void drm_vblank_off(struct drm_device *dev, int crtc) | 933 | void drm_vblank_off(struct drm_device *dev, int crtc) |
| 934 | { | 934 | { |
| 935 | struct drm_pending_vblank_event *e, *t; | ||
| 936 | struct timeval now; | ||
| 935 | unsigned long irqflags; | 937 | unsigned long irqflags; |
| 938 | unsigned int seq; | ||
| 936 | 939 | ||
| 937 | spin_lock_irqsave(&dev->vbl_lock, irqflags); | 940 | spin_lock_irqsave(&dev->vbl_lock, irqflags); |
| 938 | vblank_disable_and_save(dev, crtc); | 941 | vblank_disable_and_save(dev, crtc); |
| 939 | DRM_WAKEUP(&dev->vbl_queue[crtc]); | 942 | DRM_WAKEUP(&dev->vbl_queue[crtc]); |
| 943 | |||
| 944 | /* Send any queued vblank events, lest the natives grow disquiet */ | ||
| 945 | seq = drm_vblank_count_and_time(dev, crtc, &now); | ||
| 946 | list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { | ||
| 947 | if (e->pipe != crtc) | ||
| 948 | continue; | ||
| 949 | DRM_DEBUG("Sending premature vblank event on disable: \ | ||
| 950 | wanted %d, current %d\n", | ||
| 951 | e->event.sequence, seq); | ||
| 952 | |||
| 953 | e->event.sequence = seq; | ||
| 954 | e->event.tv_sec = now.tv_sec; | ||
| 955 | e->event.tv_usec = now.tv_usec; | ||
| 956 | drm_vblank_put(dev, e->pipe); | ||
| 957 | list_move_tail(&e->base.link, &e->base.file_priv->event_list); | ||
| 958 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
| 959 | trace_drm_vblank_event_delivered(e->base.pid, e->pipe, | ||
| 960 | e->event.sequence); | ||
| 961 | } | ||
| 962 | |||
| 940 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | 963 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); |
| 941 | } | 964 | } |
| 942 | EXPORT_SYMBOL(drm_vblank_off); | 965 | EXPORT_SYMBOL(drm_vblank_off); |
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 5d00b0fc0d91..959186cbf328 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c | |||
| @@ -431,7 +431,7 @@ EXPORT_SYMBOL(drm_mm_search_free_in_range); | |||
| 431 | void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new) | 431 | void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new) |
| 432 | { | 432 | { |
| 433 | list_replace(&old->node_list, &new->node_list); | 433 | list_replace(&old->node_list, &new->node_list); |
| 434 | list_replace(&old->node_list, &new->hole_stack); | 434 | list_replace(&old->hole_stack, &new->hole_stack); |
| 435 | new->hole_follows = old->hole_follows; | 435 | new->hole_follows = old->hole_follows; |
| 436 | new->mm = old->mm; | 436 | new->mm = old->mm; |
| 437 | new->start = old->start; | 437 | new->start = old->start; |
| @@ -699,8 +699,8 @@ int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) | |||
| 699 | entry->size); | 699 | entry->size); |
| 700 | total_used += entry->size; | 700 | total_used += entry->size; |
| 701 | if (entry->hole_follows) { | 701 | if (entry->hole_follows) { |
| 702 | hole_start = drm_mm_hole_node_start(&mm->head_node); | 702 | hole_start = drm_mm_hole_node_start(entry); |
| 703 | hole_end = drm_mm_hole_node_end(&mm->head_node); | 703 | hole_end = drm_mm_hole_node_end(entry); |
| 704 | hole_size = hole_end - hole_start; | 704 | hole_size = hole_end - hole_start; |
| 705 | seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", | 705 | seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", |
| 706 | hole_start, hole_end, hole_size); | 706 | hole_start, hole_end, hole_size); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e522c702b04e..373c2a005ec1 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -5154,8 +5154,6 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 5154 | 5154 | ||
| 5155 | I915_WRITE(DSPCNTR(plane), dspcntr); | 5155 | I915_WRITE(DSPCNTR(plane), dspcntr); |
| 5156 | POSTING_READ(DSPCNTR(plane)); | 5156 | POSTING_READ(DSPCNTR(plane)); |
| 5157 | if (!HAS_PCH_SPLIT(dev)) | ||
| 5158 | intel_enable_plane(dev_priv, plane, pipe); | ||
| 5159 | 5157 | ||
| 5160 | ret = intel_pipe_set_base(crtc, x, y, old_fb); | 5158 | ret = intel_pipe_set_base(crtc, x, y, old_fb); |
| 5161 | 5159 | ||
| @@ -5605,9 +5603,9 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc) | |||
| 5605 | intel_clock_t clock; | 5603 | intel_clock_t clock; |
| 5606 | 5604 | ||
| 5607 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) | 5605 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) |
| 5608 | fp = FP0(pipe); | 5606 | fp = I915_READ(FP0(pipe)); |
| 5609 | else | 5607 | else |
| 5610 | fp = FP1(pipe); | 5608 | fp = I915_READ(FP1(pipe)); |
| 5611 | 5609 | ||
| 5612 | clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT; | 5610 | clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT; |
| 5613 | if (IS_PINEVIEW(dev)) { | 5611 | if (IS_PINEVIEW(dev)) { |
| @@ -6579,8 +6577,10 @@ intel_user_framebuffer_create(struct drm_device *dev, | |||
| 6579 | return ERR_PTR(-ENOENT); | 6577 | return ERR_PTR(-ENOENT); |
| 6580 | 6578 | ||
| 6581 | intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); | 6579 | intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); |
| 6582 | if (!intel_fb) | 6580 | if (!intel_fb) { |
| 6581 | drm_gem_object_unreference_unlocked(&obj->base); | ||
| 6583 | return ERR_PTR(-ENOMEM); | 6582 | return ERR_PTR(-ENOMEM); |
| 6583 | } | ||
| 6584 | 6584 | ||
| 6585 | ret = intel_framebuffer_init(dev, intel_fb, mode_cmd, obj); | 6585 | ret = intel_framebuffer_init(dev, intel_fb, mode_cmd, obj); |
| 6586 | if (ret) { | 6586 | if (ret) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index cb8578b7e443..a4d80314e7f8 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1470,7 +1470,8 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1470 | 1470 | ||
| 1471 | if (!HAS_PCH_CPT(dev) && | 1471 | if (!HAS_PCH_CPT(dev) && |
| 1472 | I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) { | 1472 | I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) { |
| 1473 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc); | 1473 | struct drm_crtc *crtc = intel_dp->base.base.crtc; |
| 1474 | |||
| 1474 | /* Hardware workaround: leaving our transcoder select | 1475 | /* Hardware workaround: leaving our transcoder select |
| 1475 | * set to transcoder B while it's off will prevent the | 1476 | * set to transcoder B while it's off will prevent the |
| 1476 | * corresponding HDMI output on transcoder A. | 1477 | * corresponding HDMI output on transcoder A. |
| @@ -1485,7 +1486,19 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1485 | /* Changes to enable or select take place the vblank | 1486 | /* Changes to enable or select take place the vblank |
| 1486 | * after being written. | 1487 | * after being written. |
| 1487 | */ | 1488 | */ |
| 1488 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1489 | if (crtc == NULL) { |
| 1490 | /* We can arrive here never having been attached | ||
| 1491 | * to a CRTC, for instance, due to inheriting | ||
| 1492 | * random state from the BIOS. | ||
| 1493 | * | ||
| 1494 | * If the pipe is not running, play safe and | ||
| 1495 | * wait for the clocks to stabilise before | ||
| 1496 | * continuing. | ||
| 1497 | */ | ||
| 1498 | POSTING_READ(intel_dp->output_reg); | ||
| 1499 | msleep(50); | ||
| 1500 | } else | ||
| 1501 | intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe); | ||
| 1489 | } | 1502 | } |
| 1490 | 1503 | ||
| 1491 | I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); | 1504 | I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index a562bd2648c7..67cb076d271b 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -539,6 +539,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
| 539 | struct drm_device *dev = dev_priv->dev; | 539 | struct drm_device *dev = dev_priv->dev; |
| 540 | struct drm_connector *connector = dev_priv->int_lvds_connector; | 540 | struct drm_connector *connector = dev_priv->int_lvds_connector; |
| 541 | 541 | ||
| 542 | if (dev->switch_power_state != DRM_SWITCH_POWER_ON) | ||
| 543 | return NOTIFY_OK; | ||
| 544 | |||
| 542 | /* | 545 | /* |
| 543 | * check and update the status of LVDS connector after receiving | 546 | * check and update the status of LVDS connector after receiving |
| 544 | * the LID nofication event. | 547 | * the LID nofication event. |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 5045f8b921d6..c3e953b08992 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
| @@ -152,8 +152,6 @@ nouveau_mem_vram_fini(struct drm_device *dev) | |||
| 152 | { | 152 | { |
| 153 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 153 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 154 | 154 | ||
| 155 | nouveau_bo_ref(NULL, &dev_priv->vga_ram); | ||
| 156 | |||
| 157 | ttm_bo_device_release(&dev_priv->ttm.bdev); | 155 | ttm_bo_device_release(&dev_priv->ttm.bdev); |
| 158 | 156 | ||
| 159 | nouveau_ttm_global_release(dev_priv); | 157 | nouveau_ttm_global_release(dev_priv); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index a30adec5beaa..915fbce89595 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
| @@ -768,6 +768,11 @@ static void nouveau_card_takedown(struct drm_device *dev) | |||
| 768 | engine->mc.takedown(dev); | 768 | engine->mc.takedown(dev); |
| 769 | engine->display.late_takedown(dev); | 769 | engine->display.late_takedown(dev); |
| 770 | 770 | ||
| 771 | if (dev_priv->vga_ram) { | ||
| 772 | nouveau_bo_unpin(dev_priv->vga_ram); | ||
| 773 | nouveau_bo_ref(NULL, &dev_priv->vga_ram); | ||
| 774 | } | ||
| 775 | |||
| 771 | mutex_lock(&dev->struct_mutex); | 776 | mutex_lock(&dev->struct_mutex); |
| 772 | ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); | 777 | ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); |
| 773 | ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT); | 778 | ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index e9bc135d9189..c20eac3379e6 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -862,9 +862,15 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev) | |||
| 862 | SYSTEM_ACCESS_MODE_NOT_IN_SYS | | 862 | SYSTEM_ACCESS_MODE_NOT_IN_SYS | |
| 863 | SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU | | 863 | SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU | |
| 864 | EFFECTIVE_L1_TLB_SIZE(5) | EFFECTIVE_L1_QUEUE_SIZE(5); | 864 | EFFECTIVE_L1_TLB_SIZE(5) | EFFECTIVE_L1_QUEUE_SIZE(5); |
| 865 | WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp); | 865 | if (rdev->flags & RADEON_IS_IGP) { |
| 866 | WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp); | 866 | WREG32(FUS_MC_VM_MD_L1_TLB0_CNTL, tmp); |
| 867 | WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp); | 867 | WREG32(FUS_MC_VM_MD_L1_TLB1_CNTL, tmp); |
| 868 | WREG32(FUS_MC_VM_MD_L1_TLB2_CNTL, tmp); | ||
| 869 | } else { | ||
| 870 | WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp); | ||
| 871 | WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp); | ||
| 872 | WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp); | ||
| 873 | } | ||
| 868 | WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp); | 874 | WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp); |
| 869 | WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp); | 875 | WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp); |
| 870 | WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp); | 876 | WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp); |
| @@ -2923,11 +2929,6 @@ static int evergreen_startup(struct radeon_device *rdev) | |||
| 2923 | rdev->asic->copy = NULL; | 2929 | rdev->asic->copy = NULL; |
| 2924 | dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r); | 2930 | dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r); |
| 2925 | } | 2931 | } |
| 2926 | /* XXX: ontario has problems blitting to gart at the moment */ | ||
| 2927 | if (rdev->family == CHIP_PALM) { | ||
| 2928 | rdev->asic->copy = NULL; | ||
| 2929 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); | ||
| 2930 | } | ||
| 2931 | 2932 | ||
| 2932 | /* allocate wb buffer */ | 2933 | /* allocate wb buffer */ |
| 2933 | r = radeon_wb_init(rdev); | 2934 | r = radeon_wb_init(rdev); |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 9aaa3f0c9372..94533849927e 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
| @@ -221,6 +221,11 @@ | |||
| 221 | #define MC_VM_MD_L1_TLB0_CNTL 0x2654 | 221 | #define MC_VM_MD_L1_TLB0_CNTL 0x2654 |
| 222 | #define MC_VM_MD_L1_TLB1_CNTL 0x2658 | 222 | #define MC_VM_MD_L1_TLB1_CNTL 0x2658 |
| 223 | #define MC_VM_MD_L1_TLB2_CNTL 0x265C | 223 | #define MC_VM_MD_L1_TLB2_CNTL 0x265C |
| 224 | |||
| 225 | #define FUS_MC_VM_MD_L1_TLB0_CNTL 0x265C | ||
| 226 | #define FUS_MC_VM_MD_L1_TLB1_CNTL 0x2660 | ||
| 227 | #define FUS_MC_VM_MD_L1_TLB2_CNTL 0x2664 | ||
| 228 | |||
| 224 | #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C | 229 | #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C |
| 225 | #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 | 230 | #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038 |
| 226 | #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 | 231 | #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034 |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index f5d12fb103fa..dd881d035f09 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -431,7 +431,7 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
| 431 | } | 431 | } |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | /* Acer laptop (Acer TravelMate 5730G) has an HDMI port | 434 | /* Acer laptop (Acer TravelMate 5730/5730G) has an HDMI port |
| 435 | * on the laptop and a DVI port on the docking station and | 435 | * on the laptop and a DVI port on the docking station and |
| 436 | * both share the same encoder, hpd pin, and ddc line. | 436 | * both share the same encoder, hpd pin, and ddc line. |
| 437 | * So while the bios table is technically correct, | 437 | * So while the bios table is technically correct, |
| @@ -440,7 +440,7 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
| 440 | * with different crtcs which isn't possible on the hardware | 440 | * with different crtcs which isn't possible on the hardware |
| 441 | * side and leaves no crtcs for LVDS or VGA. | 441 | * side and leaves no crtcs for LVDS or VGA. |
| 442 | */ | 442 | */ |
| 443 | if ((dev->pdev->device == 0x95c4) && | 443 | if (((dev->pdev->device == 0x95c4) || (dev->pdev->device == 0x9591)) && |
| 444 | (dev->pdev->subsystem_vendor == 0x1025) && | 444 | (dev->pdev->subsystem_vendor == 0x1025) && |
| 445 | (dev->pdev->subsystem_device == 0x013c)) { | 445 | (dev->pdev->subsystem_device == 0x013c)) { |
| 446 | if ((*connector_type == DRM_MODE_CONNECTOR_DVII) && | 446 | if ((*connector_type == DRM_MODE_CONNECTOR_DVII) && |
| @@ -1599,9 +1599,10 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct | |||
| 1599 | memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0], | 1599 | memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0], |
| 1600 | fake_edid_record->ucFakeEDIDLength); | 1600 | fake_edid_record->ucFakeEDIDLength); |
| 1601 | 1601 | ||
| 1602 | if (drm_edid_is_valid(edid)) | 1602 | if (drm_edid_is_valid(edid)) { |
| 1603 | rdev->mode_info.bios_hardcoded_edid = edid; | 1603 | rdev->mode_info.bios_hardcoded_edid = edid; |
| 1604 | else | 1604 | rdev->mode_info.bios_hardcoded_edid_size = edid_size; |
| 1605 | } else | ||
| 1605 | kfree(edid); | 1606 | kfree(edid); |
| 1606 | } | 1607 | } |
| 1607 | } | 1608 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index ed5dfe58f29c..9d95792bea3e 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c | |||
| @@ -15,6 +15,9 @@ | |||
| 15 | #define ATPX_VERSION 0 | 15 | #define ATPX_VERSION 0 |
| 16 | #define ATPX_GPU_PWR 2 | 16 | #define ATPX_GPU_PWR 2 |
| 17 | #define ATPX_MUX_SELECT 3 | 17 | #define ATPX_MUX_SELECT 3 |
| 18 | #define ATPX_I2C_MUX_SELECT 4 | ||
| 19 | #define ATPX_SWITCH_START 5 | ||
| 20 | #define ATPX_SWITCH_END 6 | ||
| 18 | 21 | ||
| 19 | #define ATPX_INTEGRATED 0 | 22 | #define ATPX_INTEGRATED 0 |
| 20 | #define ATPX_DISCRETE 1 | 23 | #define ATPX_DISCRETE 1 |
| @@ -149,13 +152,35 @@ static int radeon_atpx_switch_mux(acpi_handle handle, int mux_id) | |||
| 149 | return radeon_atpx_execute(handle, ATPX_MUX_SELECT, mux_id); | 152 | return radeon_atpx_execute(handle, ATPX_MUX_SELECT, mux_id); |
| 150 | } | 153 | } |
| 151 | 154 | ||
| 155 | static int radeon_atpx_switch_i2c_mux(acpi_handle handle, int mux_id) | ||
| 156 | { | ||
| 157 | return radeon_atpx_execute(handle, ATPX_I2C_MUX_SELECT, mux_id); | ||
| 158 | } | ||
| 159 | |||
| 160 | static int radeon_atpx_switch_start(acpi_handle handle, int gpu_id) | ||
| 161 | { | ||
| 162 | return radeon_atpx_execute(handle, ATPX_SWITCH_START, gpu_id); | ||
| 163 | } | ||
| 164 | |||
| 165 | static int radeon_atpx_switch_end(acpi_handle handle, int gpu_id) | ||
| 166 | { | ||
| 167 | return radeon_atpx_execute(handle, ATPX_SWITCH_END, gpu_id); | ||
| 168 | } | ||
| 152 | 169 | ||
| 153 | static int radeon_atpx_switchto(enum vga_switcheroo_client_id id) | 170 | static int radeon_atpx_switchto(enum vga_switcheroo_client_id id) |
| 154 | { | 171 | { |
| 172 | int gpu_id; | ||
| 173 | |||
| 155 | if (id == VGA_SWITCHEROO_IGD) | 174 | if (id == VGA_SWITCHEROO_IGD) |
| 156 | radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, 0); | 175 | gpu_id = ATPX_INTEGRATED; |
| 157 | else | 176 | else |
| 158 | radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, 1); | 177 | gpu_id = ATPX_DISCRETE; |
| 178 | |||
| 179 | radeon_atpx_switch_start(radeon_atpx_priv.atpx_handle, gpu_id); | ||
| 180 | radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, gpu_id); | ||
| 181 | radeon_atpx_switch_i2c_mux(radeon_atpx_priv.atpx_handle, gpu_id); | ||
| 182 | radeon_atpx_switch_end(radeon_atpx_priv.atpx_handle, gpu_id); | ||
| 183 | |||
| 159 | return 0; | 184 | return 0; |
| 160 | } | 185 | } |
| 161 | 186 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index bdf2fa1189ae..3189a7efb2e9 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | |||
| @@ -167,9 +167,6 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc, | |||
| 167 | return -EINVAL; | 167 | return -EINVAL; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | radeon_crtc->cursor_width = width; | ||
| 171 | radeon_crtc->cursor_height = height; | ||
| 172 | |||
| 173 | obj = drm_gem_object_lookup(crtc->dev, file_priv, handle); | 170 | obj = drm_gem_object_lookup(crtc->dev, file_priv, handle); |
| 174 | if (!obj) { | 171 | if (!obj) { |
| 175 | DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->crtc_id); | 172 | DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->crtc_id); |
| @@ -180,6 +177,9 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc, | |||
| 180 | if (ret) | 177 | if (ret) |
| 181 | goto fail; | 178 | goto fail; |
| 182 | 179 | ||
| 180 | radeon_crtc->cursor_width = width; | ||
| 181 | radeon_crtc->cursor_height = height; | ||
| 182 | |||
| 183 | radeon_lock_cursor(crtc, true); | 183 | radeon_lock_cursor(crtc, true); |
| 184 | /* XXX only 27 bit offset for legacy cursor */ | 184 | /* XXX only 27 bit offset for legacy cursor */ |
| 185 | radeon_set_cursor(crtc, obj, gpu_addr); | 185 | radeon_set_cursor(crtc, obj, gpu_addr); |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 871df0376b1c..bd58af658581 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
| @@ -234,6 +234,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
| 234 | return -EINVAL; | 234 | return -EINVAL; |
| 235 | } | 235 | } |
| 236 | break; | 236 | break; |
| 237 | case RADEON_INFO_FUSION_GART_WORKING: | ||
| 238 | value = 1; | ||
| 239 | break; | ||
| 237 | default: | 240 | default: |
| 238 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); | 241 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); |
| 239 | return -EINVAL; | 242 | return -EINVAL; |
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 6ae054f8e0aa..9175d49d2546 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c | |||
| @@ -68,8 +68,23 @@ struct wm831x_ts { | |||
| 68 | unsigned int pd_irq; | 68 | unsigned int pd_irq; |
| 69 | bool pressure; | 69 | bool pressure; |
| 70 | bool pen_down; | 70 | bool pen_down; |
| 71 | struct work_struct pd_data_work; | ||
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | static void wm831x_pd_data_work(struct work_struct *work) | ||
| 75 | { | ||
| 76 | struct wm831x_ts *wm831x_ts = | ||
| 77 | container_of(work, struct wm831x_ts, pd_data_work); | ||
| 78 | |||
| 79 | if (wm831x_ts->pen_down) { | ||
| 80 | enable_irq(wm831x_ts->data_irq); | ||
| 81 | dev_dbg(wm831x_ts->wm831x->dev, "IRQ PD->DATA done\n"); | ||
| 82 | } else { | ||
| 83 | enable_irq(wm831x_ts->pd_irq); | ||
| 84 | dev_dbg(wm831x_ts->wm831x->dev, "IRQ DATA->PD done\n"); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 73 | static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) | 88 | static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) |
| 74 | { | 89 | { |
| 75 | struct wm831x_ts *wm831x_ts = irq_data; | 90 | struct wm831x_ts *wm831x_ts = irq_data; |
| @@ -110,6 +125,9 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) | |||
| 110 | } | 125 | } |
| 111 | 126 | ||
| 112 | if (!wm831x_ts->pen_down) { | 127 | if (!wm831x_ts->pen_down) { |
| 128 | /* Switch from data to pen down */ | ||
| 129 | dev_dbg(wm831x->dev, "IRQ DATA->PD\n"); | ||
| 130 | |||
| 113 | disable_irq_nosync(wm831x_ts->data_irq); | 131 | disable_irq_nosync(wm831x_ts->data_irq); |
| 114 | 132 | ||
| 115 | /* Don't need data any more */ | 133 | /* Don't need data any more */ |
| @@ -128,6 +146,10 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) | |||
| 128 | ABS_PRESSURE, 0); | 146 | ABS_PRESSURE, 0); |
| 129 | 147 | ||
| 130 | input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0); | 148 | input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0); |
| 149 | |||
| 150 | schedule_work(&wm831x_ts->pd_data_work); | ||
| 151 | } else { | ||
| 152 | input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1); | ||
| 131 | } | 153 | } |
| 132 | 154 | ||
| 133 | input_sync(wm831x_ts->input_dev); | 155 | input_sync(wm831x_ts->input_dev); |
| @@ -141,6 +163,11 @@ static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data) | |||
| 141 | struct wm831x *wm831x = wm831x_ts->wm831x; | 163 | struct wm831x *wm831x = wm831x_ts->wm831x; |
| 142 | int ena = 0; | 164 | int ena = 0; |
| 143 | 165 | ||
| 166 | if (wm831x_ts->pen_down) | ||
| 167 | return IRQ_HANDLED; | ||
| 168 | |||
| 169 | disable_irq_nosync(wm831x_ts->pd_irq); | ||
| 170 | |||
| 144 | /* Start collecting data */ | 171 | /* Start collecting data */ |
| 145 | if (wm831x_ts->pressure) | 172 | if (wm831x_ts->pressure) |
| 146 | ena |= WM831X_TCH_Z_ENA; | 173 | ena |= WM831X_TCH_Z_ENA; |
| @@ -149,14 +176,14 @@ static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data) | |||
| 149 | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA, | 176 | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA, |
| 150 | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena); | 177 | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena); |
| 151 | 178 | ||
| 152 | input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1); | ||
| 153 | input_sync(wm831x_ts->input_dev); | ||
| 154 | |||
| 155 | wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1, | 179 | wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1, |
| 156 | WM831X_TCHPD_EINT, WM831X_TCHPD_EINT); | 180 | WM831X_TCHPD_EINT, WM831X_TCHPD_EINT); |
| 157 | 181 | ||
| 158 | wm831x_ts->pen_down = true; | 182 | wm831x_ts->pen_down = true; |
| 159 | enable_irq(wm831x_ts->data_irq); | 183 | |
| 184 | /* Switch from pen down to data */ | ||
| 185 | dev_dbg(wm831x->dev, "IRQ PD->DATA\n"); | ||
| 186 | schedule_work(&wm831x_ts->pd_data_work); | ||
| 160 | 187 | ||
| 161 | return IRQ_HANDLED; | 188 | return IRQ_HANDLED; |
| 162 | } | 189 | } |
| @@ -182,13 +209,28 @@ static void wm831x_ts_input_close(struct input_dev *idev) | |||
| 182 | struct wm831x_ts *wm831x_ts = input_get_drvdata(idev); | 209 | struct wm831x_ts *wm831x_ts = input_get_drvdata(idev); |
| 183 | struct wm831x *wm831x = wm831x_ts->wm831x; | 210 | struct wm831x *wm831x = wm831x_ts->wm831x; |
| 184 | 211 | ||
| 212 | /* Shut the controller down, disabling all other functionality too */ | ||
| 185 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, | 213 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, |
| 186 | WM831X_TCH_ENA | WM831X_TCH_CVT_ENA | | 214 | WM831X_TCH_ENA | WM831X_TCH_X_ENA | |
| 187 | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | | 215 | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA, 0); |
| 188 | WM831X_TCH_Z_ENA, 0); | ||
| 189 | 216 | ||
| 190 | if (wm831x_ts->pen_down) | 217 | /* Make sure any pending IRQs are done, the above will prevent |
| 218 | * new ones firing. | ||
| 219 | */ | ||
| 220 | synchronize_irq(wm831x_ts->data_irq); | ||
| 221 | synchronize_irq(wm831x_ts->pd_irq); | ||
| 222 | |||
| 223 | /* Make sure the IRQ completion work is quiesced */ | ||
| 224 | flush_work_sync(&wm831x_ts->pd_data_work); | ||
| 225 | |||
| 226 | /* If we ended up with the pen down then make sure we revert back | ||
| 227 | * to pen detection state for the next time we start up. | ||
| 228 | */ | ||
| 229 | if (wm831x_ts->pen_down) { | ||
| 191 | disable_irq(wm831x_ts->data_irq); | 230 | disable_irq(wm831x_ts->data_irq); |
| 231 | enable_irq(wm831x_ts->pd_irq); | ||
| 232 | wm831x_ts->pen_down = false; | ||
| 233 | } | ||
| 192 | } | 234 | } |
| 193 | 235 | ||
| 194 | static __devinit int wm831x_ts_probe(struct platform_device *pdev) | 236 | static __devinit int wm831x_ts_probe(struct platform_device *pdev) |
| @@ -198,7 +240,7 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
| 198 | struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent); | 240 | struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent); |
| 199 | struct wm831x_touch_pdata *pdata = NULL; | 241 | struct wm831x_touch_pdata *pdata = NULL; |
| 200 | struct input_dev *input_dev; | 242 | struct input_dev *input_dev; |
| 201 | int error; | 243 | int error, irqf; |
| 202 | 244 | ||
| 203 | if (core_pdata) | 245 | if (core_pdata) |
| 204 | pdata = core_pdata->touch; | 246 | pdata = core_pdata->touch; |
| @@ -212,6 +254,7 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
| 212 | 254 | ||
| 213 | wm831x_ts->wm831x = wm831x; | 255 | wm831x_ts->wm831x = wm831x; |
| 214 | wm831x_ts->input_dev = input_dev; | 256 | wm831x_ts->input_dev = input_dev; |
| 257 | INIT_WORK(&wm831x_ts->pd_data_work, wm831x_pd_data_work); | ||
| 215 | 258 | ||
| 216 | /* | 259 | /* |
| 217 | * If we have a direct IRQ use it, otherwise use the interrupt | 260 | * If we have a direct IRQ use it, otherwise use the interrupt |
| @@ -270,9 +313,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
| 270 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, | 313 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, |
| 271 | WM831X_TCH_RATE_MASK, 6); | 314 | WM831X_TCH_RATE_MASK, 6); |
| 272 | 315 | ||
| 316 | if (pdata && pdata->data_irqf) | ||
| 317 | irqf = pdata->data_irqf; | ||
| 318 | else | ||
| 319 | irqf = IRQF_TRIGGER_HIGH; | ||
| 320 | |||
| 273 | error = request_threaded_irq(wm831x_ts->data_irq, | 321 | error = request_threaded_irq(wm831x_ts->data_irq, |
| 274 | NULL, wm831x_ts_data_irq, | 322 | NULL, wm831x_ts_data_irq, |
| 275 | IRQF_ONESHOT, | 323 | irqf | IRQF_ONESHOT, |
| 276 | "Touchscreen data", wm831x_ts); | 324 | "Touchscreen data", wm831x_ts); |
| 277 | if (error) { | 325 | if (error) { |
| 278 | dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n", | 326 | dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n", |
| @@ -281,9 +329,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
| 281 | } | 329 | } |
| 282 | disable_irq(wm831x_ts->data_irq); | 330 | disable_irq(wm831x_ts->data_irq); |
| 283 | 331 | ||
| 332 | if (pdata && pdata->pd_irqf) | ||
| 333 | irqf = pdata->pd_irqf; | ||
| 334 | else | ||
| 335 | irqf = IRQF_TRIGGER_HIGH; | ||
| 336 | |||
| 284 | error = request_threaded_irq(wm831x_ts->pd_irq, | 337 | error = request_threaded_irq(wm831x_ts->pd_irq, |
| 285 | NULL, wm831x_ts_pen_down_irq, | 338 | NULL, wm831x_ts_pen_down_irq, |
| 286 | IRQF_ONESHOT, | 339 | irqf | IRQF_ONESHOT, |
| 287 | "Touchscreen pen down", wm831x_ts); | 340 | "Touchscreen pen down", wm831x_ts); |
| 288 | if (error) { | 341 | if (error) { |
| 289 | dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n", | 342 | dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n", |
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index ccbd39a38c46..c545039287ad 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
| @@ -356,6 +356,8 @@ config DVB_USB_LME2510 | |||
| 356 | select DVB_TDA826X if !DVB_FE_CUSTOMISE | 356 | select DVB_TDA826X if !DVB_FE_CUSTOMISE |
| 357 | select DVB_STV0288 if !DVB_FE_CUSTOMISE | 357 | select DVB_STV0288 if !DVB_FE_CUSTOMISE |
| 358 | select DVB_IX2505V if !DVB_FE_CUSTOMISE | 358 | select DVB_IX2505V if !DVB_FE_CUSTOMISE |
| 359 | select DVB_STV0299 if !DVB_FE_CUSTOMISE | ||
| 360 | select DVB_PLL if !DVB_FE_CUSTOMISE | ||
| 359 | help | 361 | help |
| 360 | Say Y here to support the LME DM04/QQBOX DVB-S USB2.0 . | 362 | Say Y here to support the LME DM04/QQBOX DVB-S USB2.0 . |
| 361 | 363 | ||
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index ccc2d1af49d4..6927c726ce35 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
| @@ -1520,6 +1520,7 @@ static int init_channel(struct ngene_channel *chan) | |||
| 1520 | if (dev->ci.en && (io & NGENE_IO_TSOUT)) { | 1520 | if (dev->ci.en && (io & NGENE_IO_TSOUT)) { |
| 1521 | dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); | 1521 | dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); |
| 1522 | set_transfer(chan, 1); | 1522 | set_transfer(chan, 1); |
| 1523 | chan->dev->channel[2].DataFormatFlags = DF_SWAP32; | ||
| 1523 | set_transfer(&chan->dev->channel[2], 1); | 1524 | set_transfer(&chan->dev->channel[2], 1); |
| 1524 | dvb_register_device(adapter, &chan->ci_dev, | 1525 | dvb_register_device(adapter, &chan->ci_dev, |
| 1525 | &ngene_dvbdev_ci, (void *) chan, | 1526 | &ngene_dvbdev_ci, (void *) chan, |
diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c index 585680ffbfb6..b1193dfc5087 100644 --- a/drivers/media/radio/saa7706h.c +++ b/drivers/media/radio/saa7706h.c | |||
| @@ -376,7 +376,7 @@ static int __devinit saa7706h_probe(struct i2c_client *client, | |||
| 376 | v4l_info(client, "chip found @ 0x%02x (%s)\n", | 376 | v4l_info(client, "chip found @ 0x%02x (%s)\n", |
| 377 | client->addr << 1, client->adapter->name); | 377 | client->addr << 1, client->adapter->name); |
| 378 | 378 | ||
| 379 | state = kmalloc(sizeof(struct saa7706h_state), GFP_KERNEL); | 379 | state = kzalloc(sizeof(struct saa7706h_state), GFP_KERNEL); |
| 380 | if (state == NULL) | 380 | if (state == NULL) |
| 381 | return -ENOMEM; | 381 | return -ENOMEM; |
| 382 | sd = &state->sd; | 382 | sd = &state->sd; |
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c index 7c0d77751f6e..0991e1973678 100644 --- a/drivers/media/radio/tef6862.c +++ b/drivers/media/radio/tef6862.c | |||
| @@ -176,7 +176,7 @@ static int __devinit tef6862_probe(struct i2c_client *client, | |||
| 176 | v4l_info(client, "chip found @ 0x%02x (%s)\n", | 176 | v4l_info(client, "chip found @ 0x%02x (%s)\n", |
| 177 | client->addr << 1, client->adapter->name); | 177 | client->addr << 1, client->adapter->name); |
| 178 | 178 | ||
| 179 | state = kmalloc(sizeof(struct tef6862_state), GFP_KERNEL); | 179 | state = kzalloc(sizeof(struct tef6862_state), GFP_KERNEL); |
| 180 | if (state == NULL) | 180 | if (state == NULL) |
| 181 | return -ENOMEM; | 181 | return -ENOMEM; |
| 182 | state->freq = TEF6862_LO_FREQ; | 182 | state->freq = TEF6862_LO_FREQ; |
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index ebd68edf5b24..8fc0f081b470 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" | 46 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" |
| 47 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" | 47 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" |
| 48 | #define MOD_NAME "imon" | 48 | #define MOD_NAME "imon" |
| 49 | #define MOD_VERSION "0.9.2" | 49 | #define MOD_VERSION "0.9.3" |
| 50 | 50 | ||
| 51 | #define DISPLAY_MINOR_BASE 144 | 51 | #define DISPLAY_MINOR_BASE 144 |
| 52 | #define DEVICE_NAME "lcd%d" | 52 | #define DEVICE_NAME "lcd%d" |
| @@ -460,8 +460,9 @@ static int display_close(struct inode *inode, struct file *file) | |||
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | /** | 462 | /** |
| 463 | * Sends a packet to the device -- this function must be called | 463 | * Sends a packet to the device -- this function must be called with |
| 464 | * with ictx->lock held. | 464 | * ictx->lock held, or its unlock/lock sequence while waiting for tx |
| 465 | * to complete can/will lead to a deadlock. | ||
| 465 | */ | 466 | */ |
| 466 | static int send_packet(struct imon_context *ictx) | 467 | static int send_packet(struct imon_context *ictx) |
| 467 | { | 468 | { |
| @@ -991,12 +992,21 @@ static void imon_touch_display_timeout(unsigned long data) | |||
| 991 | * the iMON remotes, and those used by the Windows MCE remotes (which is | 992 | * the iMON remotes, and those used by the Windows MCE remotes (which is |
| 992 | * really just RC-6), but only one or the other at a time, as the signals | 993 | * really just RC-6), but only one or the other at a time, as the signals |
| 993 | * are decoded onboard the receiver. | 994 | * are decoded onboard the receiver. |
| 995 | * | ||
| 996 | * This function gets called two different ways, one way is from | ||
| 997 | * rc_register_device, for initial protocol selection/setup, and the other is | ||
| 998 | * via a userspace-initiated protocol change request, either by direct sysfs | ||
| 999 | * prodding or by something like ir-keytable. In the rc_register_device case, | ||
| 1000 | * the imon context lock is already held, but when initiated from userspace, | ||
| 1001 | * it is not, so we must acquire it prior to calling send_packet, which | ||
| 1002 | * requires that the lock is held. | ||
| 994 | */ | 1003 | */ |
| 995 | static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | 1004 | static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) |
| 996 | { | 1005 | { |
| 997 | int retval; | 1006 | int retval; |
| 998 | struct imon_context *ictx = rc->priv; | 1007 | struct imon_context *ictx = rc->priv; |
| 999 | struct device *dev = ictx->dev; | 1008 | struct device *dev = ictx->dev; |
| 1009 | bool unlock = false; | ||
| 1000 | unsigned char ir_proto_packet[] = { | 1010 | unsigned char ir_proto_packet[] = { |
| 1001 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; | 1011 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; |
| 1002 | 1012 | ||
| @@ -1029,6 +1039,11 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1029 | 1039 | ||
| 1030 | memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); | 1040 | memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); |
| 1031 | 1041 | ||
| 1042 | if (!mutex_is_locked(&ictx->lock)) { | ||
| 1043 | unlock = true; | ||
| 1044 | mutex_lock(&ictx->lock); | ||
| 1045 | } | ||
| 1046 | |||
| 1032 | retval = send_packet(ictx); | 1047 | retval = send_packet(ictx); |
| 1033 | if (retval) | 1048 | if (retval) |
| 1034 | goto out; | 1049 | goto out; |
| @@ -1037,6 +1052,9 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1037 | ictx->pad_mouse = false; | 1052 | ictx->pad_mouse = false; |
| 1038 | 1053 | ||
| 1039 | out: | 1054 | out: |
| 1055 | if (unlock) | ||
| 1056 | mutex_unlock(&ictx->lock); | ||
| 1057 | |||
| 1040 | return retval; | 1058 | return retval; |
| 1041 | } | 1059 | } |
| 1042 | 1060 | ||
| @@ -2134,6 +2152,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
| 2134 | goto rdev_setup_failed; | 2152 | goto rdev_setup_failed; |
| 2135 | } | 2153 | } |
| 2136 | 2154 | ||
| 2155 | mutex_unlock(&ictx->lock); | ||
| 2137 | return ictx; | 2156 | return ictx; |
| 2138 | 2157 | ||
| 2139 | rdev_setup_failed: | 2158 | rdev_setup_failed: |
| @@ -2205,6 +2224,7 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf, | |||
| 2205 | goto urb_submit_failed; | 2224 | goto urb_submit_failed; |
| 2206 | } | 2225 | } |
| 2207 | 2226 | ||
| 2227 | mutex_unlock(&ictx->lock); | ||
| 2208 | return ictx; | 2228 | return ictx; |
| 2209 | 2229 | ||
| 2210 | urb_submit_failed: | 2230 | urb_submit_failed: |
| @@ -2299,6 +2319,8 @@ static int __devinit imon_probe(struct usb_interface *interface, | |||
| 2299 | usb_set_intfdata(interface, ictx); | 2319 | usb_set_intfdata(interface, ictx); |
| 2300 | 2320 | ||
| 2301 | if (ifnum == 0) { | 2321 | if (ifnum == 0) { |
| 2322 | mutex_lock(&ictx->lock); | ||
| 2323 | |||
| 2302 | if (product == 0xffdc && ictx->rf_device) { | 2324 | if (product == 0xffdc && ictx->rf_device) { |
| 2303 | sysfs_err = sysfs_create_group(&interface->dev.kobj, | 2325 | sysfs_err = sysfs_create_group(&interface->dev.kobj, |
| 2304 | &imon_rf_attr_group); | 2326 | &imon_rf_attr_group); |
| @@ -2309,13 +2331,14 @@ static int __devinit imon_probe(struct usb_interface *interface, | |||
| 2309 | 2331 | ||
| 2310 | if (ictx->display_supported) | 2332 | if (ictx->display_supported) |
| 2311 | imon_init_display(ictx, interface); | 2333 | imon_init_display(ictx, interface); |
| 2334 | |||
| 2335 | mutex_unlock(&ictx->lock); | ||
| 2312 | } | 2336 | } |
| 2313 | 2337 | ||
| 2314 | dev_info(dev, "iMON device (%04x:%04x, intf%d) on " | 2338 | dev_info(dev, "iMON device (%04x:%04x, intf%d) on " |
| 2315 | "usb<%d:%d> initialized\n", vendor, product, ifnum, | 2339 | "usb<%d:%d> initialized\n", vendor, product, ifnum, |
| 2316 | usbdev->bus->busnum, usbdev->devnum); | 2340 | usbdev->bus->busnum, usbdev->devnum); |
| 2317 | 2341 | ||
| 2318 | mutex_unlock(&ictx->lock); | ||
| 2319 | mutex_unlock(&driver_lock); | 2342 | mutex_unlock(&driver_lock); |
| 2320 | 2343 | ||
| 2321 | return 0; | 2344 | return 0; |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index accaf6c9789a..43908a70bd8b 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
| 37 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
| 38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
| 39 | #include <linux/delay.h> | ||
| 39 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
| 40 | #include <linux/input.h> | 41 | #include <linux/input.h> |
| 41 | #include <linux/bitops.h> | 42 | #include <linux/bitops.h> |
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 044fb7a382d6..0c273ec465c9 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
| @@ -220,6 +220,8 @@ static struct usb_device_id mceusb_dev_table[] = { | |||
| 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, | 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, |
| 221 | /* Philips/Spinel plus IR transceiver for ASUS */ | 221 | /* Philips/Spinel plus IR transceiver for ASUS */ |
| 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, | 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, |
| 223 | /* Philips IR transceiver (Dell branded) */ | ||
| 224 | { USB_DEVICE(VENDOR_PHILIPS, 0x2093) }, | ||
| 223 | /* Realtek MCE IR Receiver and card reader */ | 225 | /* Realtek MCE IR Receiver and card reader */ |
| 224 | { USB_DEVICE(VENDOR_REALTEK, 0x0161), | 226 | { USB_DEVICE(VENDOR_REALTEK, 0x0161), |
| 225 | .driver_info = MULTIFUNCTION }, | 227 | .driver_info = MULTIFUNCTION }, |
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index f53f9c68d38d..a2706648e365 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
| @@ -707,7 +707,8 @@ static void ir_close(struct input_dev *idev) | |||
| 707 | { | 707 | { |
| 708 | struct rc_dev *rdev = input_get_drvdata(idev); | 708 | struct rc_dev *rdev = input_get_drvdata(idev); |
| 709 | 709 | ||
| 710 | rdev->close(rdev); | 710 | if (rdev) |
| 711 | rdev->close(rdev); | ||
| 711 | } | 712 | } |
| 712 | 713 | ||
| 713 | /* class for /sys/class/rc */ | 714 | /* class for /sys/class/rc */ |
| @@ -733,6 +734,7 @@ static struct { | |||
| 733 | { RC_TYPE_SONY, "sony" }, | 734 | { RC_TYPE_SONY, "sony" }, |
| 734 | { RC_TYPE_RC5_SZ, "rc-5-sz" }, | 735 | { RC_TYPE_RC5_SZ, "rc-5-sz" }, |
| 735 | { RC_TYPE_LIRC, "lirc" }, | 736 | { RC_TYPE_LIRC, "lirc" }, |
| 737 | { RC_TYPE_OTHER, "other" }, | ||
| 736 | }; | 738 | }; |
| 737 | 739 | ||
| 738 | #define PROTO_NONE "none" | 740 | #define PROTO_NONE "none" |
diff --git a/drivers/media/video/m52790.c b/drivers/media/video/m52790.c index 5e1c9a81984c..303ffa7df4ac 100644 --- a/drivers/media/video/m52790.c +++ b/drivers/media/video/m52790.c | |||
| @@ -174,7 +174,7 @@ static int m52790_probe(struct i2c_client *client, | |||
| 174 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 174 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 175 | client->addr << 1, client->adapter->name); | 175 | client->addr << 1, client->adapter->name); |
| 176 | 176 | ||
| 177 | state = kmalloc(sizeof(struct m52790_state), GFP_KERNEL); | 177 | state = kzalloc(sizeof(struct m52790_state), GFP_KERNEL); |
| 178 | if (state == NULL) | 178 | if (state == NULL) |
| 179 | return -ENOMEM; | 179 | return -ENOMEM; |
| 180 | 180 | ||
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index 5d4cf3b3d435..22fa8202d5ca 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c | |||
| @@ -171,7 +171,7 @@ static int tda9840_probe(struct i2c_client *client, | |||
| 171 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 171 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 172 | client->addr << 1, client->adapter->name); | 172 | client->addr << 1, client->adapter->name); |
| 173 | 173 | ||
| 174 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 174 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 175 | if (sd == NULL) | 175 | if (sd == NULL) |
| 176 | return -ENOMEM; | 176 | return -ENOMEM; |
| 177 | v4l2_i2c_subdev_init(sd, client, &tda9840_ops); | 177 | v4l2_i2c_subdev_init(sd, client, &tda9840_ops); |
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 19621ed523ec..827425c5b866 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c | |||
| @@ -152,7 +152,7 @@ static int tea6415c_probe(struct i2c_client *client, | |||
| 152 | 152 | ||
| 153 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 153 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 154 | client->addr << 1, client->adapter->name); | 154 | client->addr << 1, client->adapter->name); |
| 155 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 155 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 156 | if (sd == NULL) | 156 | if (sd == NULL) |
| 157 | return -ENOMEM; | 157 | return -ENOMEM; |
| 158 | v4l2_i2c_subdev_init(sd, client, &tea6415c_ops); | 158 | v4l2_i2c_subdev_init(sd, client, &tea6415c_ops); |
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 5ea840401f21..f350b6c24500 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c | |||
| @@ -125,7 +125,7 @@ static int tea6420_probe(struct i2c_client *client, | |||
| 125 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 125 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 126 | client->addr << 1, client->adapter->name); | 126 | client->addr << 1, client->adapter->name); |
| 127 | 127 | ||
| 128 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 128 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 129 | if (sd == NULL) | 129 | if (sd == NULL) |
| 130 | return -ENOMEM; | 130 | return -ENOMEM; |
| 131 | v4l2_i2c_subdev_init(sd, client, &tea6420_ops); | 131 | v4l2_i2c_subdev_init(sd, client, &tea6420_ops); |
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c index f8138c75be8b..1aab96a88203 100644 --- a/drivers/media/video/upd64031a.c +++ b/drivers/media/video/upd64031a.c | |||
| @@ -230,7 +230,7 @@ static int upd64031a_probe(struct i2c_client *client, | |||
| 230 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 230 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 231 | client->addr << 1, client->adapter->name); | 231 | client->addr << 1, client->adapter->name); |
| 232 | 232 | ||
| 233 | state = kmalloc(sizeof(struct upd64031a_state), GFP_KERNEL); | 233 | state = kzalloc(sizeof(struct upd64031a_state), GFP_KERNEL); |
| 234 | if (state == NULL) | 234 | if (state == NULL) |
| 235 | return -ENOMEM; | 235 | return -ENOMEM; |
| 236 | sd = &state->sd; | 236 | sd = &state->sd; |
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c index 28e0e6b6ca84..9bbe61700fd5 100644 --- a/drivers/media/video/upd64083.c +++ b/drivers/media/video/upd64083.c | |||
| @@ -202,7 +202,7 @@ static int upd64083_probe(struct i2c_client *client, | |||
| 202 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 202 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 203 | client->addr << 1, client->adapter->name); | 203 | client->addr << 1, client->adapter->name); |
| 204 | 204 | ||
| 205 | state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL); | 205 | state = kzalloc(sizeof(struct upd64083_state), GFP_KERNEL); |
| 206 | if (state == NULL) | 206 | if (state == NULL) |
| 207 | return -ENOMEM; | 207 | return -ENOMEM; |
| 208 | sd = &state->sd; | 208 | sd = &state->sd; |
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 53450f433f10..2e165117457b 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
| 26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
| 27 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
| 28 | #include <linux/regulator/consumer.h> | ||
| 29 | #include <plat/usb.h> | 28 | #include <plat/usb.h> |
| 30 | 29 | ||
| 31 | #define USBHS_DRIVER_NAME "usbhs-omap" | 30 | #define USBHS_DRIVER_NAME "usbhs-omap" |
| @@ -700,8 +699,7 @@ static int usbhs_enable(struct device *dev) | |||
| 700 | dev_dbg(dev, "starting TI HSUSB Controller\n"); | 699 | dev_dbg(dev, "starting TI HSUSB Controller\n"); |
| 701 | if (!pdata) { | 700 | if (!pdata) { |
| 702 | dev_dbg(dev, "missing platform_data\n"); | 701 | dev_dbg(dev, "missing platform_data\n"); |
| 703 | ret = -ENODEV; | 702 | return -ENODEV; |
| 704 | goto end_enable; | ||
| 705 | } | 703 | } |
| 706 | 704 | ||
| 707 | spin_lock_irqsave(&omap->lock, flags); | 705 | spin_lock_irqsave(&omap->lock, flags); |
| @@ -915,7 +913,8 @@ static int usbhs_enable(struct device *dev) | |||
| 915 | 913 | ||
| 916 | end_count: | 914 | end_count: |
| 917 | omap->count++; | 915 | omap->count++; |
| 918 | goto end_enable; | 916 | spin_unlock_irqrestore(&omap->lock, flags); |
| 917 | return 0; | ||
| 919 | 918 | ||
| 920 | err_tll: | 919 | err_tll: |
| 921 | if (pdata->ehci_data->phy_reset) { | 920 | if (pdata->ehci_data->phy_reset) { |
| @@ -931,8 +930,6 @@ err_tll: | |||
| 931 | clk_disable(omap->usbhost_fs_fck); | 930 | clk_disable(omap->usbhost_fs_fck); |
| 932 | clk_disable(omap->usbhost_hs_fck); | 931 | clk_disable(omap->usbhost_hs_fck); |
| 933 | clk_disable(omap->usbhost_ick); | 932 | clk_disable(omap->usbhost_ick); |
| 934 | |||
| 935 | end_enable: | ||
| 936 | spin_unlock_irqrestore(&omap->lock, flags); | 933 | spin_unlock_irqrestore(&omap->lock, flags); |
| 937 | return ret; | 934 | return ret; |
| 938 | } | 935 | } |
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 63667a8f140c..d6d62fd07ee9 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
| @@ -284,6 +284,7 @@ int mmc_add_card(struct mmc_card *card) | |||
| 284 | type = "SD-combo"; | 284 | type = "SD-combo"; |
| 285 | if (mmc_card_blockaddr(card)) | 285 | if (mmc_card_blockaddr(card)) |
| 286 | type = "SDHC-combo"; | 286 | type = "SDHC-combo"; |
| 287 | break; | ||
| 287 | default: | 288 | default: |
| 288 | type = "?"; | 289 | type = "?"; |
| 289 | break; | 290 | break; |
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 461e6a17fb90..2b200c1cfbba 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c | |||
| @@ -94,7 +94,7 @@ static void mmc_host_clk_gate_delayed(struct mmc_host *host) | |||
| 94 | spin_unlock_irqrestore(&host->clk_lock, flags); | 94 | spin_unlock_irqrestore(&host->clk_lock, flags); |
| 95 | return; | 95 | return; |
| 96 | } | 96 | } |
| 97 | mutex_lock(&host->clk_gate_mutex); | 97 | mmc_claim_host(host); |
| 98 | spin_lock_irqsave(&host->clk_lock, flags); | 98 | spin_lock_irqsave(&host->clk_lock, flags); |
| 99 | if (!host->clk_requests) { | 99 | if (!host->clk_requests) { |
| 100 | spin_unlock_irqrestore(&host->clk_lock, flags); | 100 | spin_unlock_irqrestore(&host->clk_lock, flags); |
| @@ -104,7 +104,7 @@ static void mmc_host_clk_gate_delayed(struct mmc_host *host) | |||
| 104 | pr_debug("%s: gated MCI clock\n", mmc_hostname(host)); | 104 | pr_debug("%s: gated MCI clock\n", mmc_hostname(host)); |
| 105 | } | 105 | } |
| 106 | spin_unlock_irqrestore(&host->clk_lock, flags); | 106 | spin_unlock_irqrestore(&host->clk_lock, flags); |
| 107 | mutex_unlock(&host->clk_gate_mutex); | 107 | mmc_release_host(host); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /* | 110 | /* |
| @@ -130,7 +130,7 @@ void mmc_host_clk_ungate(struct mmc_host *host) | |||
| 130 | { | 130 | { |
| 131 | unsigned long flags; | 131 | unsigned long flags; |
| 132 | 132 | ||
| 133 | mutex_lock(&host->clk_gate_mutex); | 133 | mmc_claim_host(host); |
| 134 | spin_lock_irqsave(&host->clk_lock, flags); | 134 | spin_lock_irqsave(&host->clk_lock, flags); |
| 135 | if (host->clk_gated) { | 135 | if (host->clk_gated) { |
| 136 | spin_unlock_irqrestore(&host->clk_lock, flags); | 136 | spin_unlock_irqrestore(&host->clk_lock, flags); |
| @@ -140,7 +140,7 @@ void mmc_host_clk_ungate(struct mmc_host *host) | |||
| 140 | } | 140 | } |
| 141 | host->clk_requests++; | 141 | host->clk_requests++; |
| 142 | spin_unlock_irqrestore(&host->clk_lock, flags); | 142 | spin_unlock_irqrestore(&host->clk_lock, flags); |
| 143 | mutex_unlock(&host->clk_gate_mutex); | 143 | mmc_release_host(host); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | /** | 146 | /** |
| @@ -215,7 +215,6 @@ static inline void mmc_host_clk_init(struct mmc_host *host) | |||
| 215 | host->clk_gated = false; | 215 | host->clk_gated = false; |
| 216 | INIT_WORK(&host->clk_gate_work, mmc_host_clk_gate_work); | 216 | INIT_WORK(&host->clk_gate_work, mmc_host_clk_gate_work); |
| 217 | spin_lock_init(&host->clk_lock); | 217 | spin_lock_init(&host->clk_lock); |
| 218 | mutex_init(&host->clk_gate_mutex); | ||
| 219 | } | 218 | } |
| 220 | 219 | ||
| 221 | /** | 220 | /** |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 2e032f0e8cf4..a6c329040140 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
| @@ -832,7 +832,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) | |||
| 832 | return IRQ_HANDLED; | 832 | return IRQ_HANDLED; |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | if (end_command) | 835 | if (end_command && host->cmd) |
| 836 | mmc_omap_cmd_done(host, host->cmd); | 836 | mmc_omap_cmd_done(host, host->cmd); |
| 837 | if (host->data != NULL) { | 837 | if (host->data != NULL) { |
| 838 | if (transfer_error) | 838 | if (transfer_error) |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index a136be706347..f8b5f37007b2 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
| @@ -957,6 +957,7 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot( | |||
| 957 | host->ioaddr = pci_ioremap_bar(pdev, bar); | 957 | host->ioaddr = pci_ioremap_bar(pdev, bar); |
| 958 | if (!host->ioaddr) { | 958 | if (!host->ioaddr) { |
| 959 | dev_err(&pdev->dev, "failed to remap registers\n"); | 959 | dev_err(&pdev->dev, "failed to remap registers\n"); |
| 960 | ret = -ENOMEM; | ||
| 960 | goto release; | 961 | goto release; |
| 961 | } | 962 | } |
| 962 | 963 | ||
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9e15f41f87be..5d20661bc357 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
| @@ -1334,6 +1334,13 @@ static void sdhci_tasklet_finish(unsigned long param) | |||
| 1334 | 1334 | ||
| 1335 | host = (struct sdhci_host*)param; | 1335 | host = (struct sdhci_host*)param; |
| 1336 | 1336 | ||
| 1337 | /* | ||
| 1338 | * If this tasklet gets rescheduled while running, it will | ||
| 1339 | * be run again afterwards but without any active request. | ||
| 1340 | */ | ||
| 1341 | if (!host->mrq) | ||
| 1342 | return; | ||
| 1343 | |||
| 1337 | spin_lock_irqsave(&host->lock, flags); | 1344 | spin_lock_irqsave(&host->lock, flags); |
| 1338 | 1345 | ||
| 1339 | del_timer(&host->timer); | 1346 | del_timer(&host->timer); |
| @@ -1345,7 +1352,7 @@ static void sdhci_tasklet_finish(unsigned long param) | |||
| 1345 | * upon error conditions. | 1352 | * upon error conditions. |
| 1346 | */ | 1353 | */ |
| 1347 | if (!(host->flags & SDHCI_DEVICE_DEAD) && | 1354 | if (!(host->flags & SDHCI_DEVICE_DEAD) && |
| 1348 | (mrq->cmd->error || | 1355 | ((mrq->cmd && mrq->cmd->error) || |
| 1349 | (mrq->data && (mrq->data->error || | 1356 | (mrq->data && (mrq->data->error || |
| 1350 | (mrq->data->stop && mrq->data->stop->error))) || | 1357 | (mrq->data->stop && mrq->data->stop->error))) || |
| 1351 | (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) { | 1358 | (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) { |
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 62d37de6de76..710339a85c84 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c | |||
| @@ -728,15 +728,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 728 | tmio_mmc_set_clock(host, ios->clock); | 728 | tmio_mmc_set_clock(host, ios->clock); |
| 729 | 729 | ||
| 730 | /* Power sequence - OFF -> UP -> ON */ | 730 | /* Power sequence - OFF -> UP -> ON */ |
| 731 | if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { | 731 | if (ios->power_mode == MMC_POWER_UP) { |
| 732 | /* power up SD bus */ | ||
| 733 | if (host->set_pwr) | ||
| 734 | host->set_pwr(host->pdev, 1); | ||
| 735 | } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { | ||
| 732 | /* power down SD bus */ | 736 | /* power down SD bus */ |
| 733 | if (ios->power_mode == MMC_POWER_OFF && host->set_pwr) | 737 | if (ios->power_mode == MMC_POWER_OFF && host->set_pwr) |
| 734 | host->set_pwr(host->pdev, 0); | 738 | host->set_pwr(host->pdev, 0); |
| 735 | tmio_mmc_clk_stop(host); | 739 | tmio_mmc_clk_stop(host); |
| 736 | } else if (ios->power_mode == MMC_POWER_UP) { | ||
| 737 | /* power up SD bus */ | ||
| 738 | if (host->set_pwr) | ||
| 739 | host->set_pwr(host->pdev, 1); | ||
| 740 | } else { | 740 | } else { |
| 741 | /* start bus clock */ | 741 | /* start bus clock */ |
| 742 | tmio_mmc_clk_start(host); | 742 | tmio_mmc_clk_start(host); |
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 5f2dd386152b..2c1abf63957f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
| @@ -585,8 +585,9 @@ static bool eeepc_wlan_rfkill_blocked(struct eeepc_laptop *eeepc) | |||
| 585 | return true; | 585 | return true; |
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) | 588 | static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) |
| 589 | { | 589 | { |
| 590 | struct pci_dev *port; | ||
| 590 | struct pci_dev *dev; | 591 | struct pci_dev *dev; |
| 591 | struct pci_bus *bus; | 592 | struct pci_bus *bus; |
| 592 | bool blocked = eeepc_wlan_rfkill_blocked(eeepc); | 593 | bool blocked = eeepc_wlan_rfkill_blocked(eeepc); |
| @@ -599,9 +600,16 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) | |||
| 599 | mutex_lock(&eeepc->hotplug_lock); | 600 | mutex_lock(&eeepc->hotplug_lock); |
| 600 | 601 | ||
| 601 | if (eeepc->hotplug_slot) { | 602 | if (eeepc->hotplug_slot) { |
| 602 | bus = pci_find_bus(0, 1); | 603 | port = acpi_get_pci_dev(handle); |
| 604 | if (!port) { | ||
| 605 | pr_warning("Unable to find port\n"); | ||
| 606 | goto out_unlock; | ||
| 607 | } | ||
| 608 | |||
| 609 | bus = port->subordinate; | ||
| 610 | |||
| 603 | if (!bus) { | 611 | if (!bus) { |
| 604 | pr_warning("Unable to find PCI bus 1?\n"); | 612 | pr_warning("Unable to find PCI bus?\n"); |
| 605 | goto out_unlock; | 613 | goto out_unlock; |
| 606 | } | 614 | } |
| 607 | 615 | ||
| @@ -609,6 +617,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) | |||
| 609 | pr_err("Unable to read PCI config space?\n"); | 617 | pr_err("Unable to read PCI config space?\n"); |
| 610 | goto out_unlock; | 618 | goto out_unlock; |
| 611 | } | 619 | } |
| 620 | |||
| 612 | absent = (l == 0xffffffff); | 621 | absent = (l == 0xffffffff); |
| 613 | 622 | ||
| 614 | if (blocked != absent) { | 623 | if (blocked != absent) { |
| @@ -647,6 +656,17 @@ out_unlock: | |||
| 647 | mutex_unlock(&eeepc->hotplug_lock); | 656 | mutex_unlock(&eeepc->hotplug_lock); |
| 648 | } | 657 | } |
| 649 | 658 | ||
| 659 | static void eeepc_rfkill_hotplug_update(struct eeepc_laptop *eeepc, char *node) | ||
| 660 | { | ||
| 661 | acpi_status status = AE_OK; | ||
| 662 | acpi_handle handle; | ||
| 663 | |||
| 664 | status = acpi_get_handle(NULL, node, &handle); | ||
| 665 | |||
| 666 | if (ACPI_SUCCESS(status)) | ||
| 667 | eeepc_rfkill_hotplug(eeepc, handle); | ||
| 668 | } | ||
| 669 | |||
| 650 | static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) | 670 | static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) |
| 651 | { | 671 | { |
| 652 | struct eeepc_laptop *eeepc = data; | 672 | struct eeepc_laptop *eeepc = data; |
| @@ -654,7 +674,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) | |||
| 654 | if (event != ACPI_NOTIFY_BUS_CHECK) | 674 | if (event != ACPI_NOTIFY_BUS_CHECK) |
| 655 | return; | 675 | return; |
| 656 | 676 | ||
| 657 | eeepc_rfkill_hotplug(eeepc); | 677 | eeepc_rfkill_hotplug(eeepc, handle); |
| 658 | } | 678 | } |
| 659 | 679 | ||
| 660 | static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, | 680 | static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, |
| @@ -672,6 +692,11 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, | |||
| 672 | eeepc); | 692 | eeepc); |
| 673 | if (ACPI_FAILURE(status)) | 693 | if (ACPI_FAILURE(status)) |
| 674 | pr_warning("Failed to register notify on %s\n", node); | 694 | pr_warning("Failed to register notify on %s\n", node); |
| 695 | /* | ||
| 696 | * Refresh pci hotplug in case the rfkill state was | ||
| 697 | * changed during setup. | ||
| 698 | */ | ||
| 699 | eeepc_rfkill_hotplug(eeepc, handle); | ||
| 675 | } else | 700 | } else |
| 676 | return -ENODEV; | 701 | return -ENODEV; |
| 677 | 702 | ||
| @@ -693,6 +718,12 @@ static void eeepc_unregister_rfkill_notifier(struct eeepc_laptop *eeepc, | |||
| 693 | if (ACPI_FAILURE(status)) | 718 | if (ACPI_FAILURE(status)) |
| 694 | pr_err("Error removing rfkill notify handler %s\n", | 719 | pr_err("Error removing rfkill notify handler %s\n", |
| 695 | node); | 720 | node); |
| 721 | /* | ||
| 722 | * Refresh pci hotplug in case the rfkill | ||
| 723 | * state was changed after | ||
| 724 | * eeepc_unregister_rfkill_notifier() | ||
| 725 | */ | ||
| 726 | eeepc_rfkill_hotplug(eeepc, handle); | ||
| 696 | } | 727 | } |
| 697 | } | 728 | } |
| 698 | 729 | ||
| @@ -816,11 +847,7 @@ static void eeepc_rfkill_exit(struct eeepc_laptop *eeepc) | |||
| 816 | rfkill_destroy(eeepc->wlan_rfkill); | 847 | rfkill_destroy(eeepc->wlan_rfkill); |
| 817 | eeepc->wlan_rfkill = NULL; | 848 | eeepc->wlan_rfkill = NULL; |
| 818 | } | 849 | } |
| 819 | /* | 850 | |
| 820 | * Refresh pci hotplug in case the rfkill state was changed after | ||
| 821 | * eeepc_unregister_rfkill_notifier() | ||
| 822 | */ | ||
| 823 | eeepc_rfkill_hotplug(eeepc); | ||
| 824 | if (eeepc->hotplug_slot) | 851 | if (eeepc->hotplug_slot) |
| 825 | pci_hp_deregister(eeepc->hotplug_slot); | 852 | pci_hp_deregister(eeepc->hotplug_slot); |
| 826 | 853 | ||
| @@ -889,11 +916,6 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc) | |||
| 889 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); | 916 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); |
| 890 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); | 917 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); |
| 891 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); | 918 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); |
| 892 | /* | ||
| 893 | * Refresh pci hotplug in case the rfkill state was changed during | ||
| 894 | * setup. | ||
| 895 | */ | ||
| 896 | eeepc_rfkill_hotplug(eeepc); | ||
| 897 | 919 | ||
| 898 | exit: | 920 | exit: |
| 899 | if (result && result != -ENODEV) | 921 | if (result && result != -ENODEV) |
| @@ -928,8 +950,11 @@ static int eeepc_hotk_restore(struct device *device) | |||
| 928 | struct eeepc_laptop *eeepc = dev_get_drvdata(device); | 950 | struct eeepc_laptop *eeepc = dev_get_drvdata(device); |
| 929 | 951 | ||
| 930 | /* Refresh both wlan rfkill state and pci hotplug */ | 952 | /* Refresh both wlan rfkill state and pci hotplug */ |
| 931 | if (eeepc->wlan_rfkill) | 953 | if (eeepc->wlan_rfkill) { |
| 932 | eeepc_rfkill_hotplug(eeepc); | 954 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P5"); |
| 955 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P6"); | ||
| 956 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P7"); | ||
| 957 | } | ||
| 933 | 958 | ||
| 934 | if (eeepc->bluetooth_rfkill) | 959 | if (eeepc->bluetooth_rfkill) |
| 935 | rfkill_set_sw_state(eeepc->bluetooth_rfkill, | 960 | rfkill_set_sw_state(eeepc->bluetooth_rfkill, |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 8f709aec4da0..6fe8cd6e23b5 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
| @@ -934,6 +934,14 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
| 934 | /* | 934 | /* |
| 935 | * Backlight device | 935 | * Backlight device |
| 936 | */ | 936 | */ |
| 937 | struct sony_backlight_props { | ||
| 938 | struct backlight_device *dev; | ||
| 939 | int handle; | ||
| 940 | u8 offset; | ||
| 941 | u8 maxlvl; | ||
| 942 | }; | ||
| 943 | struct sony_backlight_props sony_bl_props; | ||
| 944 | |||
| 937 | static int sony_backlight_update_status(struct backlight_device *bd) | 945 | static int sony_backlight_update_status(struct backlight_device *bd) |
| 938 | { | 946 | { |
| 939 | return acpi_callsetfunc(sony_nc_acpi_handle, "SBRT", | 947 | return acpi_callsetfunc(sony_nc_acpi_handle, "SBRT", |
| @@ -954,21 +962,26 @@ static int sony_nc_get_brightness_ng(struct backlight_device *bd) | |||
| 954 | { | 962 | { |
| 955 | int result; | 963 | int result; |
| 956 | int *handle = (int *)bl_get_data(bd); | 964 | int *handle = (int *)bl_get_data(bd); |
| 965 | struct sony_backlight_props *sdev = | ||
| 966 | (struct sony_backlight_props *)bl_get_data(bd); | ||
| 957 | 967 | ||
| 958 | sony_call_snc_handle(*handle, 0x0200, &result); | 968 | sony_call_snc_handle(sdev->handle, 0x0200, &result); |
| 959 | 969 | ||
| 960 | return result & 0xff; | 970 | return (result & 0xff) - sdev->offset; |
| 961 | } | 971 | } |
| 962 | 972 | ||
| 963 | static int sony_nc_update_status_ng(struct backlight_device *bd) | 973 | static int sony_nc_update_status_ng(struct backlight_device *bd) |
| 964 | { | 974 | { |
| 965 | int value, result; | 975 | int value, result; |
| 966 | int *handle = (int *)bl_get_data(bd); | 976 | int *handle = (int *)bl_get_data(bd); |
| 977 | struct sony_backlight_props *sdev = | ||
| 978 | (struct sony_backlight_props *)bl_get_data(bd); | ||
| 967 | 979 | ||
| 968 | value = bd->props.brightness; | 980 | value = bd->props.brightness + sdev->offset; |
| 969 | sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result); | 981 | if (sony_call_snc_handle(sdev->handle, 0x0100 | (value << 16), &result)) |
| 982 | return -EIO; | ||
| 970 | 983 | ||
| 971 | return sony_nc_get_brightness_ng(bd); | 984 | return value; |
| 972 | } | 985 | } |
| 973 | 986 | ||
| 974 | static const struct backlight_ops sony_backlight_ops = { | 987 | static const struct backlight_ops sony_backlight_ops = { |
| @@ -981,8 +994,6 @@ static const struct backlight_ops sony_backlight_ng_ops = { | |||
| 981 | .update_status = sony_nc_update_status_ng, | 994 | .update_status = sony_nc_update_status_ng, |
| 982 | .get_brightness = sony_nc_get_brightness_ng, | 995 | .get_brightness = sony_nc_get_brightness_ng, |
| 983 | }; | 996 | }; |
| 984 | static int backlight_ng_handle; | ||
| 985 | static struct backlight_device *sony_backlight_device; | ||
| 986 | 997 | ||
| 987 | /* | 998 | /* |
| 988 | * New SNC-only Vaios event mapping to driver known keys | 999 | * New SNC-only Vaios event mapping to driver known keys |
| @@ -1549,6 +1560,75 @@ static void sony_nc_kbd_backlight_resume(void) | |||
| 1549 | &ignore); | 1560 | &ignore); |
| 1550 | } | 1561 | } |
| 1551 | 1562 | ||
| 1563 | static void sony_nc_backlight_ng_read_limits(int handle, | ||
| 1564 | struct sony_backlight_props *props) | ||
| 1565 | { | ||
| 1566 | int offset; | ||
| 1567 | acpi_status status; | ||
| 1568 | u8 brlvl, i; | ||
| 1569 | u8 min = 0xff, max = 0x00; | ||
| 1570 | struct acpi_object_list params; | ||
| 1571 | union acpi_object in_obj; | ||
| 1572 | union acpi_object *lvl_enum; | ||
| 1573 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | ||
| 1574 | |||
| 1575 | props->handle = handle; | ||
| 1576 | props->offset = 0; | ||
| 1577 | props->maxlvl = 0xff; | ||
| 1578 | |||
| 1579 | offset = sony_find_snc_handle(handle); | ||
| 1580 | if (offset < 0) | ||
| 1581 | return; | ||
| 1582 | |||
| 1583 | /* try to read the boundaries from ACPI tables, if we fail the above | ||
| 1584 | * defaults should be reasonable | ||
| 1585 | */ | ||
| 1586 | params.count = 1; | ||
| 1587 | params.pointer = &in_obj; | ||
| 1588 | in_obj.type = ACPI_TYPE_INTEGER; | ||
| 1589 | in_obj.integer.value = offset; | ||
| 1590 | status = acpi_evaluate_object(sony_nc_acpi_handle, "SN06", ¶ms, | ||
| 1591 | &buffer); | ||
| 1592 | if (ACPI_FAILURE(status)) | ||
| 1593 | return; | ||
| 1594 | |||
| 1595 | lvl_enum = (union acpi_object *) buffer.pointer; | ||
| 1596 | if (!lvl_enum) { | ||
| 1597 | pr_err("No SN06 return object."); | ||
| 1598 | return; | ||
| 1599 | } | ||
| 1600 | if (lvl_enum->type != ACPI_TYPE_BUFFER) { | ||
| 1601 | pr_err("Invalid SN06 return object 0x%.2x\n", | ||
| 1602 | lvl_enum->type); | ||
| 1603 | goto out_invalid; | ||
| 1604 | } | ||
| 1605 | |||
| 1606 | /* the buffer lists brightness levels available, brightness levels are | ||
| 1607 | * from 0 to 8 in the array, other values are used by ALS control. | ||
| 1608 | */ | ||
| 1609 | for (i = 0; i < 9 && i < lvl_enum->buffer.length; i++) { | ||
| 1610 | |||
| 1611 | brlvl = *(lvl_enum->buffer.pointer + i); | ||
| 1612 | dprintk("Brightness level: %d\n", brlvl); | ||
| 1613 | |||
| 1614 | if (!brlvl) | ||
| 1615 | break; | ||
| 1616 | |||
| 1617 | if (brlvl > max) | ||
| 1618 | max = brlvl; | ||
| 1619 | if (brlvl < min) | ||
| 1620 | min = brlvl; | ||
| 1621 | } | ||
| 1622 | props->offset = min; | ||
| 1623 | props->maxlvl = max; | ||
| 1624 | dprintk("Brightness levels: min=%d max=%d\n", props->offset, | ||
| 1625 | props->maxlvl); | ||
| 1626 | |||
| 1627 | out_invalid: | ||
| 1628 | kfree(buffer.pointer); | ||
| 1629 | return; | ||
| 1630 | } | ||
| 1631 | |||
| 1552 | static void sony_nc_backlight_setup(void) | 1632 | static void sony_nc_backlight_setup(void) |
| 1553 | { | 1633 | { |
| 1554 | acpi_handle unused; | 1634 | acpi_handle unused; |
| @@ -1557,14 +1637,14 @@ static void sony_nc_backlight_setup(void) | |||
| 1557 | struct backlight_properties props; | 1637 | struct backlight_properties props; |
| 1558 | 1638 | ||
| 1559 | if (sony_find_snc_handle(0x12f) != -1) { | 1639 | if (sony_find_snc_handle(0x12f) != -1) { |
| 1560 | backlight_ng_handle = 0x12f; | ||
| 1561 | ops = &sony_backlight_ng_ops; | 1640 | ops = &sony_backlight_ng_ops; |
| 1562 | max_brightness = 0xff; | 1641 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); |
| 1642 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | ||
| 1563 | 1643 | ||
| 1564 | } else if (sony_find_snc_handle(0x137) != -1) { | 1644 | } else if (sony_find_snc_handle(0x137) != -1) { |
| 1565 | backlight_ng_handle = 0x137; | ||
| 1566 | ops = &sony_backlight_ng_ops; | 1645 | ops = &sony_backlight_ng_ops; |
| 1567 | max_brightness = 0xff; | 1646 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); |
| 1647 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | ||
| 1568 | 1648 | ||
| 1569 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 1649 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", |
| 1570 | &unused))) { | 1650 | &unused))) { |
| @@ -1577,22 +1657,22 @@ static void sony_nc_backlight_setup(void) | |||
| 1577 | memset(&props, 0, sizeof(struct backlight_properties)); | 1657 | memset(&props, 0, sizeof(struct backlight_properties)); |
| 1578 | props.type = BACKLIGHT_PLATFORM; | 1658 | props.type = BACKLIGHT_PLATFORM; |
| 1579 | props.max_brightness = max_brightness; | 1659 | props.max_brightness = max_brightness; |
| 1580 | sony_backlight_device = backlight_device_register("sony", NULL, | 1660 | sony_bl_props.dev = backlight_device_register("sony", NULL, |
| 1581 | &backlight_ng_handle, | 1661 | &sony_bl_props, |
| 1582 | ops, &props); | 1662 | ops, &props); |
| 1583 | 1663 | ||
| 1584 | if (IS_ERR(sony_backlight_device)) { | 1664 | if (IS_ERR(sony_bl_props.dev)) { |
| 1585 | pr_warning(DRV_PFX "unable to register backlight device\n"); | 1665 | pr_warn(DRV_PFX "unable to register backlight device\n"); |
| 1586 | sony_backlight_device = NULL; | 1666 | sony_bl_props.dev = NULL; |
| 1587 | } else | 1667 | } else |
| 1588 | sony_backlight_device->props.brightness = | 1668 | sony_bl_props.dev->props.brightness = |
| 1589 | ops->get_brightness(sony_backlight_device); | 1669 | ops->get_brightness(sony_bl_props.dev); |
| 1590 | } | 1670 | } |
| 1591 | 1671 | ||
| 1592 | static void sony_nc_backlight_cleanup(void) | 1672 | static void sony_nc_backlight_cleanup(void) |
| 1593 | { | 1673 | { |
| 1594 | if (sony_backlight_device) | 1674 | if (sony_bl_props.dev) |
| 1595 | backlight_device_unregister(sony_backlight_device); | 1675 | backlight_device_unregister(sony_bl_props.dev); |
| 1596 | } | 1676 | } |
| 1597 | 1677 | ||
| 1598 | static int sony_nc_add(struct acpi_device *device) | 1678 | static int sony_nc_add(struct acpi_device *device) |
| @@ -2590,7 +2670,7 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, | |||
| 2590 | mutex_lock(&spic_dev.lock); | 2670 | mutex_lock(&spic_dev.lock); |
| 2591 | switch (cmd) { | 2671 | switch (cmd) { |
| 2592 | case SONYPI_IOCGBRT: | 2672 | case SONYPI_IOCGBRT: |
| 2593 | if (sony_backlight_device == NULL) { | 2673 | if (sony_bl_props.dev == NULL) { |
| 2594 | ret = -EIO; | 2674 | ret = -EIO; |
| 2595 | break; | 2675 | break; |
| 2596 | } | 2676 | } |
| @@ -2603,7 +2683,7 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, | |||
| 2603 | ret = -EFAULT; | 2683 | ret = -EFAULT; |
| 2604 | break; | 2684 | break; |
| 2605 | case SONYPI_IOCSBRT: | 2685 | case SONYPI_IOCSBRT: |
| 2606 | if (sony_backlight_device == NULL) { | 2686 | if (sony_bl_props.dev == NULL) { |
| 2607 | ret = -EIO; | 2687 | ret = -EIO; |
| 2608 | break; | 2688 | break; |
| 2609 | } | 2689 | } |
| @@ -2617,8 +2697,8 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, | |||
| 2617 | break; | 2697 | break; |
| 2618 | } | 2698 | } |
| 2619 | /* sync the backlight device status */ | 2699 | /* sync the backlight device status */ |
| 2620 | sony_backlight_device->props.brightness = | 2700 | sony_bl_props.dev->props.brightness = |
| 2621 | sony_backlight_get_brightness(sony_backlight_device); | 2701 | sony_backlight_get_brightness(sony_bl_props.dev); |
| 2622 | break; | 2702 | break; |
| 2623 | case SONYPI_IOCGBAT1CAP: | 2703 | case SONYPI_IOCGBAT1CAP: |
| 2624 | if (ec_read16(SONYPI_BAT1_FULL, &val16)) { | 2704 | if (ec_read16(SONYPI_BAT1_FULL, &val16)) { |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index efb3b6b9bcdb..562fcf0dd2b5 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -128,7 +128,8 @@ enum { | |||
| 128 | }; | 128 | }; |
| 129 | 129 | ||
| 130 | /* ACPI HIDs */ | 130 | /* ACPI HIDs */ |
| 131 | #define TPACPI_ACPI_HKEY_HID "IBM0068" | 131 | #define TPACPI_ACPI_IBM_HKEY_HID "IBM0068" |
| 132 | #define TPACPI_ACPI_LENOVO_HKEY_HID "LEN0068" | ||
| 132 | #define TPACPI_ACPI_EC_HID "PNP0C09" | 133 | #define TPACPI_ACPI_EC_HID "PNP0C09" |
| 133 | 134 | ||
| 134 | /* Input IDs */ | 135 | /* Input IDs */ |
| @@ -3879,7 +3880,8 @@ errexit: | |||
| 3879 | } | 3880 | } |
| 3880 | 3881 | ||
| 3881 | static const struct acpi_device_id ibm_htk_device_ids[] = { | 3882 | static const struct acpi_device_id ibm_htk_device_ids[] = { |
| 3882 | {TPACPI_ACPI_HKEY_HID, 0}, | 3883 | {TPACPI_ACPI_IBM_HKEY_HID, 0}, |
| 3884 | {TPACPI_ACPI_LENOVO_HKEY_HID, 0}, | ||
| 3883 | {"", 0}, | 3885 | {"", 0}, |
| 3884 | }; | 3886 | }; |
| 3885 | 3887 | ||
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e9901b8f8443..0bac91e72370 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -400,10 +400,15 @@ static inline int scsi_host_is_busy(struct Scsi_Host *shost) | |||
| 400 | static void scsi_run_queue(struct request_queue *q) | 400 | static void scsi_run_queue(struct request_queue *q) |
| 401 | { | 401 | { |
| 402 | struct scsi_device *sdev = q->queuedata; | 402 | struct scsi_device *sdev = q->queuedata; |
| 403 | struct Scsi_Host *shost = sdev->host; | 403 | struct Scsi_Host *shost; |
| 404 | LIST_HEAD(starved_list); | 404 | LIST_HEAD(starved_list); |
| 405 | unsigned long flags; | 405 | unsigned long flags; |
| 406 | 406 | ||
| 407 | /* if the device is dead, sdev will be NULL, so no queue to run */ | ||
| 408 | if (!sdev) | ||
| 409 | return; | ||
| 410 | |||
| 411 | shost = sdev->host; | ||
| 407 | if (scsi_target(sdev)->single_lun) | 412 | if (scsi_target(sdev)->single_lun) |
| 408 | scsi_single_lun_run(sdev); | 413 | scsi_single_lun_run(sdev); |
| 409 | 414 | ||
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index eeb7dd43f9a8..830822f86e41 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | |||
| @@ -2288,7 +2288,3 @@ err_dev: | |||
| 2288 | free_netdev(dev); | 2288 | free_netdev(dev); |
| 2289 | return NULL; | 2289 | return NULL; |
| 2290 | } | 2290 | } |
| 2291 | |||
| 2292 | EXPORT_SYMBOL(init_ft1000_card); | ||
| 2293 | EXPORT_SYMBOL(stop_ft1000_card); | ||
| 2294 | EXPORT_SYMBOL(flarion_ft1000_cnt); | ||
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c index 935608e72007..bdfb1aec58df 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c | |||
| @@ -214,6 +214,3 @@ void ft1000CleanupProc(struct net_device *dev) | |||
| 214 | remove_proc_entry(FT1000_PROC, init_net.proc_net); | 214 | remove_proc_entry(FT1000_PROC, init_net.proc_net); |
| 215 | unregister_netdevice_notifier(&ft1000_netdev_notifier); | 215 | unregister_netdevice_notifier(&ft1000_netdev_notifier); |
| 216 | } | 216 | } |
| 217 | |||
| 218 | EXPORT_SYMBOL(ft1000InitProc); | ||
| 219 | EXPORT_SYMBOL(ft1000CleanupProc); | ||
diff --git a/drivers/staging/gma500/Kconfig b/drivers/staging/gma500/Kconfig index 5501eb9b3355..ce8bedaeaac2 100644 --- a/drivers/staging/gma500/Kconfig +++ b/drivers/staging/gma500/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config DRM_PSB | 1 | config DRM_PSB |
| 2 | tristate "Intel GMA500 KMS Framebuffer" | 2 | tristate "Intel GMA500 KMS Framebuffer" |
| 3 | depends on DRM && PCI | 3 | depends on DRM && PCI && X86 |
| 4 | select FB_CFB_COPYAREA | 4 | select FB_CFB_COPYAREA |
| 5 | select FB_CFB_FILLRECT | 5 | select FB_CFB_FILLRECT |
| 6 | select FB_CFB_IMAGEBLIT | 6 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/staging/intel_sst/intelmid_v1_control.c b/drivers/staging/intel_sst/intelmid_v1_control.c index 9cc15c1c18d4..1ea814218059 100644 --- a/drivers/staging/intel_sst/intelmid_v1_control.c +++ b/drivers/staging/intel_sst/intelmid_v1_control.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 29 | 29 | ||
| 30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
| 31 | #include <linux/delay.h> | ||
| 31 | #include <linux/file.h> | 32 | #include <linux/file.h> |
| 32 | #include <asm/mrst.h> | 33 | #include <asm/mrst.h> |
| 33 | #include <sound/pcm.h> | 34 | #include <sound/pcm.h> |
diff --git a/drivers/staging/intel_sst/intelmid_v2_control.c b/drivers/staging/intel_sst/intelmid_v2_control.c index 26d815a67eb8..3c6b3abff3c3 100644 --- a/drivers/staging/intel_sst/intelmid_v2_control.c +++ b/drivers/staging/intel_sst/intelmid_v2_control.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 30 | 30 | ||
| 31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
| 32 | #include <linux/delay.h> | ||
| 32 | #include <linux/file.h> | 33 | #include <linux/file.h> |
| 33 | #include "intel_sst.h" | 34 | #include "intel_sst.h" |
| 34 | #include "intelmid_snd_control.h" | 35 | #include "intelmid_snd_control.h" |
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c index b5d21f6497f9..22c04eabed41 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c +++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | */ | 12 | */ |
| 13 | #include <linux/cs5535.h> | 13 | #include <linux/cs5535.h> |
| 14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
| 15 | #include <linux/delay.h> | ||
| 15 | #include <asm/olpc.h> | 16 | #include <asm/olpc.h> |
| 16 | 17 | ||
| 17 | #include "olpc_dcon.h" | 18 | #include "olpc_dcon.h" |
diff --git a/drivers/staging/rts_pstor/debug.h b/drivers/staging/rts_pstor/debug.h index e1408b0e7ae4..ab305be96fb5 100644 --- a/drivers/staging/rts_pstor/debug.h +++ b/drivers/staging/rts_pstor/debug.h | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | #define RTSX_STOR "rts_pstor: " | 29 | #define RTSX_STOR "rts_pstor: " |
| 30 | 30 | ||
| 31 | #if CONFIG_RTS_PSTOR_DEBUG | 31 | #ifdef CONFIG_RTS_PSTOR_DEBUG |
| 32 | #define RTSX_DEBUGP(x...) printk(KERN_DEBUG RTSX_STOR x) | 32 | #define RTSX_DEBUGP(x...) printk(KERN_DEBUG RTSX_STOR x) |
| 33 | #define RTSX_DEBUGPN(x...) printk(KERN_DEBUG x) | 33 | #define RTSX_DEBUGPN(x...) printk(KERN_DEBUG x) |
| 34 | #define RTSX_DEBUGPX(x...) printk(x) | 34 | #define RTSX_DEBUGPX(x...) printk(x) |
diff --git a/drivers/staging/rts_pstor/ms.c b/drivers/staging/rts_pstor/ms.c index 810e170894f5..d89795c6a3ac 100644 --- a/drivers/staging/rts_pstor/ms.c +++ b/drivers/staging/rts_pstor/ms.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
| 24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
| 25 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
| 26 | #include <linux/vmalloc.h> | ||
| 26 | 27 | ||
| 27 | #include "rtsx.h" | 28 | #include "rtsx.h" |
| 28 | #include "rtsx_transport.h" | 29 | #include "rtsx_transport.h" |
diff --git a/drivers/staging/rts_pstor/rtsx_chip.c b/drivers/staging/rts_pstor/rtsx_chip.c index d2f1c715a684..4e60780ea804 100644 --- a/drivers/staging/rts_pstor/rtsx_chip.c +++ b/drivers/staging/rts_pstor/rtsx_chip.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
| 25 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
| 26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
| 27 | #include <linux/vmalloc.h> | ||
| 27 | 28 | ||
| 28 | #include "rtsx.h" | 29 | #include "rtsx.h" |
| 29 | #include "rtsx_transport.h" | 30 | #include "rtsx_transport.h" |
| @@ -1311,11 +1312,11 @@ void rtsx_polling_func(struct rtsx_chip *chip) | |||
| 1311 | 1312 | ||
| 1312 | #ifdef SUPPORT_OCP | 1313 | #ifdef SUPPORT_OCP |
| 1313 | if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) { | 1314 | if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) { |
| 1314 | #if CONFIG_RTS_PSTOR_DEBUG | 1315 | #ifdef CONFIG_RTS_PSTOR_DEBUG |
| 1315 | if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER | MS_OC_NOW | MS_OC_EVER)) { | 1316 | if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER | MS_OC_NOW | MS_OC_EVER)) { |
| 1316 | RTSX_DEBUGP("Over current, OCPSTAT is 0x%x\n", chip->ocp_stat); | 1317 | RTSX_DEBUGP("Over current, OCPSTAT is 0x%x\n", chip->ocp_stat); |
| 1317 | } | 1318 | } |
| 1318 | #endif | 1319 | #endif |
| 1319 | 1320 | ||
| 1320 | if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER)) { | 1321 | if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER)) { |
| 1321 | if (chip->card_exist & SD_CARD) { | 1322 | if (chip->card_exist & SD_CARD) { |
diff --git a/drivers/staging/rts_pstor/rtsx_scsi.c b/drivers/staging/rts_pstor/rtsx_scsi.c index 20c2464a20f9..7de1fae443fc 100644 --- a/drivers/staging/rts_pstor/rtsx_scsi.c +++ b/drivers/staging/rts_pstor/rtsx_scsi.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
| 24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
| 25 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
| 26 | #include <linux/vmalloc.h> | ||
| 26 | 27 | ||
| 27 | #include "rtsx.h" | 28 | #include "rtsx.h" |
| 28 | #include "rtsx_transport.h" | 29 | #include "rtsx_transport.h" |
diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c index 8d066bd428c4..b1277a6c7a8b 100644 --- a/drivers/staging/rts_pstor/sd.c +++ b/drivers/staging/rts_pstor/sd.c | |||
| @@ -909,7 +909,7 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) | |||
| 909 | RTSX_WRITE_REG(chip, SD_VPCLK0_CTL, PHASE_NOT_RESET, PHASE_NOT_RESET); | 909 | RTSX_WRITE_REG(chip, SD_VPCLK0_CTL, PHASE_NOT_RESET, PHASE_NOT_RESET); |
| 910 | RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0); | 910 | RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0); |
| 911 | } else { | 911 | } else { |
| 912 | #if CONFIG_RTS_PSTOR_DEBUG | 912 | #ifdef CONFIG_RTS_PSTOR_DEBUG |
| 913 | rtsx_read_register(chip, SD_VP_CTL, &val); | 913 | rtsx_read_register(chip, SD_VP_CTL, &val); |
| 914 | RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val); | 914 | RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val); |
| 915 | rtsx_read_register(chip, SD_DCMPS_CTL, &val); | 915 | rtsx_read_register(chip, SD_DCMPS_CTL, &val); |
| @@ -958,7 +958,7 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) | |||
| 958 | return STATUS_SUCCESS; | 958 | return STATUS_SUCCESS; |
| 959 | 959 | ||
| 960 | Fail: | 960 | Fail: |
| 961 | #if CONFIG_RTS_PSTOR_DEBUG | 961 | #ifdef CONFIG_RTS_PSTOR_DEBUG |
| 962 | rtsx_read_register(chip, SD_VP_CTL, &val); | 962 | rtsx_read_register(chip, SD_VP_CTL, &val); |
| 963 | RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val); | 963 | RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val); |
| 964 | rtsx_read_register(chip, SD_DCMPS_CTL, &val); | 964 | rtsx_read_register(chip, SD_DCMPS_CTL, &val); |
diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h index 2c668bae6ff4..bc83b49a4eb4 100644 --- a/drivers/staging/rts_pstor/trace.h +++ b/drivers/staging/rts_pstor/trace.h | |||
| @@ -82,7 +82,7 @@ do { \ | |||
| 82 | #define TRACE_GOTO(chip, label) goto label | 82 | #define TRACE_GOTO(chip, label) goto label |
| 83 | #endif | 83 | #endif |
| 84 | 84 | ||
| 85 | #if CONFIG_RTS_PSTOR_DEBUG | 85 | #ifdef CONFIG_RTS_PSTOR_DEBUG |
| 86 | static inline void rtsx_dump(u8 *buf, int buf_len) | 86 | static inline void rtsx_dump(u8 *buf, int buf_len) |
| 87 | { | 87 | { |
| 88 | int i; | 88 | int i; |
diff --git a/drivers/staging/rts_pstor/xd.c b/drivers/staging/rts_pstor/xd.c index 7bcd468b8f2c..9f3add1e8f59 100644 --- a/drivers/staging/rts_pstor/xd.c +++ b/drivers/staging/rts_pstor/xd.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
| 24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
| 25 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
| 26 | #include <linux/vmalloc.h> | ||
| 26 | 27 | ||
| 27 | #include "rtsx.h" | 28 | #include "rtsx.h" |
| 28 | #include "rtsx_transport.h" | 29 | #include "rtsx_transport.h" |
diff --git a/drivers/staging/solo6x10/Kconfig b/drivers/staging/solo6x10/Kconfig index 2cf77c940860..03dcac4ea4d0 100644 --- a/drivers/staging/solo6x10/Kconfig +++ b/drivers/staging/solo6x10/Kconfig | |||
| @@ -2,6 +2,7 @@ config SOLO6X10 | |||
| 2 | tristate "Softlogic 6x10 MPEG codec cards" | 2 | tristate "Softlogic 6x10 MPEG codec cards" |
| 3 | depends on PCI && VIDEO_DEV && SND && I2C | 3 | depends on PCI && VIDEO_DEV && SND && I2C |
| 4 | select VIDEOBUF_DMA_SG | 4 | select VIDEOBUF_DMA_SG |
| 5 | select SND_PCM | ||
| 5 | ---help--- | 6 | ---help--- |
| 6 | This driver supports the Softlogic based MPEG-4 and h.264 codec | 7 | This driver supports the Softlogic based MPEG-4 and h.264 codec |
| 7 | codec cards. | 8 | codec cards. |
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 0f02a4b12ae4..4f4f13321f40 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c | |||
| @@ -876,8 +876,10 @@ static void vhci_shutdown_connection(struct usbip_device *ud) | |||
| 876 | } | 876 | } |
| 877 | 877 | ||
| 878 | /* kill threads related to this sdev, if v.c. exists */ | 878 | /* kill threads related to this sdev, if v.c. exists */ |
| 879 | kthread_stop(vdev->ud.tcp_rx); | 879 | if (vdev->ud.tcp_rx) |
| 880 | kthread_stop(vdev->ud.tcp_tx); | 880 | kthread_stop(vdev->ud.tcp_rx); |
| 881 | if (vdev->ud.tcp_tx) | ||
| 882 | kthread_stop(vdev->ud.tcp_tx); | ||
| 881 | 883 | ||
| 882 | usbip_uinfo("stop threads\n"); | 884 | usbip_uinfo("stop threads\n"); |
| 883 | 885 | ||
| @@ -949,9 +951,6 @@ static void vhci_device_init(struct vhci_device *vdev) | |||
| 949 | { | 951 | { |
| 950 | memset(vdev, 0, sizeof(*vdev)); | 952 | memset(vdev, 0, sizeof(*vdev)); |
| 951 | 953 | ||
| 952 | vdev->ud.tcp_rx = kthread_create(vhci_rx_loop, &vdev->ud, "vhci_rx"); | ||
| 953 | vdev->ud.tcp_tx = kthread_create(vhci_tx_loop, &vdev->ud, "vhci_tx"); | ||
| 954 | |||
| 955 | vdev->ud.side = USBIP_VHCI; | 954 | vdev->ud.side = USBIP_VHCI; |
| 956 | vdev->ud.status = VDEV_ST_NULL; | 955 | vdev->ud.status = VDEV_ST_NULL; |
| 957 | /* vdev->ud.lock = SPIN_LOCK_UNLOCKED; */ | 956 | /* vdev->ud.lock = SPIN_LOCK_UNLOCKED; */ |
| @@ -1139,7 +1138,7 @@ static int vhci_hcd_probe(struct platform_device *pdev) | |||
| 1139 | usbip_uerr("create hcd failed\n"); | 1138 | usbip_uerr("create hcd failed\n"); |
| 1140 | return -ENOMEM; | 1139 | return -ENOMEM; |
| 1141 | } | 1140 | } |
| 1142 | 1141 | hcd->has_tt = 1; | |
| 1143 | 1142 | ||
| 1144 | /* this is private data for vhci_hcd */ | 1143 | /* this is private data for vhci_hcd */ |
| 1145 | the_controller = hcd_to_vhci(hcd); | 1144 | the_controller = hcd_to_vhci(hcd); |
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index 3f2459f30415..e2dadbd5ef1e 100644 --- a/drivers/staging/usbip/vhci_sysfs.c +++ b/drivers/staging/usbip/vhci_sysfs.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include "vhci.h" | 21 | #include "vhci.h" |
| 22 | 22 | ||
| 23 | #include <linux/in.h> | 23 | #include <linux/in.h> |
| 24 | #include <linux/kthread.h> | ||
| 24 | 25 | ||
| 25 | /* TODO: refine locking ?*/ | 26 | /* TODO: refine locking ?*/ |
| 26 | 27 | ||
| @@ -220,13 +221,13 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, | |||
| 220 | vdev->ud.tcp_socket = socket; | 221 | vdev->ud.tcp_socket = socket; |
| 221 | vdev->ud.status = VDEV_ST_NOTASSIGNED; | 222 | vdev->ud.status = VDEV_ST_NOTASSIGNED; |
| 222 | 223 | ||
| 223 | wake_up_process(vdev->ud.tcp_rx); | ||
| 224 | wake_up_process(vdev->ud.tcp_tx); | ||
| 225 | |||
| 226 | spin_unlock(&vdev->ud.lock); | 224 | spin_unlock(&vdev->ud.lock); |
| 227 | spin_unlock(&the_controller->lock); | 225 | spin_unlock(&the_controller->lock); |
| 228 | /* end the lock */ | 226 | /* end the lock */ |
| 229 | 227 | ||
| 228 | vdev->ud.tcp_rx = kthread_run(vhci_rx_loop, &vdev->ud, "vhci_rx"); | ||
| 229 | vdev->ud.tcp_tx = kthread_run(vhci_tx_loop, &vdev->ud, "vhci_tx"); | ||
| 230 | |||
| 230 | rh_port_connect(rhport, speed); | 231 | rh_port_connect(rhport, speed); |
| 231 | 232 | ||
| 232 | return count; | 233 | return count; |
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 6a71f52c59b1..76378397b763 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c | |||
| @@ -273,7 +273,7 @@ exit: | |||
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev, | 275 | int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev, |
| 276 | u8 key_index) | 276 | u8 key_index, bool unicast, bool multicast) |
| 277 | { | 277 | { |
| 278 | wlandevice_t *wlandev = dev->ml_priv; | 278 | wlandevice_t *wlandev = dev->ml_priv; |
| 279 | 279 | ||
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7e41a95c5ceb..627f3a678759 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
| 41 | #include <linux/usb/ulpi.h> | 41 | #include <linux/usb/ulpi.h> |
| 42 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
| 43 | #include <linux/regulator/consumer.h> | ||
| 43 | 44 | ||
| 44 | /* EHCI Register Set */ | 45 | /* EHCI Register Set */ |
| 45 | #define EHCI_INSNREG04 (0xA0) | 46 | #define EHCI_INSNREG04 (0xA0) |
| @@ -118,6 +119,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
| 118 | struct ehci_hcd *omap_ehci; | 119 | struct ehci_hcd *omap_ehci; |
| 119 | int ret = -ENODEV; | 120 | int ret = -ENODEV; |
| 120 | int irq; | 121 | int irq; |
| 122 | int i; | ||
| 123 | char supply[7]; | ||
| 121 | 124 | ||
| 122 | if (usb_disabled()) | 125 | if (usb_disabled()) |
| 123 | return -ENODEV; | 126 | return -ENODEV; |
| @@ -158,6 +161,23 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
| 158 | hcd->rsrc_len = resource_size(res); | 161 | hcd->rsrc_len = resource_size(res); |
| 159 | hcd->regs = regs; | 162 | hcd->regs = regs; |
| 160 | 163 | ||
| 164 | /* get ehci regulator and enable */ | ||
| 165 | for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { | ||
| 166 | if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) { | ||
| 167 | pdata->regulator[i] = NULL; | ||
| 168 | continue; | ||
| 169 | } | ||
| 170 | snprintf(supply, sizeof(supply), "hsusb%d", i); | ||
| 171 | pdata->regulator[i] = regulator_get(dev, supply); | ||
| 172 | if (IS_ERR(pdata->regulator[i])) { | ||
| 173 | pdata->regulator[i] = NULL; | ||
| 174 | dev_dbg(dev, | ||
| 175 | "failed to get ehci port%d regulator\n", i); | ||
| 176 | } else { | ||
| 177 | regulator_enable(pdata->regulator[i]); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 161 | ret = omap_usbhs_enable(dev); | 181 | ret = omap_usbhs_enable(dev); |
| 162 | if (ret) { | 182 | if (ret) { |
| 163 | dev_err(dev, "failed to start usbhs with err %d\n", ret); | 183 | dev_err(dev, "failed to start usbhs with err %d\n", ret); |
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index 795345ad45e6..7b2e69aa2e98 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
| @@ -1633,6 +1633,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
| 1633 | ints[i].qh = NULL; | 1633 | ints[i].qh = NULL; |
| 1634 | ints[i].qtd = NULL; | 1634 | ints[i].qtd = NULL; |
| 1635 | 1635 | ||
| 1636 | urb->status = status; | ||
| 1636 | isp1760_urb_done(hcd, urb); | 1637 | isp1760_urb_done(hcd, urb); |
| 1637 | if (qtd) | 1638 | if (qtd) |
| 1638 | pe(hcd, qh, qtd); | 1639 | pe(hcd, qh, qtd); |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index a78f2ebd11b7..73f75d26436c 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -777,7 +777,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd) | |||
| 777 | if (t1 != t2) | 777 | if (t1 != t2) |
| 778 | xhci_writel(xhci, t2, port_array[port_index]); | 778 | xhci_writel(xhci, t2, port_array[port_index]); |
| 779 | 779 | ||
| 780 | if (DEV_HIGHSPEED(t1)) { | 780 | if (hcd->speed != HCD_USB3) { |
| 781 | /* enable remote wake up for USB 2.0 */ | 781 | /* enable remote wake up for USB 2.0 */ |
| 782 | u32 __iomem *addr; | 782 | u32 __iomem *addr; |
| 783 | u32 tmp; | 783 | u32 tmp; |
| @@ -866,6 +866,21 @@ int xhci_bus_resume(struct usb_hcd *hcd) | |||
| 866 | temp |= PORT_LINK_STROBE | XDEV_U0; | 866 | temp |= PORT_LINK_STROBE | XDEV_U0; |
| 867 | xhci_writel(xhci, temp, port_array[port_index]); | 867 | xhci_writel(xhci, temp, port_array[port_index]); |
| 868 | } | 868 | } |
| 869 | /* wait for the port to enter U0 and report port link | ||
| 870 | * state change. | ||
| 871 | */ | ||
| 872 | spin_unlock_irqrestore(&xhci->lock, flags); | ||
| 873 | msleep(20); | ||
| 874 | spin_lock_irqsave(&xhci->lock, flags); | ||
| 875 | |||
| 876 | /* Clear PLC */ | ||
| 877 | temp = xhci_readl(xhci, port_array[port_index]); | ||
| 878 | if (temp & PORT_PLC) { | ||
| 879 | temp = xhci_port_state_to_neutral(temp); | ||
| 880 | temp |= PORT_PLC; | ||
| 881 | xhci_writel(xhci, temp, port_array[port_index]); | ||
| 882 | } | ||
| 883 | |||
| 869 | slot_id = xhci_find_slot_id_by_port(hcd, | 884 | slot_id = xhci_find_slot_id_by_port(hcd, |
| 870 | xhci, port_index + 1); | 885 | xhci, port_index + 1); |
| 871 | if (slot_id) | 886 | if (slot_id) |
| @@ -873,7 +888,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) | |||
| 873 | } else | 888 | } else |
| 874 | xhci_writel(xhci, temp, port_array[port_index]); | 889 | xhci_writel(xhci, temp, port_array[port_index]); |
| 875 | 890 | ||
| 876 | if (DEV_HIGHSPEED(temp)) { | 891 | if (hcd->speed != HCD_USB3) { |
| 877 | /* disable remote wake up for USB 2.0 */ | 892 | /* disable remote wake up for USB 2.0 */ |
| 878 | u32 __iomem *addr; | 893 | u32 __iomem *addr; |
| 879 | u32 tmp; | 894 | u32 tmp; |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6dfbf9ffd7a6..f47c20197c61 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -1887,11 +1887,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 1887 | otg_set_vbus(musb->xceiv, 1); | 1887 | otg_set_vbus(musb->xceiv, 1); |
| 1888 | 1888 | ||
| 1889 | hcd->self.uses_pio_for_control = 1; | 1889 | hcd->self.uses_pio_for_control = 1; |
| 1890 | |||
| 1891 | if (musb->xceiv->last_event == USB_EVENT_NONE) | ||
| 1892 | pm_runtime_put(musb->controller); | ||
| 1893 | |||
| 1894 | } | 1890 | } |
| 1891 | if (musb->xceiv->last_event == USB_EVENT_NONE) | ||
| 1892 | pm_runtime_put(musb->controller); | ||
| 1895 | 1893 | ||
| 1896 | return 0; | 1894 | return 0; |
| 1897 | 1895 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 57a27fa954b4..e9e60b6e0583 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -270,7 +270,7 @@ static int musb_otg_notifications(struct notifier_block *nb, | |||
| 270 | DBG(4, "VBUS Disconnect\n"); | 270 | DBG(4, "VBUS Disconnect\n"); |
| 271 | 271 | ||
| 272 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | 272 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC |
| 273 | if (is_otg_enabled(musb)) | 273 | if (is_otg_enabled(musb) || is_peripheral_enabled(musb)) |
| 274 | if (musb->gadget_driver) | 274 | if (musb->gadget_driver) |
| 275 | #endif | 275 | #endif |
| 276 | { | 276 | { |
