diff options
author | Michel von Czettritz <michel.von.czettritz@gmail.com> | 2015-03-26 18:25:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-03 07:39:32 -0400 |
commit | 5ace4e10c1cf7c8e9069b1299582899a61c9994f (patch) | |
tree | 223361d0455d9741f994672b692564108e74ccbe | |
parent | 70407df77665c0e6bb6f6dea5e1561670fbadf18 (diff) |
staging: sm750: fix whitespace around braces
Fix multiple similar checkpatch.pl errors:
- "ERROR: space required before the open parenthesis '('"
- "ERROR: space required before the open brace '{'"
- "ERROR: space prohibited after that open parenthesis '('"
- "ERROR: space prohibited before that close parenthesis ')'"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/sm750fb/sm750.c | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index bc2986d9fee6..6d148a550d12 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c | |||
@@ -39,9 +39,9 @@ int smi_indent = 0; | |||
39 | * #endif | 39 | * #endif |
40 | */ | 40 | */ |
41 | 41 | ||
42 | typedef void (*PROC_SPEC_SETUP)(struct lynx_share*,char *); | 42 | typedef void (*PROC_SPEC_SETUP)(struct lynx_share*, char *); |
43 | typedef int (*PROC_SPEC_MAP)(struct lynx_share*,struct pci_dev*); | 43 | typedef int (*PROC_SPEC_MAP)(struct lynx_share*, struct pci_dev*); |
44 | typedef int (*PROC_SPEC_INITHW)(struct lynx_share*,struct pci_dev*); | 44 | typedef int (*PROC_SPEC_INITHW)(struct lynx_share*, struct pci_dev*); |
45 | 45 | ||
46 | 46 | ||
47 | /* common var for all device */ | 47 | /* common var for all device */ |
@@ -123,23 +123,23 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor) | |||
123 | crtc = &par->crtc; | 123 | crtc = &par->crtc; |
124 | cursor = &crtc->cursor; | 124 | cursor = &crtc->cursor; |
125 | 125 | ||
126 | if(fbcursor->image.width > cursor->maxW || | 126 | if (fbcursor->image.width > cursor->maxW || |
127 | fbcursor->image.height > cursor->maxH || | 127 | fbcursor->image.height > cursor->maxH || |
128 | fbcursor->image.depth > 1){ | 128 | fbcursor->image.depth > 1) { |
129 | return -ENXIO; | 129 | return -ENXIO; |
130 | } | 130 | } |
131 | 131 | ||
132 | cursor->disable(cursor); | 132 | cursor->disable(cursor); |
133 | if(fbcursor->set & FB_CUR_SETSIZE){ | 133 | if (fbcursor->set & FB_CUR_SETSIZE) { |
134 | cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height); | 134 | cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height); |
135 | } | 135 | } |
136 | 136 | ||
137 | if(fbcursor->set & FB_CUR_SETPOS){ | 137 | if (fbcursor->set & FB_CUR_SETPOS) { |
138 | cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset, | 138 | cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset, |
139 | fbcursor->image.dy - info->var.yoffset); | 139 | fbcursor->image.dy - info->var.yoffset); |
140 | } | 140 | } |
141 | 141 | ||
142 | if(fbcursor->set & FB_CUR_SETCMAP){ | 142 | if (fbcursor->set & FB_CUR_SETCMAP) { |
143 | /* get the 16bit color of kernel means */ | 143 | /* get the 16bit color of kernel means */ |
144 | u16 fg, bg; | 144 | u16 fg, bg; |
145 | fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))| | 145 | fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))| |
@@ -154,14 +154,14 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | 156 | ||
157 | if(fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { | 157 | if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { |
158 | cursor->setData(cursor, | 158 | cursor->setData(cursor, |
159 | fbcursor->rop, | 159 | fbcursor->rop, |
160 | fbcursor->image.data, | 160 | fbcursor->image.data, |
161 | fbcursor->mask); | 161 | fbcursor->mask); |
162 | } | 162 | } |
163 | 163 | ||
164 | if(fbcursor->enable){ | 164 | if (fbcursor->enable) { |
165 | cursor->enable(cursor); | 165 | cursor->enable(cursor); |
166 | } | 166 | } |
167 | 167 | ||
@@ -175,7 +175,7 @@ static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect* | |||
175 | unsigned int base, pitch, Bpp, rop; | 175 | unsigned int base, pitch, Bpp, rop; |
176 | u32 color; | 176 | u32 color; |
177 | 177 | ||
178 | if(info->state != FBINFO_STATE_RUNNING){ | 178 | if (info->state != FBINFO_STATE_RUNNING) { |
179 | return; | 179 | return; |
180 | } | 180 | } |
181 | 181 | ||
@@ -189,7 +189,7 @@ static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect* | |||
189 | Bpp = info->var.bits_per_pixel >> 3; | 189 | Bpp = info->var.bits_per_pixel >> 3; |
190 | 190 | ||
191 | color = (Bpp == 1)?region->color:((u32*)info->pseudo_palette)[region->color]; | 191 | color = (Bpp == 1)?region->color:((u32*)info->pseudo_palette)[region->color]; |
192 | rop = ( region->rop != ROP_COPY ) ? HW_ROP2_XOR:HW_ROP2_COPY; | 192 | rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR:HW_ROP2_COPY; |
193 | 193 | ||
194 | /* | 194 | /* |
195 | * If not use spin_lock,system will die if user load driver | 195 | * If not use spin_lock,system will die if user load driver |
@@ -252,8 +252,8 @@ static void lynxfb_ops_imageblit(struct fb_info*info, const struct fb_image* ima | |||
252 | pitch = info->fix.line_length; | 252 | pitch = info->fix.line_length; |
253 | Bpp = info->var.bits_per_pixel >> 3; | 253 | Bpp = info->var.bits_per_pixel >> 3; |
254 | 254 | ||
255 | if(image->depth == 1){ | 255 | if (image->depth == 1) { |
256 | if(info->fix.visual == FB_VISUAL_TRUECOLOR || | 256 | if (info->fix.visual == FB_VISUAL_TRUECOLOR || |
257 | info->fix.visual == FB_VISUAL_DIRECTCOLOR) { | 257 | info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
258 | fgcol = ((u32*)info->pseudo_palette)[image->fg_color]; | 258 | fgcol = ((u32*)info->pseudo_palette)[image->fg_color]; |
259 | bgcol = ((u32*)info->pseudo_palette)[image->bg_color]; | 259 | bgcol = ((u32*)info->pseudo_palette)[image->bg_color]; |
@@ -290,7 +290,7 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var, | |||
290 | int ret; | 290 | int ret; |
291 | 291 | ||
292 | 292 | ||
293 | if(!info) | 293 | if (!info) |
294 | return -EINVAL; | 294 | return -EINVAL; |
295 | 295 | ||
296 | ret = 0; | 296 | ret = 0; |
@@ -312,7 +312,7 @@ static int lynxfb_ops_set_par(struct fb_info * info) | |||
312 | int ret; | 312 | int ret; |
313 | unsigned int line_length; | 313 | unsigned int line_length; |
314 | 314 | ||
315 | if(!info) | 315 | if (!info) |
316 | return -EINVAL; | 316 | return -EINVAL; |
317 | 317 | ||
318 | ret = 0; | 318 | ret = 0; |
@@ -333,7 +333,7 @@ static int lynxfb_ops_set_par(struct fb_info * info) | |||
333 | * and these data should be set before setcolreg routine | 333 | * and these data should be set before setcolreg routine |
334 | * */ | 334 | * */ |
335 | 335 | ||
336 | switch(var->bits_per_pixel){ | 336 | switch (var->bits_per_pixel) { |
337 | case 8: | 337 | case 8: |
338 | fix->visual = FB_VISUAL_PSEUDOCOLOR; | 338 | fix->visual = FB_VISUAL_PSEUDOCOLOR; |
339 | var->red.offset = 0; | 339 | var->red.offset = 0; |
@@ -373,12 +373,12 @@ static int lynxfb_ops_set_par(struct fb_info * info) | |||
373 | var->height = var->width = -1; | 373 | var->height = var->width = -1; |
374 | var->accel_flags = 0;/*FB_ACCELF_TEXT;*/ | 374 | var->accel_flags = 0;/*FB_ACCELF_TEXT;*/ |
375 | 375 | ||
376 | if(ret){ | 376 | if (ret) { |
377 | pr_err("pixel bpp format not satisfied\n."); | 377 | pr_err("pixel bpp format not satisfied\n."); |
378 | return ret; | 378 | return ret; |
379 | } | 379 | } |
380 | ret = crtc->proc_setMode(crtc, var, fix); | 380 | ret = crtc->proc_setMode(crtc, var, fix); |
381 | if(!ret) | 381 | if (!ret) |
382 | ret = output->proc_setMode(output, var, fix); | 382 | ret = output->proc_setMode(output, var, fix); |
383 | return ret; | 383 | return ret; |
384 | } | 384 | } |
@@ -460,21 +460,21 @@ static int lynxfb_resume(struct pci_dev* pdev) | |||
460 | 460 | ||
461 | console_lock(); | 461 | console_lock(); |
462 | 462 | ||
463 | if((ret = pci_set_power_state(pdev, PCI_D0)) != 0){ | 463 | if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) { |
464 | pr_err("error:%d occured in pci_set_power_state\n", ret); | 464 | pr_err("error:%d occured in pci_set_power_state\n", ret); |
465 | return ret; | 465 | return ret; |
466 | } | 466 | } |
467 | 467 | ||
468 | 468 | ||
469 | if(pdev->dev.power.power_state.event != PM_EVENT_FREEZE){ | 469 | if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) { |
470 | pci_restore_state(pdev); | 470 | pci_restore_state(pdev); |
471 | if ((ret = pci_enable_device(pdev)) != 0){ | 471 | if ((ret = pci_enable_device(pdev)) != 0) { |
472 | pr_err("error:%d occured in pci_enable_device\n", ret); | 472 | pr_err("error:%d occured in pci_enable_device\n", ret); |
473 | return ret; | 473 | return ret; |
474 | } | 474 | } |
475 | pci_set_master(pdev); | 475 | pci_set_master(pdev); |
476 | } | 476 | } |
477 | if(share->resume) | 477 | if (share->resume) |
478 | (*share->resume)(share); | 478 | (*share->resume)(share); |
479 | 479 | ||
480 | hw_sm750_inithw(share, pdev); | 480 | hw_sm750_inithw(share, pdev); |
@@ -482,7 +482,7 @@ static int lynxfb_resume(struct pci_dev* pdev) | |||
482 | 482 | ||
483 | info = share->fbinfo[0]; | 483 | info = share->fbinfo[0]; |
484 | 484 | ||
485 | if(info){ | 485 | if (info) { |
486 | par = info->par; | 486 | par = info->par; |
487 | crtc = &par->crtc; | 487 | crtc = &par->crtc; |
488 | cursor = &crtc->cursor; | 488 | cursor = &crtc->cursor; |
@@ -494,7 +494,7 @@ static int lynxfb_resume(struct pci_dev* pdev) | |||
494 | 494 | ||
495 | info = share->fbinfo[1]; | 495 | info = share->fbinfo[1]; |
496 | 496 | ||
497 | if(info){ | 497 | if (info) { |
498 | par = info->par; | 498 | par = info->par; |
499 | crtc = &par->crtc; | 499 | crtc = &par->crtc; |
500 | cursor = &crtc->cursor; | 500 | cursor = &crtc->cursor; |
@@ -532,7 +532,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i | |||
532 | var->bits_per_pixel); | 532 | var->bits_per_pixel); |
533 | 533 | ||
534 | 534 | ||
535 | switch(var->bits_per_pixel){ | 535 | switch (var->bits_per_pixel) { |
536 | case 8: | 536 | case 8: |
537 | case 16: | 537 | case 16: |
538 | case 24: /* support 24 bpp for only lynx712/722/720 */ | 538 | case 24: /* support 24 bpp for only lynx712/722/720 */ |
@@ -544,7 +544,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i | |||
544 | goto exit; | 544 | goto exit; |
545 | } | 545 | } |
546 | 546 | ||
547 | switch(var->bits_per_pixel){ | 547 | switch (var->bits_per_pixel) { |
548 | case 8: | 548 | case 8: |
549 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 549 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
550 | var->red.offset = 0; | 550 | var->red.offset = 0; |
@@ -590,13 +590,13 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i | |||
590 | 590 | ||
591 | request = PADDING(crtc->line_pad, request); | 591 | request = PADDING(crtc->line_pad, request); |
592 | request = request * var->yres_virtual; | 592 | request = request * var->yres_virtual; |
593 | if(crtc->vidmem_size < request){ | 593 | if (crtc->vidmem_size < request) { |
594 | pr_err("not enough video memory for mode\n"); | 594 | pr_err("not enough video memory for mode\n"); |
595 | return -ENOMEM; | 595 | return -ENOMEM; |
596 | } | 596 | } |
597 | 597 | ||
598 | ret = output->proc_checkMode(output, var); | 598 | ret = output->proc_checkMode(output, var); |
599 | if(!ret) | 599 | if (!ret) |
600 | ret = crtc->proc_checkMode(crtc, var); | 600 | ret = crtc->proc_checkMode(crtc, var); |
601 | exit: | 601 | exit: |
602 | return ret; | 602 | return ret; |
@@ -618,15 +618,15 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red, | |||
618 | ret = 0; | 618 | ret = 0; |
619 | 619 | ||
620 | //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue); | 620 | //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue); |
621 | if(regno > 256){ | 621 | if (regno > 256) { |
622 | pr_err("regno = %d\n", regno); | 622 | pr_err("regno = %d\n", regno); |
623 | return -EINVAL; | 623 | return -EINVAL; |
624 | } | 624 | } |
625 | 625 | ||
626 | if(info->var.grayscale) | 626 | if (info->var.grayscale) |
627 | red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; | 627 | red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; |
628 | 628 | ||
629 | if(var->bits_per_pixel == 8 && info->fix.visual == FB_VISUAL_PSEUDOCOLOR) { | 629 | if (var->bits_per_pixel == 8 && info->fix.visual == FB_VISUAL_PSEUDOCOLOR) { |
630 | red >>= 8; | 630 | red >>= 8; |
631 | green >>= 8; | 631 | green >>= 8; |
632 | blue >>= 8; | 632 | blue >>= 8; |
@@ -635,9 +635,9 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red, | |||
635 | } | 635 | } |
636 | 636 | ||
637 | 637 | ||
638 | if(info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256 ) { | 638 | if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) { |
639 | u32 val; | 639 | u32 val; |
640 | if(var->bits_per_pixel == 16 || | 640 | if (var->bits_per_pixel == 16 || |
641 | var->bits_per_pixel == 32 || | 641 | var->bits_per_pixel == 32 || |
642 | var->bits_per_pixel == 24) { | 642 | var->bits_per_pixel == 24) { |
643 | val = chan_to_field(red, &var->red); | 643 | val = chan_to_field(red, &var->red); |
@@ -717,12 +717,12 @@ static int sm750fb_set_drv(struct lynxfb_par * par) | |||
717 | crtc->vScreen = share->pvMem; | 717 | crtc->vScreen = share->pvMem; |
718 | break; | 718 | break; |
719 | case sm750_dual_normal: | 719 | case sm750_dual_normal: |
720 | if(par->index == 0){ | 720 | if (par->index == 0) { |
721 | output->paths = sm750_panel; | 721 | output->paths = sm750_panel; |
722 | crtc->channel = sm750_primary; | 722 | crtc->channel = sm750_primary; |
723 | crtc->oScreen = 0; | 723 | crtc->oScreen = 0; |
724 | crtc->vScreen = share->pvMem; | 724 | crtc->vScreen = share->pvMem; |
725 | }else{ | 725 | } else { |
726 | output->paths = sm750_crt; | 726 | output->paths = sm750_crt; |
727 | crtc->channel = sm750_secondary; | 727 | crtc->channel = sm750_secondary; |
728 | /* not consider of padding stuffs for oScreen,need fix*/ | 728 | /* not consider of padding stuffs for oScreen,need fix*/ |
@@ -731,12 +731,12 @@ static int sm750fb_set_drv(struct lynxfb_par * par) | |||
731 | } | 731 | } |
732 | break; | 732 | break; |
733 | case sm750_dual_swap: | 733 | case sm750_dual_swap: |
734 | if(par->index == 0){ | 734 | if (par->index == 0) { |
735 | output->paths = sm750_panel; | 735 | output->paths = sm750_panel; |
736 | crtc->channel = sm750_secondary; | 736 | crtc->channel = sm750_secondary; |
737 | crtc->oScreen = 0; | 737 | crtc->oScreen = 0; |
738 | crtc->vScreen = share->pvMem; | 738 | crtc->vScreen = share->pvMem; |
739 | }else{ | 739 | } else { |
740 | output->paths = sm750_crt; | 740 | output->paths = sm750_crt; |
741 | crtc->channel = sm750_primary; | 741 | crtc->channel = sm750_primary; |
742 | /* not consider of padding stuffs for oScreen,need fix*/ | 742 | /* not consider of padding stuffs for oScreen,need fix*/ |
@@ -826,14 +826,14 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index) | |||
826 | 826 | ||
827 | crtc->cursor.share = share; | 827 | crtc->cursor.share = share; |
828 | memset_io(crtc->cursor.vstart, 0, crtc->cursor.size); | 828 | memset_io(crtc->cursor.vstart, 0, crtc->cursor.size); |
829 | if(!g_hwcursor){ | 829 | if (!g_hwcursor) { |
830 | lynxfb_ops.fb_cursor = NULL; | 830 | lynxfb_ops.fb_cursor = NULL; |
831 | crtc->cursor.disable(&crtc->cursor); | 831 | crtc->cursor.disable(&crtc->cursor); |
832 | } | 832 | } |
833 | 833 | ||
834 | 834 | ||
835 | /* set info->fbops, must be set before fb_find_mode */ | 835 | /* set info->fbops, must be set before fb_find_mode */ |
836 | if(!share->accel_off){ | 836 | if (!share->accel_off) { |
837 | /* use 2d acceleration */ | 837 | /* use 2d acceleration */ |
838 | lynxfb_ops.fb_fillrect = lynxfb_ops_fillrect; | 838 | lynxfb_ops.fb_fillrect = lynxfb_ops_fillrect; |
839 | lynxfb_ops.fb_copyarea = lynxfb_ops_copyarea; | 839 | lynxfb_ops.fb_copyarea = lynxfb_ops_copyarea; |
@@ -841,34 +841,34 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index) | |||
841 | } | 841 | } |
842 | info->fbops = &lynxfb_ops; | 842 | info->fbops = &lynxfb_ops; |
843 | 843 | ||
844 | if(!g_fbmode[index]){ | 844 | if (!g_fbmode[index]) { |
845 | g_fbmode[index] = g_def_fbmode; | 845 | g_fbmode[index] = g_def_fbmode; |
846 | if(index) | 846 | if (index) |
847 | g_fbmode[index] = g_fbmode[0]; | 847 | g_fbmode[index] = g_fbmode[0]; |
848 | } | 848 | } |
849 | 849 | ||
850 | 850 | ||
851 | for(i=0;i<3;i++){ | 851 | for (i=0;i<3;i++) { |
852 | 852 | ||
853 | ret = fb_find_mode(var, info, g_fbmode[index], | 853 | ret = fb_find_mode(var, info, g_fbmode[index], |
854 | pdb[i], cdb[i], NULL, 8); | 854 | pdb[i], cdb[i], NULL, 8); |
855 | 855 | ||
856 | if(ret == 1){ | 856 | if (ret == 1) { |
857 | pr_info("success! use specified mode:%s in %s\n", | 857 | pr_info("success! use specified mode:%s in %s\n", |
858 | g_fbmode[index], | 858 | g_fbmode[index], |
859 | mdb_desc[i]); | 859 | mdb_desc[i]); |
860 | break; | 860 | break; |
861 | }else if(ret == 2){ | 861 | } else if (ret == 2) { |
862 | pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n", | 862 | pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n", |
863 | g_fbmode[index], | 863 | g_fbmode[index], |
864 | mdb_desc[i]); | 864 | mdb_desc[i]); |
865 | break; | 865 | break; |
866 | }else if(ret == 3){ | 866 | } else if (ret == 3) { |
867 | pr_warn("wanna use default mode\n"); | 867 | pr_warn("wanna use default mode\n"); |
868 | // break; | 868 | // break; |
869 | }else if(ret == 4){ | 869 | } else if (ret == 4) { |
870 | pr_warn("fall back to any valid mode\n"); | 870 | pr_warn("fall back to any valid mode\n"); |
871 | }else{ | 871 | } else { |
872 | pr_warn("ret = %d,fb_find_mode failed,with %s\n", ret, mdb_desc[i]); | 872 | pr_warn("ret = %d,fb_find_mode failed,with %s\n", ret, mdb_desc[i]); |
873 | } | 873 | } |
874 | } | 874 | } |
@@ -926,7 +926,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index) | |||
926 | pr_info("fix->mmio_start = %lx\n", fix->mmio_start); | 926 | pr_info("fix->mmio_start = %lx\n", fix->mmio_start); |
927 | fix->mmio_len = share->vidreg_size; | 927 | fix->mmio_len = share->vidreg_size; |
928 | pr_info("fix->mmio_len = %x\n", fix->mmio_len); | 928 | pr_info("fix->mmio_len = %x\n", fix->mmio_len); |
929 | switch(var->bits_per_pixel) { | 929 | switch (var->bits_per_pixel) { |
930 | case 8: | 930 | case 8: |
931 | fix->visual = FB_VISUAL_PSEUDOCOLOR; | 931 | fix->visual = FB_VISUAL_PSEUDOCOLOR; |
932 | break; | 932 | break; |
@@ -946,7 +946,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index) | |||
946 | info->cmap.red, info->cmap.green, info->cmap.blue, | 946 | info->cmap.red, info->cmap.green, info->cmap.blue, |
947 | info->cmap.transp); | 947 | info->cmap.transp); |
948 | 948 | ||
949 | if((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0){ | 949 | if ((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) { |
950 | pr_err("Could not allcate memory for cmap.\n"); | 950 | pr_err("Could not allcate memory for cmap.\n"); |
951 | goto exit; | 951 | goto exit; |
952 | } | 952 | } |
@@ -989,68 +989,68 @@ static void sm750fb_setup(struct lynx_share * share, char * src) | |||
989 | /*defaultly turn g_hwcursor on for both view */ | 989 | /*defaultly turn g_hwcursor on for both view */ |
990 | g_hwcursor = 3; | 990 | g_hwcursor = 3; |
991 | 991 | ||
992 | if(!src || !*src){ | 992 | if (!src || !*src) { |
993 | pr_warn("no specific g_option.\n"); | 993 | pr_warn("no specific g_option.\n"); |
994 | goto NO_PARAM; | 994 | goto NO_PARAM; |
995 | } | 995 | } |
996 | 996 | ||
997 | while((opt = strsep(&src, ":")) != NULL && *opt != 0){ | 997 | while ((opt = strsep(&src, ":")) != NULL && *opt != 0) { |
998 | pr_err("opt=%s\n", opt); | 998 | pr_err("opt=%s\n", opt); |
999 | pr_err("src=%s\n", src); | 999 | pr_err("src=%s\n", src); |
1000 | 1000 | ||
1001 | if(!strncmp(opt, "swap", strlen("swap"))) | 1001 | if (!strncmp(opt, "swap", strlen("swap"))) |
1002 | swap = 1; | 1002 | swap = 1; |
1003 | else if(!strncmp(opt, "nocrt", strlen("nocrt"))) | 1003 | else if (!strncmp(opt, "nocrt", strlen("nocrt"))) |
1004 | spec_share->state.nocrt = 1; | 1004 | spec_share->state.nocrt = 1; |
1005 | else if(!strncmp(opt, "36bit", strlen("36bit"))) | 1005 | else if (!strncmp(opt, "36bit", strlen("36bit"))) |
1006 | spec_share->state.pnltype = sm750_doubleTFT; | 1006 | spec_share->state.pnltype = sm750_doubleTFT; |
1007 | else if(!strncmp(opt, "18bit", strlen("18bit"))) | 1007 | else if (!strncmp(opt, "18bit", strlen("18bit"))) |
1008 | spec_share->state.pnltype = sm750_dualTFT; | 1008 | spec_share->state.pnltype = sm750_dualTFT; |
1009 | else if(!strncmp(opt, "24bit", strlen("24bit"))) | 1009 | else if (!strncmp(opt, "24bit", strlen("24bit"))) |
1010 | spec_share->state.pnltype = sm750_24TFT; | 1010 | spec_share->state.pnltype = sm750_24TFT; |
1011 | #ifdef CAP_EXPANSION | 1011 | #ifdef CAP_EXPANSION |
1012 | else if(!strncmp(opt, "exp:", strlen("exp:"))) | 1012 | else if (!strncmp(opt, "exp:", strlen("exp:"))) |
1013 | exp_res = opt + strlen("exp:"); | 1013 | exp_res = opt + strlen("exp:"); |
1014 | #endif | 1014 | #endif |
1015 | else if(!strncmp(opt, "nohwc0", strlen("nohwc0"))) | 1015 | else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) |
1016 | g_hwcursor &= ~0x1; | 1016 | g_hwcursor &= ~0x1; |
1017 | else if(!strncmp(opt, "nohwc1", strlen("nohwc1"))) | 1017 | else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) |
1018 | g_hwcursor &= ~0x2; | 1018 | g_hwcursor &= ~0x2; |
1019 | else if(!strncmp(opt, "nohwc", strlen("nohwc"))) | 1019 | else if (!strncmp(opt, "nohwc", strlen("nohwc"))) |
1020 | g_hwcursor = 0; | 1020 | g_hwcursor = 0; |
1021 | else { | 1021 | else { |
1022 | if(!g_fbmode[0]){ | 1022 | if (!g_fbmode[0]) { |
1023 | g_fbmode[0] = opt; | 1023 | g_fbmode[0] = opt; |
1024 | pr_info("find fbmode0 : %s\n", g_fbmode[0]); | 1024 | pr_info("find fbmode0 : %s\n", g_fbmode[0]); |
1025 | }else if(!g_fbmode[1]){ | 1025 | } else if (!g_fbmode[1]) { |
1026 | g_fbmode[1] = opt; | 1026 | g_fbmode[1] = opt; |
1027 | pr_info("find fbmode1 : %s\n", g_fbmode[1]); | 1027 | pr_info("find fbmode1 : %s\n", g_fbmode[1]); |
1028 | }else{ | 1028 | } else { |
1029 | pr_warn("How many view you wann set?\n"); | 1029 | pr_warn("How many view you wann set?\n"); |
1030 | } | 1030 | } |
1031 | } | 1031 | } |
1032 | } | 1032 | } |
1033 | #ifdef CAP_EXPANSION | 1033 | #ifdef CAP_EXPANSION |
1034 | if(getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) { | 1034 | if (getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) { |
1035 | /* seems exp_res is not valid*/ | 1035 | /* seems exp_res is not valid*/ |
1036 | spec_share->state.xLCD = spec_share->state.yLCD = 0; | 1036 | spec_share->state.xLCD = spec_share->state.yLCD = 0; |
1037 | } | 1037 | } |
1038 | #endif | 1038 | #endif |
1039 | 1039 | ||
1040 | NO_PARAM: | 1040 | NO_PARAM: |
1041 | if(share->revid != SM750LE_REVISION_ID){ | 1041 | if (share->revid != SM750LE_REVISION_ID) { |
1042 | if(share->dual) { | 1042 | if (share->dual) { |
1043 | if(swap) | 1043 | if (swap) |
1044 | spec_share->state.dataflow = sm750_dual_swap; | 1044 | spec_share->state.dataflow = sm750_dual_swap; |
1045 | else | 1045 | else |
1046 | spec_share->state.dataflow = sm750_dual_normal; | 1046 | spec_share->state.dataflow = sm750_dual_normal; |
1047 | }else{ | 1047 | } else { |
1048 | if(swap) | 1048 | if (swap) |
1049 | spec_share->state.dataflow = sm750_simul_sec; | 1049 | spec_share->state.dataflow = sm750_simul_sec; |
1050 | else | 1050 | else |
1051 | spec_share->state.dataflow = sm750_simul_pri; | 1051 | spec_share->state.dataflow = sm750_simul_pri; |
1052 | } | 1052 | } |
1053 | }else{ | 1053 | } else { |
1054 | /* SM750LE only have one crt channel */ | 1054 | /* SM750LE only have one crt channel */ |
1055 | spec_share->state.dataflow = sm750_simul_sec; | 1055 | spec_share->state.dataflow = sm750_simul_sec; |
1056 | /* sm750le do not have complex attributes*/ | 1056 | /* sm750le do not have complex attributes*/ |
@@ -1070,7 +1070,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1070 | 1070 | ||
1071 | 1071 | ||
1072 | /* enable device */ | 1072 | /* enable device */ |
1073 | if(pci_enable_device(pdev)){ | 1073 | if (pci_enable_device(pdev)) { |
1074 | pr_err("can not enable device.\n"); | 1074 | pr_err("can not enable device.\n"); |
1075 | goto err_enable; | 1075 | goto err_enable; |
1076 | } | 1076 | } |
@@ -1080,13 +1080,13 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1080 | spec_offset = offsetof(struct sm750_share, share); | 1080 | spec_offset = offsetof(struct sm750_share, share); |
1081 | 1081 | ||
1082 | spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL); | 1082 | spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL); |
1083 | if(!spec_share){ | 1083 | if (!spec_share) { |
1084 | pr_err("Could not allocate memory for share.\n"); | 1084 | pr_err("Could not allocate memory for share.\n"); |
1085 | goto err_share; | 1085 | goto err_share; |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | /* setting share structure */ | 1088 | /* setting share structure */ |
1089 | share = (struct lynx_share * )(&(spec_share->share)); | 1089 | share = (struct lynx_share *)(&(spec_share->share)); |
1090 | share->fbinfo[0] = share->fbinfo[1] = NULL; | 1090 | share->fbinfo[0] = share->fbinfo[1] = NULL; |
1091 | share->devid = pdev->device; | 1091 | share->devid = pdev->device; |
1092 | share->revid = pdev->revision; | 1092 | share->revid = pdev->revision; |
@@ -1102,7 +1102,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1102 | share->dual = g_dualview; | 1102 | share->dual = g_dualview; |
1103 | spin_lock_init(&share->slock); | 1103 | spin_lock_init(&share->slock); |
1104 | 1104 | ||
1105 | if(!share->accel_off){ | 1105 | if (!share->accel_off) { |
1106 | /* hook deInit and 2d routines, notes that below hw_xxx | 1106 | /* hook deInit and 2d routines, notes that below hw_xxx |
1107 | * routine can work on most of lynx chips | 1107 | * routine can work on most of lynx chips |
1108 | * if some chip need specific function,please hook it in smXXX_set_drv | 1108 | * if some chip need specific function,please hook it in smXXX_set_drv |
@@ -1112,7 +1112,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1112 | share->accel.de_copyarea = hw_copyarea; | 1112 | share->accel.de_copyarea = hw_copyarea; |
1113 | share->accel.de_imageblit = hw_imageblit; | 1113 | share->accel.de_imageblit = hw_imageblit; |
1114 | pr_info("enable 2d acceleration\n"); | 1114 | pr_info("enable 2d acceleration\n"); |
1115 | }else{ | 1115 | } else { |
1116 | pr_info("disable 2d acceleration\n"); | 1116 | pr_info("disable 2d acceleration\n"); |
1117 | } | 1117 | } |
1118 | 1118 | ||
@@ -1120,22 +1120,22 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1120 | sm750fb_setup(share, g_settings); | 1120 | sm750fb_setup(share, g_settings); |
1121 | 1121 | ||
1122 | /* call chip specific mmap routine */ | 1122 | /* call chip specific mmap routine */ |
1123 | if(hw_sm750_map(share, pdev)){ | 1123 | if (hw_sm750_map(share, pdev)) { |
1124 | pr_err("Memory map failed\n"); | 1124 | pr_err("Memory map failed\n"); |
1125 | goto err_map; | 1125 | goto err_map; |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | #ifdef CONFIG_MTRR | 1128 | #ifdef CONFIG_MTRR |
1129 | if(!share->mtrr_off){ | 1129 | if (!share->mtrr_off) { |
1130 | pr_info("enable mtrr\n"); | 1130 | pr_info("enable mtrr\n"); |
1131 | share->mtrr.vram = mtrr_add(share->vidmem_start, | 1131 | share->mtrr.vram = mtrr_add(share->vidmem_start, |
1132 | share->vidmem_size, | 1132 | share->vidmem_size, |
1133 | MTRR_TYPE_WRCOMB, 1); | 1133 | MTRR_TYPE_WRCOMB, 1); |
1134 | 1134 | ||
1135 | if(share->mtrr.vram < 0){ | 1135 | if (share->mtrr.vram < 0) { |
1136 | /* don't block driver with the failure of MTRR */ | 1136 | /* don't block driver with the failure of MTRR */ |
1137 | pr_err("Unable to setup MTRR.\n"); | 1137 | pr_err("Unable to setup MTRR.\n"); |
1138 | }else{ | 1138 | } else { |
1139 | share->mtrr.vram_added = 1; | 1139 | share->mtrr.vram_added = 1; |
1140 | pr_info("MTRR added succesfully\n"); | 1140 | pr_info("MTRR added succesfully\n"); |
1141 | } | 1141 | } |
@@ -1155,9 +1155,9 @@ static int lynxfb_pci_probe(struct pci_dev * pdev, | |||
1155 | fbidx = 0; | 1155 | fbidx = 0; |
1156 | ALLOC_FB: | 1156 | ALLOC_FB: |
1157 | info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev); | 1157 | info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev); |
1158 | if(!info[fbidx]) { | 1158 | if (!info[fbidx]) { |
1159 | pr_err("Could not allocate framebuffer #%d.\n", fbidx); | 1159 | pr_err("Could not allocate framebuffer #%d.\n", fbidx); |
1160 | if(fbidx == 0) | 1160 | if (fbidx == 0) |
1161 | goto err_info0_alloc; | 1161 | goto err_info0_alloc; |
1162 | else | 1162 | else |
1163 | goto err_info1_alloc; | 1163 | goto err_info1_alloc; |
@@ -1170,9 +1170,9 @@ ALLOC_FB: | |||
1170 | par->share = share; | 1170 | par->share = share; |
1171 | 1171 | ||
1172 | /* set fb_info structure */ | 1172 | /* set fb_info structure */ |
1173 | if(lynxfb_set_fbinfo(info[fbidx], fbidx)){ | 1173 | if (lynxfb_set_fbinfo(info[fbidx], fbidx)) { |
1174 | pr_err("Failed to initial fb_info #%d.\n", fbidx); | 1174 | pr_err("Failed to initial fb_info #%d.\n", fbidx); |
1175 | if(fbidx == 0) | 1175 | if (fbidx == 0) |
1176 | goto err_info0_set; | 1176 | goto err_info0_set; |
1177 | else | 1177 | else |
1178 | goto err_info1_set; | 1178 | goto err_info1_set; |
@@ -1183,7 +1183,7 @@ ALLOC_FB: | |||
1183 | errno = register_framebuffer(info[fbidx]); | 1183 | errno = register_framebuffer(info[fbidx]); |
1184 | if (errno < 0) { | 1184 | if (errno < 0) { |
1185 | pr_err("Failed to register fb_info #%d. err %d\n", fbidx, errno); | 1185 | pr_err("Failed to register fb_info #%d. err %d\n", fbidx, errno); |
1186 | if(fbidx == 0) | 1186 | if (fbidx == 0) |
1187 | goto err_register0; | 1187 | goto err_register0; |
1188 | else | 1188 | else |
1189 | goto err_register1; | 1189 | goto err_register1; |
@@ -1193,7 +1193,7 @@ ALLOC_FB: | |||
1193 | 1193 | ||
1194 | /* no dual view by far */ | 1194 | /* no dual view by far */ |
1195 | fbidx++; | 1195 | fbidx++; |
1196 | if(share->dual && fbidx < 2) | 1196 | if (share->dual && fbidx < 2) |
1197 | goto ALLOC_FB; | 1197 | goto ALLOC_FB; |
1198 | 1198 | ||
1199 | return 0; | 1199 | return 0; |
@@ -1225,9 +1225,9 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev) | |||
1225 | cnt = 2; | 1225 | cnt = 2; |
1226 | share = pci_get_drvdata(pdev); | 1226 | share = pci_get_drvdata(pdev); |
1227 | 1227 | ||
1228 | while(cnt-- > 0){ | 1228 | while (cnt-- > 0) { |
1229 | info = share->fbinfo[cnt]; | 1229 | info = share->fbinfo[cnt]; |
1230 | if(!info) | 1230 | if (!info) |
1231 | continue; | 1231 | continue; |
1232 | par = info->par; | 1232 | par = info->par; |
1233 | 1233 | ||
@@ -1239,7 +1239,7 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev) | |||
1239 | framebuffer_release(info); | 1239 | framebuffer_release(info); |
1240 | } | 1240 | } |
1241 | #ifdef CONFIG_MTRR | 1241 | #ifdef CONFIG_MTRR |
1242 | if(share->mtrr.vram_added) | 1242 | if (share->mtrr.vram_added) |
1243 | mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size); | 1243 | mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size); |
1244 | #endif | 1244 | #endif |
1245 | // pci_release_regions(pdev); | 1245 | // pci_release_regions(pdev); |
@@ -1258,7 +1258,7 @@ static int __init lynxfb_setup(char * options) | |||
1258 | char * opt,*tmp; | 1258 | char * opt,*tmp; |
1259 | 1259 | ||
1260 | 1260 | ||
1261 | if(!options || !*options){ | 1261 | if (!options || !*options) { |
1262 | pr_warn("no options.\n"); | 1262 | pr_warn("no options.\n"); |
1263 | return 0; | 1263 | return 0; |
1264 | } | 1264 | } |
@@ -1267,7 +1267,7 @@ static int __init lynxfb_setup(char * options) | |||
1267 | 1267 | ||
1268 | len = strlen(options) + 1; | 1268 | len = strlen(options) + 1; |
1269 | g_settings = kzalloc(len, GFP_KERNEL); | 1269 | g_settings = kzalloc(len, GFP_KERNEL); |
1270 | if(!g_settings) | 1270 | if (!g_settings) |
1271 | return -ENOMEM; | 1271 | return -ENOMEM; |
1272 | 1272 | ||
1273 | tmp = g_settings; | 1273 | tmp = g_settings; |
@@ -1280,20 +1280,20 @@ static int __init lynxfb_setup(char * options) | |||
1280 | strsep() updates @options to pointer after the first found token | 1280 | strsep() updates @options to pointer after the first found token |
1281 | it also returns the pointer ahead the token. | 1281 | it also returns the pointer ahead the token. |
1282 | */ | 1282 | */ |
1283 | while((opt = strsep(&options, ":"))!=NULL) { | 1283 | while ((opt = strsep(&options, ":"))!=NULL) { |
1284 | /* options that mean for any lynx chips are configured here */ | 1284 | /* options that mean for any lynx chips are configured here */ |
1285 | if(!strncmp(opt, "noaccel", strlen("noaccel"))) | 1285 | if (!strncmp(opt, "noaccel", strlen("noaccel"))) |
1286 | g_noaccel = 1; | 1286 | g_noaccel = 1; |
1287 | #ifdef CONFIG_MTRR | 1287 | #ifdef CONFIG_MTRR |
1288 | else if(!strncmp(opt, "nomtrr", strlen("nomtrr"))) | 1288 | else if (!strncmp(opt, "nomtrr", strlen("nomtrr"))) |
1289 | g_nomtrr = 1; | 1289 | g_nomtrr = 1; |
1290 | #endif | 1290 | #endif |
1291 | else if(!strncmp(opt, "dual", strlen("dual"))) | 1291 | else if (!strncmp(opt, "dual", strlen("dual"))) |
1292 | g_dualview = 1; | 1292 | g_dualview = 1; |
1293 | else { | 1293 | else { |
1294 | strcat(tmp, opt); | 1294 | strcat(tmp, opt); |
1295 | tmp += strlen(opt); | 1295 | tmp += strlen(opt); |
1296 | if(options != NULL) | 1296 | if (options != NULL) |
1297 | *tmp++ = ':'; | 1297 | *tmp++ = ':'; |
1298 | else | 1298 | else |
1299 | *tmp++ = 0; | 1299 | *tmp++ = 0; |
@@ -1332,7 +1332,7 @@ static int __init lynxfb_init(void) | |||
1332 | #ifdef MODULE | 1332 | #ifdef MODULE |
1333 | option = g_option; | 1333 | option = g_option; |
1334 | #else | 1334 | #else |
1335 | if(fb_get_options("sm750fb", &option)) | 1335 | if (fb_get_options("sm750fb", &option)) |
1336 | return -ENODEV; | 1336 | return -ENODEV; |
1337 | #endif | 1337 | #endif |
1338 | 1338 | ||