X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Fepson1355fb.c;h=29e07c1098876997db774ae77572a1e9d649c175;hb=refs%2Fheads%2Fvserver;hp=6cb54f809cd396d4f0bb158d6701fb430f7fc7b7;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c index 6cb54f809..29e07c109 100644 --- a/drivers/video/epson1355fb.c +++ b/drivers/video/epson1355fb.c @@ -48,12 +48,13 @@ #include #include #include -#include #include #include #include #include #include +#include + #include #include #include @@ -288,22 +289,25 @@ static int epson1355fb_blank(int blank_mode, struct fb_info *info) struct epson1355_par *par = info->par; switch (blank_mode) { - case VESA_NO_BLANKING: + case FB_BLANK_UNBLANKING: + case FB_BLANK_NORMAL: lcd_enable(par, 1); backlight_enable(1); break; - case VESA_VSYNC_SUSPEND: - case VESA_HSYNC_SUSPEND: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: backlight_enable(0); break; - case VESA_POWERDOWN: + case FB_BLANK_POWERDOWN: backlight_enable(0); lcd_enable(par, 0); break; default: return -EINVAL; } - return 0; + + /* let fbcon do a soft blank for us */ + return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0; } /* ------------------------------------------------------------------------- */ @@ -401,7 +405,7 @@ static inline unsigned long copy_to_user16(void *to, const void *from, static ssize_t epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos) { - struct inode *inode = file->f_dentry->d_inode; + struct inode *inode = file->f_path.dentry->d_inode; int fbidx = iminor(inode); struct fb_info *info = registered_fb[fbidx]; unsigned long p = *ppos; @@ -433,7 +437,7 @@ static ssize_t epson1355fb_write(struct file *file, const char *buf, size_t count, loff_t * ppos) { - struct inode *inode = file->f_dentry->d_inode; + struct inode *inode = file->f_path.dentry->d_inode; int fbidx = iminor(inode); struct fb_info *info = registered_fb[fbidx]; unsigned long p = *ppos; @@ -479,7 +483,6 @@ static struct fb_ops epson1355fb_fbops = { .fb_imageblit = cfb_imageblit, .fb_read = epson1355fb_read, .fb_write = epson1355fb_write, - .fb_cursor = soft_cursor, }; /* ------------------------------------------------------------------------- */ @@ -601,13 +604,9 @@ static void clearfb16(struct fb_info *info) fb_writeb(0, dst); } -static void epson1355fb_platform_release(struct device *device) -{ -} - -static int epson1355fb_remove(struct device *device) +static int epson1355fb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(device); + struct fb_info *info = platform_get_drvdata(dev); struct epson1355_par *par = info->par; backlight_enable(0); @@ -628,9 +627,8 @@ static int epson1355fb_remove(struct device *device) return 0; } -int __init epson1355fb_probe(struct device *device) +int __init epson1355fb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct epson1355_par *default_par; struct fb_info *info; u8 revision; @@ -709,7 +707,7 @@ int __init epson1355fb_probe(struct device *device) /* * Our driver data. */ - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); @@ -717,24 +715,19 @@ int __init epson1355fb_probe(struct device *device) return 0; bail: - epson1355fb_remove(device); + epson1355fb_remove(dev); return rc; } -static struct device_driver epson1355fb_driver = { - .name = "epson1355fb", - .bus = &platform_bus_type, +static struct platform_driver epson1355fb_driver = { .probe = epson1355fb_probe, .remove = epson1355fb_remove, + .driver = { + .name = "epson1355fb", + }, }; -static struct platform_device epson1355fb_device = { - .name = "epson1355fb", - .id = 0, - .dev = { - .release = epson1355fb_platform_release, - } -}; +static struct platform_device *epson1355fb_device; int __init epson1355fb_init(void) { @@ -743,12 +736,22 @@ int __init epson1355fb_init(void) if (fb_get_options("epson1355fb", NULL)) return -ENODEV; - ret = driver_register(&epson1355fb_driver); + ret = platform_driver_register(&epson1355fb_driver); + if (!ret) { - ret = platform_device_register(&epson1355fb_device); - if (ret) - driver_unregister(&epson1355fb_driver); + epson1355fb_device = platform_device_alloc("epson1355fb", 0); + + if (epson1355fb_device) + ret = platform_device_add(epson1355fb_device); + else + ret = -ENOMEM; + + if (ret) { + platform_device_put(epson1355fb_device); + platform_driver_unregister(&epson1355fb_driver); + } } + return ret; } @@ -757,8 +760,8 @@ module_init(epson1355fb_init); #ifdef MODULE static void __exit epson1355fb_exit(void) { - platform_device_unregister(&epson1355fb_device); - driver_unregister(&epson1355fb_driver); + platform_device_unregister(epson1355fb_device); + platform_driver_unregister(&epson1355fb_driver); } /* ------------------------------------------------------------------------- */