Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87904
b: refs/heads/master
c: 7ef9861
h: refs/heads/master
v: v3
  • Loading branch information
Bryan Wu authored and Linus Torvalds committed Mar 28, 2008
1 parent 6362216 commit c2d8c6d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 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: a99acc832de1104afaba02d7c2576fd9b9fd6422
refs/heads/master: 7ef9861c7496185e96fb0a3b57ff0b4880876d0a
36 changes: 14 additions & 22 deletions trunk/drivers/video/bfin-t350mcqb-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct bfin_t350mcqbfb_info {
int lq043_open_cnt;
int irq;
spinlock_t lock; /* lock */
u32 pseudo_pal[16];
};

static int nocursor;
Expand Down Expand Up @@ -182,13 +183,13 @@ static void bfin_t350mcqb_config_dma(struct bfin_t350mcqbfb_info *fbi)

}

static int bfin_t350mcqb_request_ports(int action)
{
u16 ppi0_req_8[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
static u16 ppi0_req_8[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
P_PPI0_D0, P_PPI0_D1, P_PPI0_D2,
P_PPI0_D3, P_PPI0_D4, P_PPI0_D5,
P_PPI0_D6, P_PPI0_D7, 0};

static int bfin_t350mcqb_request_ports(int action)
{
if (action) {
if (peripheral_request_list(ppi0_req_8, DRIVER_NAME)) {
printk(KERN_ERR "Requesting Peripherals faild\n");
Expand Down Expand Up @@ -520,24 +521,15 @@ static int __init bfin_t350mcqb_probe(struct platform_device *pdev)

fbinfo->fbops = &bfin_t350mcqb_fb_ops;

fbinfo->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL);
if (!fbinfo->pseudo_palette) {
printk(KERN_ERR DRIVER_NAME
"Fail to allocate pseudo_palette\n");

ret = -ENOMEM;
goto out4;
}

memset(fbinfo->pseudo_palette, 0, sizeof(u32) * 16);
fbinfo->pseudo_palette = &info->pseudo_pal;

if (fb_alloc_cmap(&fbinfo->cmap, BFIN_LCD_NBR_PALETTE_ENTRIES, 0)
< 0) {
printk(KERN_ERR DRIVER_NAME
"Fail to allocate colormap (%d entries)\n",
BFIN_LCD_NBR_PALETTE_ENTRIES);
ret = -EFAULT;
goto out5;
goto out4;
}

if (bfin_t350mcqb_request_ports(1)) {
Expand All @@ -552,11 +544,11 @@ static int __init bfin_t350mcqb_probe(struct platform_device *pdev)
goto out7;
}

if (request_irq(info->irq, (void *)bfin_t350mcqb_irq_error, IRQF_DISABLED,
"PPI ERROR", info) < 0) {
ret = request_irq(info->irq, bfin_t350mcqb_irq_error, IRQF_DISABLED,
"PPI ERROR", info);
if (ret < 0) {
printk(KERN_ERR DRIVER_NAME
": unable to request PPI ERROR IRQ\n");
ret = -EFAULT;
goto out7;
}

Expand Down Expand Up @@ -584,8 +576,6 @@ static int __init bfin_t350mcqb_probe(struct platform_device *pdev)
bfin_t350mcqb_request_ports(0);
out6:
fb_dealloc_cmap(&fbinfo->cmap);
out5:
kfree(fbinfo->pseudo_palette);
out4:
dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
info->dma_handle);
Expand All @@ -605,25 +595,27 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev)
struct fb_info *fbinfo = platform_get_drvdata(pdev);
struct bfin_t350mcqbfb_info *info = fbinfo->par;

unregister_framebuffer(fbinfo);

free_dma(CH_PPI);
free_irq(info->irq, info);

if (info->fb_buffer != NULL)
dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
info->dma_handle);

kfree(fbinfo->pseudo_palette);
fb_dealloc_cmap(&fbinfo->cmap);

#ifndef NO_BL_SUPPORT
lcd_device_unregister(lcd_dev);
backlight_device_unregister(bl_dev);
#endif

unregister_framebuffer(fbinfo);

bfin_t350mcqb_request_ports(0);

platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo);

printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n");

return 0;
Expand Down

0 comments on commit c2d8c6d

Please sign in to comment.