diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
| commit | 05ea893c46805b2981ea8ba6df881e3d65edd63b (patch) | |
| tree | ea381e22d99f49bd2c95238f88491d48b797a17b /drivers/usb/misc/usbsevseg.c | |
| parent | 26481fb15644b5fd85d4cea020f74a234cdf6803 (diff) | |
| parent | a7c542782e92f9487c62a571565637be3d6b0ffd (diff) | |
Merge remote branch 'anholt/drm-intel-next' into drm-next
* anholt/drm-intel-next: (515 commits)
drm/i915: Fix out of tree builds
drm/i915: move fence lru to struct drm_i915_fence_reg
drm/i915: don't allow tiling changes on pinned buffers v2
drm/i915: Be extra careful about A/D matching for multifunction SDVO
drm/i915: Fix DDC bus selection for multifunction SDVO
drm/i915: cleanup mode setting before unmapping registers
drm/i915: Make fbc control wrapper functions
drm/i915: Wait for the GPU whilst shrinking, if truly desperate.
drm/i915: Use spatio-temporal dithering on PCH
[MTD] Remove zero-length files mtdbdi.c and internal.ho
pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs
libata: Fix several inaccuracies in developer's guide
slub: Fix bad boundary check in init_kmem_cache_nodes()
raid6: fix recovery performance regression
KEYS: call_sbin_request_key() must write lock keyrings before modifying them
KEYS: Use RCU dereference wrappers in keyring key type code
KEYS: find_keyring_by_name() can gain access to a freed keyring
ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582
ALSA: take tu->qlock with irqs disabled
...
Diffstat (limited to 'drivers/usb/misc/usbsevseg.c')
| -rw-r--r-- | drivers/usb/misc/usbsevseg.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index a9555cb901a1..de8ef945b536 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c | |||
| @@ -49,6 +49,7 @@ struct usb_sevsegdev { | |||
| 49 | u16 textlength; | 49 | u16 textlength; |
| 50 | 50 | ||
| 51 | u8 shadow_power; /* for PM */ | 51 | u8 shadow_power; /* for PM */ |
| 52 | u8 has_interface_pm; | ||
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | /* sysfs_streq can't replace this completely | 55 | /* sysfs_streq can't replace this completely |
| @@ -68,12 +69,16 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
| 68 | { | 69 | { |
| 69 | int rc; | 70 | int rc; |
| 70 | 71 | ||
| 71 | if (!mydev->shadow_power && mydev->powered) { | 72 | if (mydev->powered && !mydev->has_interface_pm) { |
| 72 | rc = usb_autopm_get_interface(mydev->intf); | 73 | rc = usb_autopm_get_interface(mydev->intf); |
| 73 | if (rc < 0) | 74 | if (rc < 0) |
| 74 | return; | 75 | return; |
| 76 | mydev->has_interface_pm = 1; | ||
| 75 | } | 77 | } |
| 76 | 78 | ||
| 79 | if (mydev->shadow_power != 1) | ||
| 80 | return; | ||
| 81 | |||
| 77 | rc = usb_control_msg(mydev->udev, | 82 | rc = usb_control_msg(mydev->udev, |
| 78 | usb_sndctrlpipe(mydev->udev, 0), | 83 | usb_sndctrlpipe(mydev->udev, 0), |
| 79 | 0x12, | 84 | 0x12, |
| @@ -86,8 +91,10 @@ static void update_display_powered(struct usb_sevsegdev *mydev) | |||
| 86 | if (rc < 0) | 91 | if (rc < 0) |
| 87 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); | 92 | dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc); |
| 88 | 93 | ||
| 89 | if (mydev->shadow_power && !mydev->powered) | 94 | if (!mydev->powered && mydev->has_interface_pm) { |
| 90 | usb_autopm_put_interface(mydev->intf); | 95 | usb_autopm_put_interface(mydev->intf); |
| 96 | mydev->has_interface_pm = 0; | ||
| 97 | } | ||
| 91 | } | 98 | } |
| 92 | 99 | ||
| 93 | static void update_display_mode(struct usb_sevsegdev *mydev) | 100 | static void update_display_mode(struct usb_sevsegdev *mydev) |
| @@ -351,6 +358,10 @@ static int sevseg_probe(struct usb_interface *interface, | |||
| 351 | mydev->intf = interface; | 358 | mydev->intf = interface; |
| 352 | usb_set_intfdata(interface, mydev); | 359 | usb_set_intfdata(interface, mydev); |
| 353 | 360 | ||
| 361 | /* PM */ | ||
| 362 | mydev->shadow_power = 1; /* currently active */ | ||
| 363 | mydev->has_interface_pm = 0; /* have not issued autopm_get */ | ||
| 364 | |||
| 354 | /*set defaults */ | 365 | /*set defaults */ |
| 355 | mydev->textmode = 0x02; /* ascii mode */ | 366 | mydev->textmode = 0x02; /* ascii mode */ |
| 356 | mydev->mode_msb = 0x06; /* 6 characters */ | 367 | mydev->mode_msb = 0x06; /* 6 characters */ |
