Thread (3 messages) 3 messages, 2 authors, 2009-07-10

Re: [PATCH] davinci: fb: Frame Buffer driver for TI DA8xx/OMAP-L1xx

From: Sudhakar Rajashekhara <hidden>
Date: 2009-07-10 07:25:53

On Fri, Jul 10, 2009 at 12:01:23, Andrey Panin wrote:
On 191, 07 10, 2009 at 01:19:34AM -0400, Sudhakar Rajashekhara wrote:
quoted
Adds LCD controller (LCDC) driver for TI's DA8xx/OMAP-L1xx
architecture. LCDC specifications can be found at
http://www.ti.com/litv/pdf/sprufm0a.

LCDC on DA8xx consists of two independent controllers, the
Raster Controller and the LCD Interface Display Driver (LIDD)
controller. LIDD further supports character and graphic displays.

This patch adds support for the graphic display (Sharp LQ035Q3DG01)
found on the DA830 based EVM. The EVM details can be found at:
http://support.spectrumdigital.com/boards/dskda830/revc/.

Signed-off-by: Sudhakar Rajashekhara <redacted>
Signed-off-by: Pavel Kiryukhin <redacted>
Signed-off-by: Steve Chen <redacted>
Acked-by: Krzysztof Helt <redacted>
---
 This patch applies to Linus's Kernel tree.

<SNIP>
quoted
+static int __init fb_probe(struct platform_device *device)
+{
+	struct da8xx_lcdc_platform_data *fb_pdata =
+						device->dev.platform_data;
+	struct lcd_ctrl_config *lcd_cfg;
+	struct da8xx_panel *lcdc_info;
+	struct fb_info *da8xx_fb_info;
+	struct resource *lcdc_regs;
+	struct clk *fb_clk = NULL;
+	struct da8xx_fb_par *par;
+	resource_size_t len;
+	int ret, i;
+
+	if (fb_pdata == NULL) {
+		dev_err(&device->dev, "Can not get platform data\n");
+		return -ENOENT;
+	}
+
+	lcdc_regs = platform_get_resource(device, IORESOURCE_MEM, 0);
+	if (!lcdc_regs) {
+		dev_err(&device->dev,
+			"Can not get memory resource for LCD controller\n");
+		return -ENOENT;
+	}
+
+	len = lcdc_regs->end - lcdc_regs->start + 1;
+
+	lcdc_regs = request_mem_region(lcdc_regs->start, len, lcdc_regs->name);
+	if (!lcdc_regs)
+		return -EBUSY;
+
+	da8xx_fb_reg_base = (resource_size_t)ioremap(lcdc_regs->start, len);
1. ioremap() can return NULL, so check is needed here;
2. ioremapped region is leaked in case of error and on module unload too.
Agreed. Will add checks and submit an updated version of the patch.

Thanks,
Sudhakar



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help