Patchwork [U-Boot] video: update the Freescale DIU driver to use linux/fb.h

login
register
mail settings
Submitter Timur Tabi
Date Aug. 22, 2011, 3:54 p.m.
Message ID <1314028442-9600-1-git-send-email-timur@freescale.com>
Download mbox | patch
Permalink /patch/110951/
State Accepted
Commit 8c6b25046d506d8bbde10cb89f63247f9e78b48c
Delegated to: Anatolij Gustschin
Headers show

Comments

Timur Tabi - Aug. 22, 2011, 3:54 p.m.
Update the Freescale DIU video driver (fsl_diu_fb.c) to use linux/fb.h.
Some data structures from this header file were just copied into
fsl_diu_fb.c.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 drivers/video/fsl_diu_fb.c |   54 ++++---------------------------------------
 1 files changed, 5 insertions(+), 49 deletions(-)
Anatolij Gustschin - Oct. 1, 2011, 8:21 p.m.
On Mon, 22 Aug 2011 10:54:02 -0500
Timur Tabi <timur@freescale.com> wrote:

> Update the Freescale DIU video driver (fsl_diu_fb.c) to use linux/fb.h.
> Some data structures from this header file were just copied into
> fsl_diu_fb.c.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>  drivers/video/fsl_diu_fb.c |   54 ++++---------------------------------------
>  1 files changed, 5 insertions(+), 49 deletions(-)

Applied, thanks.

Anatolij

Patch

diff --git a/drivers/video/fsl_diu_fb.c b/drivers/video/fsl_diu_fb.c
index e1d6c26..cb43904 100644
--- a/drivers/video/fsl_diu_fb.c
+++ b/drivers/video/fsl_diu_fb.c
@@ -31,52 +31,8 @@ 
 #include "videomodes.h"
 #include <video_fb.h>
 #include <fsl_diu_fb.h>
-
-struct fb_var_screeninfo {
-	unsigned int xres;		/* visible resolution		*/
-	unsigned int yres;
-
-	unsigned int bits_per_pixel;	/* guess what			*/
-
-	/* Timing: All values in pixclocks, except pixclock (of course) */
-	unsigned int pixclock;		/* pixel clock in ps (pico seconds) */
-	unsigned int left_margin;	/* time from sync to picture	*/
-	unsigned int right_margin;	/* time from picture to sync	*/
-	unsigned int upper_margin;	/* time from sync to picture	*/
-	unsigned int lower_margin;
-	unsigned int hsync_len;		/* length of horizontal sync	*/
-	unsigned int vsync_len;		/* length of vertical sync	*/
-	unsigned int sync;		/* see FB_SYNC_*		*/
-	unsigned int vmode;		/* see FB_VMODE_*		*/
-	unsigned int rotate;		/* angle we rotate counter clockwise */
-};
-
-struct fb_info {
-	struct fb_var_screeninfo var;	/* Current var */
-	unsigned int smem_len;		/* Length of frame buffer mem */
-	unsigned int type;		/* see FB_TYPE_*		*/
-	unsigned int line_length;	/* length of a line in bytes    */
-
-	void *screen_base;
-	unsigned long screen_size;
-};
-
-struct fb_videomode {
-	const char *name;	/* optional */
-	unsigned int refresh;		/* optional */
-	unsigned int xres;
-	unsigned int yres;
-	unsigned int pixclock;
-	unsigned int left_margin;
-	unsigned int right_margin;
-	unsigned int upper_margin;
-	unsigned int lower_margin;
-	unsigned int hsync_len;
-	unsigned int vsync_len;
-	unsigned int sync;
-	unsigned int vmode;
-	unsigned int flag;
-};
+#include <linux/list.h>
+#include <linux/fb.h>
 
 /* This setting is used for the ifm pdm360ng with PRIMEVIEW PM070WL3 */
 static struct fb_videomode fsl_diu_mode_800_480 = {
@@ -248,7 +204,7 @@  static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
  * point to the framebuffer memory. Memory is aligned as needed.
  */
 static struct diu_ad *allocate_fb(unsigned int xres, unsigned int yres,
-				  unsigned int depth, void **fb)
+				  unsigned int depth, char **fb)
 {
 	unsigned long size = xres * yres * depth;
 	struct diu_addr addr;
@@ -327,10 +283,10 @@  int fsl_diu_init(u16 xres, u16 yres, u32 pixel_format, int gamma_fix)
 	info.var.vsync_len = fsl_diu_mode_db->vsync_len;
 	info.var.sync = fsl_diu_mode_db->sync;
 	info.var.vmode = fsl_diu_mode_db->vmode;
-	info.line_length = info.var.xres * info.var.bits_per_pixel / 8;
+	info.fix.line_length = info.var.xres * info.var.bits_per_pixel / 8;
 
 	/* Memory allocation for framebuffer */
-	info.smem_len =
+	info.screen_size =
 		info.var.xres * info.var.yres * (info.var.bits_per_pixel / 8);
 	ad = allocate_fb(info.var.xres, info.var.yres,
 			 info.var.bits_per_pixel / 8, &info.screen_base);