X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Fepson1355fb.c;h=33be46ccb54f6fd1b0f69b74e1b0331f7fa59dc3;hb=40b42f1ebf653cd72c32eb1a1a0b9fea2dfbfd7d;hp=29e07c1098876997db774ae77572a1e9d649c175;hpb=eb991b39385c7b04923d701764a34694ec54b53d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c index 29e07c10988..33be46ccb54 100644 --- a/drivers/video/epson1355fb.c +++ b/drivers/video/epson1355fb.c @@ -63,23 +63,12 @@ struct epson1355_par { unsigned long reg_addr; + u32 pseudo_palette[16]; }; /* ------------------------------------------------------------------------- */ -#ifdef CONFIG_SUPERH - -static inline u8 epson1355_read_reg(int index) -{ - return ctrl_inb(par.reg_addr + index); -} - -static inline void epson1355_write_reg(u8 data, int index) -{ - ctrl_outb(data, par.reg_addr + index); -} - -#elif defined(CONFIG_ARM) +#if defined(CONFIG_ARM) # ifdef CONFIG_ARCH_CEIVA # include @@ -289,7 +278,7 @@ static int epson1355fb_blank(int blank_mode, struct fb_info *info) struct epson1355_par *par = info->par; switch (blank_mode) { - case FB_BLANK_UNBLANKING: + case FB_BLANK_UNBLANK: case FB_BLANK_NORMAL: lcd_enable(par, 1); backlight_enable(1); @@ -403,17 +392,10 @@ 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) +epson1355fb_read(struct fb_info *info, char *buf, size_t count, loff_t * ppos) { - struct inode *inode = file->f_path.dentry->d_inode; - int fbidx = iminor(inode); - struct fb_info *info = registered_fb[fbidx]; unsigned long p = *ppos; - /* from fbmem.c except for our own copy_*_user */ - if (!info || !info->screen_base) - return -ENODEV; - if (p >= info->fix.smem_len) return 0; if (count >= info->fix.smem_len) @@ -434,19 +416,12 @@ epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos) } static ssize_t -epson1355fb_write(struct file *file, const char *buf, +epson1355fb_write(struct fb_info *info, const char *buf, size_t count, loff_t * ppos) { - struct inode *inode = file->f_path.dentry->d_inode; - int fbidx = iminor(inode); - struct fb_info *info = registered_fb[fbidx]; unsigned long p = *ppos; int err; - /* from fbmem.c except for our own copy_*_user */ - if (!info || !info->screen_base) - return -ENODEV; - /* from fbmem.c except for our own copy_*_user */ if (p > info->fix.smem_len) return -ENOSPC; @@ -649,10 +624,11 @@ int __init epson1355fb_probe(struct platform_device *dev) goto bail; } - info = framebuffer_alloc(sizeof(struct epson1355_par) + sizeof(u32) * 256, &dev->dev); - if (!info) + info = framebuffer_alloc(sizeof(struct epson1355_par), &dev->dev); + if (!info) { rc = -ENOMEM; goto bail; + } default_par = info->par; default_par->reg_addr = (unsigned long) ioremap(EPSON1355FB_REGS_PHYS, EPSON1355FB_REGS_LEN); @@ -661,7 +637,7 @@ int __init epson1355fb_probe(struct platform_device *dev) rc = -ENOMEM; goto bail; } - info->pseudo_palette = (void *)(default_par + 1); + info->pseudo_palette = default_par->pseudo_palette; info->screen_base = ioremap(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN); if (!info->screen_base) {