Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232366
b: refs/heads/master
c: 5dc1365
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Paul Mundt committed Jan 25, 2011
1 parent b7134e2 commit f99f95f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e88e43b0c564864c883103483bad6219f77dfb52
refs/heads/master: 5dc1365cefb6bd8770d54a2154097445c30fe4bc
58 changes: 33 additions & 25 deletions trunk/drivers/video/bf537-lq035.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)
{
struct backlight_properties props;
dma_addr_t dma_handle;
int ret;

if (request_dma(CH_PPI, KBUILD_MODNAME)) {
pr_err("couldn't request PPI DMA\n");
Expand All @@ -704,17 +705,16 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)

if (request_ports()) {
pr_err("couldn't request gpio port\n");
free_dma(CH_PPI);
return -EFAULT;
ret = -EFAULT;
goto out_ports;
}

fb_buffer = dma_alloc_coherent(NULL, TOTAL_VIDEO_MEM_SIZE,
&dma_handle, GFP_KERNEL);
if (fb_buffer == NULL) {
pr_err("couldn't allocate dma buffer\n");
free_dma(CH_PPI);
free_ports();
return -ENOMEM;
ret = -ENOMEM;
goto out_dma_coherent;
}

if (L1_DATA_A_LENGTH)
Expand All @@ -725,10 +725,8 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)

if (dma_desc_table == NULL) {
pr_err("couldn't allocate dma descriptor\n");
free_dma(CH_PPI);
free_ports();
dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
return -ENOMEM;
ret = -ENOMEM;
goto out_table;
}

bfin_lq035_fb.screen_base = (void *)fb_buffer;
Expand Down Expand Up @@ -771,31 +769,21 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)
bfin_lq035_fb.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL);
if (bfin_lq035_fb.pseudo_palette == NULL) {
pr_err("failed to allocate pseudo_palette\n");
free_dma(CH_PPI);
free_ports();
dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
return -ENOMEM;
ret = -ENOMEM;
goto out_palette;
}

if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) {
pr_err("failed to allocate colormap (%d entries)\n",
NBR_PALETTE);
free_dma(CH_PPI);
free_ports();
dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
kfree(bfin_lq035_fb.pseudo_palette);
return -EFAULT;
ret = -EFAULT;
goto out_cmap;
}

if (register_framebuffer(&bfin_lq035_fb) < 0) {
pr_err("unable to register framebuffer\n");
free_dma(CH_PPI);
free_ports();
dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
fb_buffer = NULL;
kfree(bfin_lq035_fb.pseudo_palette);
fb_dealloc_cmap(&bfin_lq035_fb.cmap);
return -EINVAL;
ret = -EINVAL;
goto out_reg;
}

i2c_add_driver(&ad5280_driver);
Expand All @@ -807,11 +795,31 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)

lcd_dev = lcd_device_register(KBUILD_MODNAME, &pdev->dev, NULL,
&bfin_lcd_ops);
if (IS_ERR(lcd_dev)) {
pr_err("unable to register lcd\n");
ret = PTR_ERR(lcd_dev);
goto out_lcd;
}
lcd_dev->props.max_contrast = 255,

pr_info("initialized");

return 0;
out_lcd:
unregister_framebuffer(&bfin_lq035_fb);
out_reg:
fb_dealloc_cmap(&bfin_lq035_fb.cmap);
out_cmap:
kfree(bfin_lq035_fb.pseudo_palette);
out_palette:
out_table:
dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
fb_buffer = NULL;
out_dma_coherent:
free_ports();
out_ports:
free_dma(CH_PPI);
return ret;
}

static int __devexit bfin_lq035_remove(struct platform_device *pdev)
Expand Down

0 comments on commit f99f95f

Please sign in to comment.