From patchwork Mon Aug 22 15:54:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 110951 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8B8AFB6F64 for ; Tue, 23 Aug 2011 01:54:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C830E28080; Mon, 22 Aug 2011 17:54:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a-i6YhwVP728; Mon, 22 Aug 2011 17:54:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 425FF28078; Mon, 22 Aug 2011 17:54:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA1CC28078 for ; Mon, 22 Aug 2011 17:54:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 44oXKQ29hP2y for ; Mon, 22 Aug 2011 17:54:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe003.messaging.microsoft.com [216.32.181.183]) by theia.denx.de (Postfix) with ESMTPS id CC04228077 for ; Mon, 22 Aug 2011 17:54:09 +0200 (CEST) Received: from mail116-ch1-R.bigfish.com (216.32.181.171) by CH1EHSOBE001.bigfish.com (10.43.70.51) with Microsoft SMTP Server id 14.1.225.22; Mon, 22 Aug 2011 15:54:05 +0000 Received: from mail116-ch1 (localhost.localdomain [127.0.0.1]) by mail116-ch1-R.bigfish.com (Postfix) with ESMTP id 9C04C3D0174; Mon, 22 Aug 2011 15:54:05 +0000 (UTC) X-SpamScore: -5 X-BigFish: VS-5(zz1803Mzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail116-ch1 (localhost.localdomain [127.0.0.1]) by mail116-ch1 (MessageSwitch) id 1314028445413871_15568; Mon, 22 Aug 2011 15:54:05 +0000 (UTC) Received: from CH1EHSMHS020.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail116-ch1.bigfish.com (Postfix) with ESMTP id 5FD3A18E0052; Mon, 22 Aug 2011 15:54:05 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS020.bigfish.com (10.43.70.20) with Microsoft SMTP Server (TLS) id 14.1.225.22; Mon, 22 Aug 2011 15:54:05 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.323.2; Mon, 22 Aug 2011 10:54:04 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p7MFs3WA014947; Mon, 22 Aug 2011 10:54:03 -0500 (CDT) From: Timur Tabi To: , Date: Mon, 22 Aug 2011 10:54:02 -0500 Message-ID: <1314028442-9600-1-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] video: update the Freescale DIU driver to use linux/fb.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- drivers/video/fsl_diu_fb.c | 54 ++++--------------------------------------- 1 files changed, 5 insertions(+), 49 deletions(-) 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 #include - -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 +#include /* 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);