cyber2000fb: checkpatch fixes
This patch fixes errors and warnings pointed out by the checkpatch.pl script. Antonino Daplas replaced BIT with ENCODE_BIT. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
87d0613103
commit
532237eff1
@@ -221,12 +221,8 @@ cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
|
|||||||
static void
|
static void
|
||||||
cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)
|
cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)
|
||||||
{
|
{
|
||||||
// struct cfb_info *cfb = (struct cfb_info *)info;
|
|
||||||
|
|
||||||
// if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) {
|
|
||||||
cfb_imageblit(info, image);
|
cfb_imageblit(info, image);
|
||||||
return;
|
return;
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cyber2000fb_sync(struct fb_info *info)
|
static int cyber2000fb_sync(struct fb_info *info)
|
||||||
@@ -325,9 +321,11 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
|
|||||||
* to the high 6 bits of the LUT.
|
* to the high 6 bits of the LUT.
|
||||||
*/
|
*/
|
||||||
cyber2000fb_writeb(regno << 2, 0x3c8, cfb);
|
cyber2000fb_writeb(regno << 2, 0x3c8, cfb);
|
||||||
cyber2000fb_writeb(cfb->palette[regno >> 1].red, 0x3c9, cfb);
|
cyber2000fb_writeb(cfb->palette[regno >> 1].red,
|
||||||
|
0x3c9, cfb);
|
||||||
cyber2000fb_writeb(green, 0x3c9, cfb);
|
cyber2000fb_writeb(green, 0x3c9, cfb);
|
||||||
cyber2000fb_writeb(cfb->palette[regno >> 1].blue, 0x3c9, cfb);
|
cyber2000fb_writeb(cfb->palette[regno >> 1].blue,
|
||||||
|
0x3c9, cfb);
|
||||||
|
|
||||||
green = cfb->palette[regno << 3].green;
|
green = cfb->palette[regno << 3].green;
|
||||||
|
|
||||||
@@ -549,7 +547,7 @@ cyber2000fb_decode_crtc(struct par_info *hw, struct cfb_info *cfb,
|
|||||||
{
|
{
|
||||||
u_int Htotal, Hblankend, Hsyncend;
|
u_int Htotal, Hblankend, Hsyncend;
|
||||||
u_int Vtotal, Vdispend, Vblankstart, Vblankend, Vsyncstart, Vsyncend;
|
u_int Vtotal, Vdispend, Vblankstart, Vblankend, Vsyncstart, Vsyncend;
|
||||||
#define ENCODE_BIT(v,b1,m,b2) (((v >> b1) & m) << b2)
|
#define ENCODE_BIT(v, b1, m, b2) ((((v) >> (b1)) & (m)) << (b2))
|
||||||
|
|
||||||
hw->crtc[13] = hw->pitch;
|
hw->crtc[13] = hw->pitch;
|
||||||
hw->crtc[17] = 0xe3;
|
hw->crtc[17] = 0xe3;
|
||||||
@@ -750,11 +748,11 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
|||||||
var->red.msb_right = 0;
|
var->red.msb_right = 0;
|
||||||
var->green.msb_right = 0;
|
var->green.msb_right = 0;
|
||||||
var->blue.msb_right = 0;
|
var->blue.msb_right = 0;
|
||||||
|
var->transp.offset = 0;
|
||||||
|
var->transp.length = 0;
|
||||||
|
|
||||||
switch (var->bits_per_pixel) {
|
switch (var->bits_per_pixel) {
|
||||||
case 8: /* PSEUDOCOLOUR, 256 */
|
case 8: /* PSEUDOCOLOUR, 256 */
|
||||||
var->transp.offset = 0;
|
|
||||||
var->transp.length = 0;
|
|
||||||
var->red.offset = 0;
|
var->red.offset = 0;
|
||||||
var->red.length = 8;
|
var->red.length = 8;
|
||||||
var->green.offset = 0;
|
var->green.offset = 0;
|
||||||
@@ -766,8 +764,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
|||||||
case 16:/* DIRECTCOLOUR, 64k or 32k */
|
case 16:/* DIRECTCOLOUR, 64k or 32k */
|
||||||
switch (var->green.length) {
|
switch (var->green.length) {
|
||||||
case 6: /* RGB565, 64k */
|
case 6: /* RGB565, 64k */
|
||||||
var->transp.offset = 0;
|
|
||||||
var->transp.length = 0;
|
|
||||||
var->red.offset = 11;
|
var->red.offset = 11;
|
||||||
var->red.length = 5;
|
var->red.length = 5;
|
||||||
var->green.offset = 5;
|
var->green.offset = 5;
|
||||||
@@ -778,8 +774,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
case 5: /* RGB555, 32k */
|
case 5: /* RGB555, 32k */
|
||||||
var->transp.offset = 0;
|
|
||||||
var->transp.length = 0;
|
|
||||||
var->red.offset = 10;
|
var->red.offset = 10;
|
||||||
var->red.length = 5;
|
var->red.length = 5;
|
||||||
var->green.offset = 5;
|
var->green.offset = 5;
|
||||||
@@ -802,8 +796,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:/* TRUECOLOUR, 16m */
|
case 24:/* TRUECOLOUR, 16m */
|
||||||
var->transp.offset = 0;
|
|
||||||
var->transp.length = 0;
|
|
||||||
var->red.offset = 16;
|
var->red.offset = 16;
|
||||||
var->red.length = 8;
|
var->red.length = 8;
|
||||||
var->green.offset = 8;
|
var->green.offset = 8;
|
||||||
@@ -952,7 +944,6 @@ static int cyber2000fb_set_par(struct fb_info *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pan or Wrap the Display
|
* Pan or Wrap the Display
|
||||||
*/
|
*/
|
||||||
@@ -1018,7 +1009,8 @@ static int cyber2000fb_blank(int blank, struct fb_info *info)
|
|||||||
|
|
||||||
if (blank <= 1) {
|
if (blank <= 1) {
|
||||||
/* turn on ramdacs */
|
/* turn on ramdacs */
|
||||||
cfb->ramdac_powerdown &= ~(RAMDAC_DACPWRDN | RAMDAC_BYPASS | RAMDAC_RAMPWRDN);
|
cfb->ramdac_powerdown &= ~(RAMDAC_DACPWRDN | RAMDAC_BYPASS |
|
||||||
|
RAMDAC_RAMPWRDN);
|
||||||
cyber2000fb_write_ramdac_ctrl(cfb);
|
cyber2000fb_write_ramdac_ctrl(cfb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,7 +1035,8 @@ static int cyber2000fb_blank(int blank, struct fb_info *info)
|
|||||||
|
|
||||||
if (blank >= 2) {
|
if (blank >= 2) {
|
||||||
/* turn off ramdacs */
|
/* turn off ramdacs */
|
||||||
cfb->ramdac_powerdown |= RAMDAC_DACPWRDN | RAMDAC_BYPASS | RAMDAC_RAMPWRDN;
|
cfb->ramdac_powerdown |= RAMDAC_DACPWRDN | RAMDAC_BYPASS |
|
||||||
|
RAMDAC_RAMPWRDN;
|
||||||
cyber2000fb_write_ramdac_ctrl(cfb);
|
cyber2000fb_write_ramdac_ctrl(cfb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1085,6 +1078,7 @@ void cyber2000fb_enable_extregs(struct cfb_info *cfb)
|
|||||||
cyber2000_grphw(EXT_FUNC_CTL, old, cfb);
|
cyber2000_grphw(EXT_FUNC_CTL, old, cfb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cyber2000fb_enable_extregs);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable access to the extended registers
|
* Disable access to the extended registers
|
||||||
@@ -1104,11 +1098,13 @@ void cyber2000fb_disable_extregs(struct cfb_info *cfb)
|
|||||||
else
|
else
|
||||||
cfb->func_use_count -= 1;
|
cfb->func_use_count -= 1;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cyber2000fb_disable_extregs);
|
||||||
|
|
||||||
void cyber2000fb_get_fb_var(struct cfb_info *cfb, struct fb_var_screeninfo *var)
|
void cyber2000fb_get_fb_var(struct cfb_info *cfb, struct fb_var_screeninfo *var)
|
||||||
{
|
{
|
||||||
memcpy(var, &cfb->fb.var, sizeof(struct fb_var_screeninfo));
|
memcpy(var, &cfb->fb.var, sizeof(struct fb_var_screeninfo));
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cyber2000fb_get_fb_var);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attach a capture/tv driver to the core CyberX0X0 driver.
|
* Attach a capture/tv driver to the core CyberX0X0 driver.
|
||||||
@@ -1124,11 +1120,13 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx)
|
|||||||
info->disable_extregs = cyber2000fb_disable_extregs;
|
info->disable_extregs = cyber2000fb_disable_extregs;
|
||||||
info->info = int_cfb_info;
|
info->info = int_cfb_info;
|
||||||
|
|
||||||
strlcpy(info->dev_name, int_cfb_info->fb.fix.id, sizeof(info->dev_name));
|
strlcpy(info->dev_name, int_cfb_info->fb.fix.id,
|
||||||
|
sizeof(info->dev_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
return int_cfb_info != NULL;
|
return int_cfb_info != NULL;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cyber2000fb_attach);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Detach a capture/tv driver from the core CyberX0X0 driver.
|
* Detach a capture/tv driver from the core CyberX0X0 driver.
|
||||||
@@ -1136,12 +1134,7 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx)
|
|||||||
void cyber2000fb_detach(int idx)
|
void cyber2000fb_detach(int idx)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(cyber2000fb_attach);
|
|
||||||
EXPORT_SYMBOL(cyber2000fb_detach);
|
EXPORT_SYMBOL(cyber2000fb_detach);
|
||||||
EXPORT_SYMBOL(cyber2000fb_enable_extregs);
|
|
||||||
EXPORT_SYMBOL(cyber2000fb_disable_extregs);
|
|
||||||
EXPORT_SYMBOL(cyber2000fb_get_fb_var);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These parameters give
|
* These parameters give
|
||||||
@@ -1215,8 +1208,8 @@ static void cyberpro_init_hw(struct cfb_info *cfb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cfb_info * __devinit
|
static struct cfb_info __devinit *cyberpro_alloc_fb_info(unsigned int id,
|
||||||
cyberpro_alloc_fb_info(unsigned int id, char *name)
|
char *name)
|
||||||
{
|
{
|
||||||
struct cfb_info *cfb;
|
struct cfb_info *cfb;
|
||||||
|
|
||||||
@@ -1228,9 +1221,9 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
|
|||||||
cfb->id = id;
|
cfb->id = id;
|
||||||
|
|
||||||
if (id == ID_CYBERPRO_5000)
|
if (id == ID_CYBERPRO_5000)
|
||||||
cfb->ref_ps = 40690; // 24.576 MHz
|
cfb->ref_ps = 40690; /* 24.576 MHz */
|
||||||
else
|
else
|
||||||
cfb->ref_ps = 69842; // 14.31818 MHz (69841?)
|
cfb->ref_ps = 69842; /* 14.31818 MHz (69841?) */
|
||||||
|
|
||||||
cfb->divisors[0] = 1;
|
cfb->divisors[0] = 1;
|
||||||
cfb->divisors[1] = 2;
|
cfb->divisors[1] = 2;
|
||||||
@@ -1282,8 +1275,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
|
|||||||
return cfb;
|
return cfb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void cyberpro_free_fb_info(struct cfb_info *cfb)
|
||||||
cyberpro_free_fb_info(struct cfb_info *cfb)
|
|
||||||
{
|
{
|
||||||
if (cfb) {
|
if (cfb) {
|
||||||
/*
|
/*
|
||||||
@@ -1300,8 +1292,7 @@ cyberpro_free_fb_info(struct cfb_info *cfb)
|
|||||||
* video=cyber2000:font:fontname
|
* video=cyber2000:font:fontname
|
||||||
*/
|
*/
|
||||||
#ifndef MODULE
|
#ifndef MODULE
|
||||||
static int
|
static int cyber2000fb_setup(char *options)
|
||||||
cyber2000fb_setup(char *options)
|
|
||||||
{
|
{
|
||||||
char *opt;
|
char *opt;
|
||||||
|
|
||||||
@@ -1315,7 +1306,8 @@ cyber2000fb_setup(char *options)
|
|||||||
if (strncmp(opt, "font:", 5) == 0) {
|
if (strncmp(opt, "font:", 5) == 0) {
|
||||||
static char default_font_storage[40];
|
static char default_font_storage[40];
|
||||||
|
|
||||||
strlcpy(default_font_storage, opt + 5, sizeof(default_font_storage));
|
strlcpy(default_font_storage, opt + 5,
|
||||||
|
sizeof(default_font_storage));
|
||||||
default_font = default_font_storage;
|
default_font = default_font_storage;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1354,10 +1346,18 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb)
|
|||||||
* Determine the size of the memory.
|
* Determine the size of the memory.
|
||||||
*/
|
*/
|
||||||
switch (cfb->mem_ctl2 & MEM_CTL2_SIZE_MASK) {
|
switch (cfb->mem_ctl2 & MEM_CTL2_SIZE_MASK) {
|
||||||
case MEM_CTL2_SIZE_4MB: smem_size = 0x00400000; break;
|
case MEM_CTL2_SIZE_4MB:
|
||||||
case MEM_CTL2_SIZE_2MB: smem_size = 0x00200000; break;
|
smem_size = 0x00400000;
|
||||||
case MEM_CTL2_SIZE_1MB: smem_size = 0x00100000; break;
|
break;
|
||||||
default: smem_size = 0x00100000; break;
|
case MEM_CTL2_SIZE_2MB:
|
||||||
|
smem_size = 0x00200000;
|
||||||
|
break;
|
||||||
|
case MEM_CTL2_SIZE_1MB:
|
||||||
|
smem_size = 0x00100000;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
smem_size = 0x00100000;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfb->fb.fix.smem_len = smem_size;
|
cfb->fb.fix.smem_len = smem_size;
|
||||||
@@ -1367,7 +1367,7 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb)
|
|||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if (!fb_find_mode(&cfb->fb.var, &cfb->fb, NULL, NULL, 0,
|
if (!fb_find_mode(&cfb->fb.var, &cfb->fb, NULL, NULL, 0,
|
||||||
&cyber2000fb_default_mode, 8)) {
|
&cyber2000fb_default_mode, 8)) {
|
||||||
printk("%s: no valid mode found\n", cfb->fb.fix.id);
|
printk(KERN_ERR "%s: no valid mode found\n", cfb->fb.fix.id);
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1377,7 +1377,7 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb)
|
|||||||
if (cfb->fb.var.yres_virtual < cfb->fb.var.yres)
|
if (cfb->fb.var.yres_virtual < cfb->fb.var.yres)
|
||||||
cfb->fb.var.yres_virtual = cfb->fb.var.yres;
|
cfb->fb.var.yres_virtual = cfb->fb.var.yres;
|
||||||
|
|
||||||
// fb_set_var(&cfb->fb.var, -1, &cfb->fb);
|
/* fb_set_var(&cfb->fb.var, -1, &cfb->fb); */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate the hsync and vsync frequencies. Note that
|
* Calculate the hsync and vsync frequencies. Note that
|
||||||
@@ -1425,13 +1425,13 @@ static void cyberpro_common_resume(struct cfb_info *cfb)
|
|||||||
|
|
||||||
#include <asm/arch/hardware.h>
|
#include <asm/arch/hardware.h>
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit cyberpro_vl_probe(void)
|
||||||
cyberpro_vl_probe(void)
|
|
||||||
{
|
{
|
||||||
struct cfb_info *cfb;
|
struct cfb_info *cfb;
|
||||||
int err = -ENOMEM;
|
int err = -ENOMEM;
|
||||||
|
|
||||||
if (!request_mem_region(FB_START,FB_SIZE,"CyberPro2010")) return err;
|
if (!request_mem_region(FB_START, FB_SIZE, "CyberPro2010"))
|
||||||
|
return err;
|
||||||
|
|
||||||
cfb = cyberpro_alloc_fb_info(ID_CYBERPRO_2010, "CyberPro2010");
|
cfb = cyberpro_alloc_fb_info(ID_CYBERPRO_2010, "CyberPro2010");
|
||||||
if (!cfb)
|
if (!cfb)
|
||||||
@@ -1538,7 +1538,8 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
|
|||||||
* Allow the CyberPro to accept PCI burst accesses
|
* Allow the CyberPro to accept PCI burst accesses
|
||||||
*/
|
*/
|
||||||
if (cfb->id == ID_CYBERPRO_2010) {
|
if (cfb->id == ID_CYBERPRO_2010) {
|
||||||
printk(KERN_INFO "%s: NOT enabling PCI bursts\n", cfb->fb.fix.id);
|
printk(KERN_INFO "%s: NOT enabling PCI bursts\n",
|
||||||
|
cfb->fb.fix.id);
|
||||||
} else {
|
} else {
|
||||||
val = cyber2000_grphr(EXT_BUS_CTL, cfb);
|
val = cyber2000_grphr(EXT_BUS_CTL, cfb);
|
||||||
if (!(val & EXT_BUS_CTL_PCIBURST_WRITE)) {
|
if (!(val & EXT_BUS_CTL_PCIBURST_WRITE)) {
|
||||||
@@ -1688,9 +1689,10 @@ static int cyberpro_pci_resume(struct pci_dev *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct pci_device_id cyberpro_pci_table[] = {
|
static struct pci_device_id cyberpro_pci_table[] = {
|
||||||
// Not yet
|
/* Not yet
|
||||||
// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
|
* { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
|
||||||
// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
|
* PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
|
||||||
|
*/
|
||||||
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000,
|
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000,
|
||||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 },
|
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 },
|
||||||
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,
|
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,
|
||||||
|
Reference in New Issue
Block a user