]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/hecubafb.c
Merge branches 'release', 'bugzilla-8570', 'bugzilla-9966', 'bugzilla-9998', 'bugzill...
[linux-2.6-omap-h63xx.git] / drivers / video / hecubafb.c
index 396dc277ab51cdfe2eabe007de01561816dc1a93..94e0df8a6f60bc9b80d05586b1337fad1006cc47 100644 (file)
@@ -45,7 +45,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/list.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 /* Apollo controller specific defines */
 #define APOLLO_START_NEW_IMG   0xA0
@@ -145,7 +145,7 @@ static int __devinit apollo_init_control(struct hecubafb_par *par)
        return 0;
 }
 
-void hcb_wait_for_ack(struct hecubafb_par *par)
+static void hcb_wait_for_ack(struct hecubafb_par *par)
 {
 
        int timeout;
@@ -161,7 +161,7 @@ void hcb_wait_for_ack(struct hecubafb_par *par)
        printk(KERN_ERR "timed out waiting for ack\n");
 }
 
-void hcb_wait_for_ack_clear(struct hecubafb_par *par)
+static void hcb_wait_for_ack_clear(struct hecubafb_par *par)
 {
 
        int timeout;
@@ -177,7 +177,7 @@ void hcb_wait_for_ack_clear(struct hecubafb_par *par)
        printk(KERN_ERR "timed out waiting for clear\n");
 }
 
-void apollo_send_data(struct hecubafb_par *par, unsigned char data)
+static void apollo_send_data(struct hecubafb_par *par, unsigned char data)
 {
        /* set data */
        hcb_set_data(par, data);
@@ -195,7 +195,7 @@ void apollo_send_data(struct hecubafb_par *par, unsigned char data)
        hcb_wait_for_ack_clear(par);
 }
 
-void apollo_send_command(struct hecubafb_par *par, unsigned char data)
+static void apollo_send_command(struct hecubafb_par *par, unsigned char data)
 {
        /* command so set CD to high */
        par->ctl &= ~(HCB_NCD_BIT);
@@ -214,7 +214,7 @@ void apollo_send_command(struct hecubafb_par *par, unsigned char data)
 static void hecubafb_dpy_update(struct hecubafb_par *par)
 {
        int i;
-       unsigned char *buf = par->info->screen_base;
+       unsigned char *buf = (unsigned char __force *)par->info->screen_base;
 
        apollo_send_command(par, 0xA0);
 
@@ -238,7 +238,7 @@ static void hecubafb_fillrect(struct fb_info *info,
 {
        struct hecubafb_par *par = info->par;
 
-       cfb_fillrect(info, rect);
+       sys_fillrect(info, rect);
 
        hecubafb_dpy_update(par);
 }
@@ -248,7 +248,7 @@ static void hecubafb_copyarea(struct fb_info *info,
 {
        struct hecubafb_par *par = info->par;
 
-       cfb_copyarea(info, area);
+       sys_copyarea(info, area);
 
        hecubafb_dpy_update(par);
 }
@@ -258,7 +258,7 @@ static void hecubafb_imageblit(struct fb_info *info,
 {
        struct hecubafb_par *par = info->par;
 
-       cfb_imageblit(info, image);
+       sys_imageblit(info, image);
 
        hecubafb_dpy_update(par);
 }
@@ -267,12 +267,9 @@ static void hecubafb_imageblit(struct fb_info *info,
  * this is the slow path from userspace. they can seek and write to
  * the fb. it's inefficient to do anything less than a full screen draw
  */
-static ssize_t hecubafb_write(struct file *file, const char __user *buf,
+static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf,
                                size_t count, loff_t *ppos)
 {
-       struct inode *inode;
-       int fbidx;
-       struct fb_info *info;
        unsigned long p;
        int err=-EINVAL;
        struct hecubafb_par *par;
@@ -280,13 +277,6 @@ static ssize_t hecubafb_write(struct file *file, const char __user *buf,
        unsigned int fbmemlength;
 
        p = *ppos;
-       inode = file->f_dentry->d_inode;
-       fbidx = iminor(inode);
-       info = registered_fb[fbidx];
-
-       if (!info || !info->screen_base)
-               return -ENODEV;
-
        par = info->par;
        xres = info->var.xres;
        fbmemlength = (xres * info->var.yres)/8;
@@ -303,7 +293,7 @@ static ssize_t hecubafb_write(struct file *file, const char __user *buf,
        if (count) {
                char *base_addr;
 
-               base_addr = info->screen_base;
+               base_addr = (char __force *)info->screen_base;
                count -= copy_from_user(base_addr + p, buf, count);
                *ppos += count;
                err = -EFAULT;
@@ -319,6 +309,7 @@ static ssize_t hecubafb_write(struct file *file, const char __user *buf,
 
 static struct fb_ops hecubafb_ops = {
        .owner          = THIS_MODULE,
+       .fb_read        = fb_sys_read,
        .fb_write       = hecubafb_write,
        .fb_fillrect    = hecubafb_fillrect,
        .fb_copyarea    = hecubafb_copyarea,
@@ -409,7 +400,7 @@ static int __devexit hecubafb_remove(struct platform_device *dev)
        if (info) {
                fb_deferred_io_cleanup(info);
                unregister_framebuffer(info);
-               vfree(info->screen_base);
+               vfree((void __force *)info->screen_base);
                framebuffer_release(info);
        }
        return 0;