[FFB]: source cleanup
This patch cleans up the driver a bit. It contains coding style fixes (pointed by Lindent and checkpatch) and white space clean ups. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a140e94d92
commit
f9c97e5d7c
|
@ -382,7 +382,9 @@ static void FFBFifo(struct ffb_par *par, int n)
|
||||||
|
|
||||||
if (cache - n < 0) {
|
if (cache - n < 0) {
|
||||||
fbc = par->fbc;
|
fbc = par->fbc;
|
||||||
do { cache = (upa_readl(&fbc->ucsr) & FFB_UCSR_FIFO_MASK) - 8;
|
do {
|
||||||
|
cache = (upa_readl(&fbc->ucsr) & FFB_UCSR_FIFO_MASK);
|
||||||
|
cache -= 8;
|
||||||
} while (cache - n < 0);
|
} while (cache - n < 0);
|
||||||
}
|
}
|
||||||
par->fifo_cache = cache - n;
|
par->fifo_cache = cache - n;
|
||||||
|
@ -401,12 +403,12 @@ static void FFBWait(struct ffb_par *par)
|
||||||
upa_writel(FFB_UCSR_ALL_ERRORS, &fbc->ucsr);
|
upa_writel(FFB_UCSR_ALL_ERRORS, &fbc->ucsr);
|
||||||
}
|
}
|
||||||
udelay(10);
|
udelay(10);
|
||||||
} while(--limit > 0);
|
} while (--limit > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ffb_sync(struct fb_info *p)
|
static int ffb_sync(struct fb_info *p)
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) p->par;
|
struct ffb_par *par = (struct ffb_par *)p->par;
|
||||||
|
|
||||||
FFBWait(par);
|
FFBWait(par);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -431,8 +433,8 @@ static void ffb_switch_from_graph(struct ffb_par *par)
|
||||||
FFBWait(par);
|
FFBWait(par);
|
||||||
par->fifo_cache = 0;
|
par->fifo_cache = 0;
|
||||||
FFBFifo(par, 7);
|
FFBFifo(par, 7);
|
||||||
upa_writel(FFB_PPC_VCE_DISABLE|FFB_PPC_TBE_OPAQUE|
|
upa_writel(FFB_PPC_VCE_DISABLE | FFB_PPC_TBE_OPAQUE |
|
||||||
FFB_PPC_APE_DISABLE|FFB_PPC_CS_CONST,
|
FFB_PPC_APE_DISABLE | FFB_PPC_CS_CONST,
|
||||||
&fbc->ppc);
|
&fbc->ppc);
|
||||||
upa_writel(0x2000707f, &fbc->fbc);
|
upa_writel(0x2000707f, &fbc->fbc);
|
||||||
upa_writel(par->rop_cache, &fbc->rop);
|
upa_writel(par->rop_cache, &fbc->rop);
|
||||||
|
@ -455,7 +457,7 @@ static void ffb_switch_from_graph(struct ffb_par *par)
|
||||||
|
|
||||||
static int ffb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
|
static int ffb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
|
|
||||||
/* We just use this to catch switches out of
|
/* We just use this to catch switches out of
|
||||||
* graphics mode.
|
* graphics mode.
|
||||||
|
@ -468,16 +470,14 @@ static int ffb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ffb_fillrect - REQUIRED function. Can use generic routines if
|
* ffb_fillrect - Draws a rectangle on the screen.
|
||||||
* non acclerated hardware and packed pixel based.
|
|
||||||
* Draws a rectangle on the screen.
|
|
||||||
*
|
*
|
||||||
* @info: frame buffer structure that represents a single frame buffer
|
* @info: frame buffer structure that represents a single frame buffer
|
||||||
* @rect: structure defining the rectagle and operation.
|
* @rect: structure defining the rectagle and operation.
|
||||||
*/
|
*/
|
||||||
static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
struct ffb_fbc __iomem *fbc = par->fbc;
|
struct ffb_fbc __iomem *fbc = par->fbc;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 fg;
|
u32 fg;
|
||||||
|
@ -494,9 +494,9 @@ static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
||||||
par->fg_cache = fg;
|
par->fg_cache = fg;
|
||||||
}
|
}
|
||||||
|
|
||||||
ffb_rop(par, (rect->rop == ROP_COPY ?
|
ffb_rop(par, rect->rop == ROP_COPY ?
|
||||||
FFB_ROP_NEW :
|
FFB_ROP_NEW :
|
||||||
FFB_ROP_NEW_XOR_OLD));
|
FFB_ROP_NEW_XOR_OLD);
|
||||||
|
|
||||||
FFBFifo(par, 5);
|
FFBFifo(par, 5);
|
||||||
upa_writel(FFB_DRAWOP_RECTANGLE, &fbc->drawop);
|
upa_writel(FFB_DRAWOP_RECTANGLE, &fbc->drawop);
|
||||||
|
@ -509,18 +509,15 @@ static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ffb_copyarea - REQUIRED function. Can use generic routines if
|
* ffb_copyarea - Copies on area of the screen to another area.
|
||||||
* non acclerated hardware and packed pixel based.
|
|
||||||
* Copies on area of the screen to another area.
|
|
||||||
*
|
*
|
||||||
* @info: frame buffer structure that represents a single frame buffer
|
* @info: frame buffer structure that represents a single frame buffer
|
||||||
* @area: structure defining the source and destination.
|
* @area: structure defining the source and destination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
|
||||||
ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
|
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
struct ffb_fbc __iomem *fbc = par->fbc;
|
struct ffb_fbc __iomem *fbc = par->fbc;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
@ -547,16 +544,14 @@ ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ffb_imageblit - REQUIRED function. Can use generic routines if
|
* ffb_imageblit - Copies a image from system memory to the screen.
|
||||||
* non acclerated hardware and packed pixel based.
|
|
||||||
* Copies a image from system memory to the screen.
|
|
||||||
*
|
*
|
||||||
* @info: frame buffer structure that represents a single frame buffer
|
* @info: frame buffer structure that represents a single frame buffer
|
||||||
* @image: structure defining the image.
|
* @image: structure defining the image.
|
||||||
*/
|
*/
|
||||||
static void ffb_imageblit(struct fb_info *info, const struct fb_image *image)
|
static void ffb_imageblit(struct fb_info *info, const struct fb_image *image)
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
struct ffb_fbc __iomem *fbc = par->fbc;
|
struct ffb_fbc __iomem *fbc = par->fbc;
|
||||||
const u8 *data = image->data;
|
const u8 *data = image->data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -644,7 +639,8 @@ static void ffb_fixup_var_rgb(struct fb_var_screeninfo *var)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ffb_setcolreg - Optional function. Sets a color register.
|
* ffb_setcolreg - Sets a color register.
|
||||||
|
*
|
||||||
* @regno: boolean, 0 copy local, 1 get_user() function
|
* @regno: boolean, 0 copy local, 1 get_user() function
|
||||||
* @red: frame buffer colormap structure
|
* @red: frame buffer colormap structure
|
||||||
* @green: The green value which can be up to 16 bits wide
|
* @green: The green value which can be up to 16 bits wide
|
||||||
|
@ -676,10 +672,9 @@ static int ffb_setcolreg(unsigned regno,
|
||||||
* @blank_mode: the blank mode we want.
|
* @blank_mode: the blank mode we want.
|
||||||
* @info: frame buffer structure that represents a single frame buffer
|
* @info: frame buffer structure that represents a single frame buffer
|
||||||
*/
|
*/
|
||||||
static int
|
static int ffb_blank(int blank, struct fb_info *info)
|
||||||
ffb_blank(int blank, struct fb_info *info)
|
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
struct ffb_dac __iomem *dac = par->dac;
|
struct ffb_dac __iomem *dac = par->dac;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
@ -867,7 +862,7 @@ static int ffb_mmap(struct fb_info *info, struct vm_area_struct *vma)
|
||||||
|
|
||||||
static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *) info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
|
|
||||||
return sbusfb_ioctl_helper(cmd, arg, info,
|
return sbusfb_ioctl_helper(cmd, arg, info,
|
||||||
FBTYPE_CREATOR, 24, par->fbsize);
|
FBTYPE_CREATOR, 24, par->fbsize);
|
||||||
|
@ -877,8 +872,7 @@ static int ffb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
||||||
* Initialisation
|
* Initialisation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void ffb_init_fix(struct fb_info *info)
|
||||||
ffb_init_fix(struct fb_info *info)
|
|
||||||
{
|
{
|
||||||
struct ffb_par *par = (struct ffb_par *)info->par;
|
struct ffb_par *par = (struct ffb_par *)info->par;
|
||||||
const char *ffb_type_name;
|
const char *ffb_type_name;
|
||||||
|
@ -902,7 +896,8 @@ ffb_init_fix(struct fb_info *info)
|
||||||
info->fix.accel = FB_ACCEL_SUN_CREATOR;
|
info->fix.accel = FB_ACCEL_SUN_CREATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devinit ffb_probe(struct of_device *op, const struct of_device_id *match)
|
static int __devinit ffb_probe(struct of_device *op,
|
||||||
|
const struct of_device_id *match)
|
||||||
{
|
{
|
||||||
struct device_node *dp = op->node;
|
struct device_node *dp = op->node;
|
||||||
struct ffb_fbc __iomem *fbc;
|
struct ffb_fbc __iomem *fbc;
|
||||||
|
|
Loading…
Reference in New Issue