Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324708
b: refs/heads/master
c: 0e4da5c
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Brett authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 6439b72 commit ac3a48d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 411c076a2e8faad165f3504f4bad89cdfa5989cc
refs/heads/master: 0e4da5cbaefa02ed408f8a78d759baef2905bf34
35 changes: 35 additions & 0 deletions trunk/drivers/staging/asus_oled/asus_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct asus_oled_dev {
size_t buf_size;
char *buf;
uint8_t enabled;
uint8_t enabled_post_resume;
struct device *dev;
};

Expand Down Expand Up @@ -765,11 +766,45 @@ static void asus_oled_disconnect(struct usb_interface *interface)
dev_info(&interface->dev, "Disconnected Asus OLED device\n");
}

#ifdef CONFIG_PM
static int asus_oled_suspend(struct usb_interface *intf, pm_message_t message)
{
struct asus_oled_dev *odev;

odev = usb_get_intfdata(intf);
if (!odev)
return -ENODEV;

odev->enabled_post_resume = odev->enabled;
enable_oled(odev, 0);

return 0;
}

static int asus_oled_resume(struct usb_interface *intf)
{
struct asus_oled_dev *odev;

odev = usb_get_intfdata(intf);
if (!odev)
return -ENODEV;

enable_oled(odev, odev->enabled_post_resume);

return 0;
}
#else
#define asus_oled_suspend NULL
#define asus_oled_resume NULL
#endif

static struct usb_driver oled_driver = {
.name = ASUS_OLED_NAME,
.probe = asus_oled_probe,
.disconnect = asus_oled_disconnect,
.id_table = id_table,
.suspend = asus_oled_suspend,
.resume = asus_oled_resume,
};

static CLASS_ATTR_STRING(version, S_IRUGO,
Expand Down

0 comments on commit ac3a48d

Please sign in to comment.