From 6560912775befde2137369f60b853d03b269859b Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Mon, 9 Jan 2006 20:53:01 -0800 Subject: [PATCH] --- yaml --- r: 17622 b: refs/heads/master c: 30420f8f464975f7f26e8195f60569dfed6ac060 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/video/fbsysfs.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f3ccab813e15..af125c46753f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c35dba601728412f67801792107d3dddd1f3ada1 +refs/heads/master: 30420f8f464975f7f26e8195f60569dfed6ac060 diff --git a/trunk/drivers/video/fbsysfs.c b/trunk/drivers/video/fbsysfs.c index 08dac9580d15..0a1dc1b4b509 100644 --- a/trunk/drivers/video/fbsysfs.c +++ b/trunk/drivers/video/fbsysfs.c @@ -492,6 +492,28 @@ static ssize_t show_name(struct class_device *class_device, char *buf) return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); } +static ssize_t store_fbstate(struct class_device *class_device, + const char *buf, size_t count) +{ + struct fb_info *fb_info = class_get_devdata(class_device); + u32 state; + char *last = NULL; + + state = simple_strtoul(buf, &last, 0); + + acquire_console_sem(); + fb_set_suspend(fb_info, (int)state); + release_console_sem(); + + return count; +} + +static ssize_t show_fbstate(struct class_device *class_device, char *buf) +{ + struct fb_info *fb_info = class_get_devdata(class_device); + return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state); +} + static struct class_device_attribute class_device_attrs[] = { __ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp), __ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank), @@ -507,6 +529,7 @@ static struct class_device_attribute class_device_attrs[] = { __ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate), __ATTR(con_rotate, S_IRUGO|S_IWUSR, show_con_rotate, store_con_rotate), __ATTR(con_rotate_all, S_IWUSR, NULL, store_con_rotate_all), + __ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate), }; int fb_init_class_device(struct fb_info *fb_info)