mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 09:02:00 +00:00
Staging: udlfb: checkpatch cleanup
Eliminate checkpatch.pl warnings and errors so later patches in series are clean Signed-off-by: Bernie Thompson <bernie@plugable.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cd18964a1d
commit
1d31a9ee69
@ -30,13 +30,13 @@
|
|||||||
#define DRIVER_VERSION "DisplayLink Framebuffer Driver 0.4.1"
|
#define DRIVER_VERSION "DisplayLink Framebuffer Driver 0.4.1"
|
||||||
|
|
||||||
static struct fb_fix_screeninfo dlfb_fix = {
|
static struct fb_fix_screeninfo dlfb_fix = {
|
||||||
.id = "displaylinkfb",
|
.id = "displaylinkfb",
|
||||||
.type = FB_TYPE_PACKED_PIXELS,
|
.type = FB_TYPE_PACKED_PIXELS,
|
||||||
.visual = FB_VISUAL_TRUECOLOR,
|
.visual = FB_VISUAL_TRUECOLOR,
|
||||||
.xpanstep = 0,
|
.xpanstep = 0,
|
||||||
.ypanstep = 0,
|
.ypanstep = 0,
|
||||||
.ywrapstep = 0,
|
.ywrapstep = 0,
|
||||||
.accel = FB_ACCEL_NONE,
|
.accel = FB_ACCEL_NONE,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NR_USB_REQUEST_I2C_SUB_IO 0x02
|
#define NR_USB_REQUEST_I2C_SUB_IO 0x02
|
||||||
@ -48,21 +48,21 @@ static struct fb_fix_screeninfo dlfb_fix = {
|
|||||||
*/
|
*/
|
||||||
static char *insert_command(char *buf, u8 reg, u8 val)
|
static char *insert_command(char *buf, u8 reg, u8 val)
|
||||||
{
|
{
|
||||||
*buf++ = 0xAF;
|
*buf++ = 0xAF;
|
||||||
*buf++ = 0x20;
|
*buf++ = 0x20;
|
||||||
*buf++ = reg;
|
*buf++ = reg;
|
||||||
*buf++ = val;
|
*buf++ = val;
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_vidreg_lock(char *buf)
|
static char *insert_vidreg_lock(char *buf)
|
||||||
{
|
{
|
||||||
return insert_command(buf, 0xFF, 0x00);
|
return insert_command(buf, 0xFF, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_vidreg_unlock(char *buf)
|
static char *insert_vidreg_unlock(char *buf)
|
||||||
{
|
{
|
||||||
return insert_command(buf, 0xFF, 0xFF);
|
return insert_command(buf, 0xFF, 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -71,33 +71,33 @@ static char *insert_vidreg_unlock(char *buf)
|
|||||||
*/
|
*/
|
||||||
static char *insert_enable_hvsync(char *buf)
|
static char *insert_enable_hvsync(char *buf)
|
||||||
{
|
{
|
||||||
return insert_command(buf, 0x1F, 0x00);
|
return insert_command(buf, 0x1F, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_set_color_depth(char *buf, u8 selection)
|
static char *insert_set_color_depth(char *buf, u8 selection)
|
||||||
{
|
{
|
||||||
return insert_command(buf, 0x00, selection);
|
return insert_command(buf, 0x00, selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_set_base16bpp(char *wrptr, u32 base)
|
static char *insert_set_base16bpp(char *wrptr, u32 base)
|
||||||
{
|
{
|
||||||
/* the base pointer is 16 bits wide, 0x20 is hi byte. */
|
/* the base pointer is 16 bits wide, 0x20 is hi byte. */
|
||||||
wrptr = insert_command(wrptr, 0x20, base >> 16);
|
wrptr = insert_command(wrptr, 0x20, base >> 16);
|
||||||
wrptr = insert_command(wrptr, 0x21, base >> 8);
|
wrptr = insert_command(wrptr, 0x21, base >> 8);
|
||||||
return insert_command(wrptr, 0x22, base);
|
return insert_command(wrptr, 0x22, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_set_base8bpp(char *wrptr, u32 base)
|
static char *insert_set_base8bpp(char *wrptr, u32 base)
|
||||||
{
|
{
|
||||||
wrptr = insert_command(wrptr, 0x26, base >> 16);
|
wrptr = insert_command(wrptr, 0x26, base >> 16);
|
||||||
wrptr = insert_command(wrptr, 0x27, base >> 8);
|
wrptr = insert_command(wrptr, 0x27, base >> 8);
|
||||||
return insert_command(wrptr, 0x28, base);
|
return insert_command(wrptr, 0x28, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *insert_command_16(char *wrptr, u8 reg, u16 value)
|
static char *insert_command_16(char *wrptr, u8 reg, u16 value)
|
||||||
{
|
{
|
||||||
wrptr = insert_command(wrptr, reg, value >> 8);
|
wrptr = insert_command(wrptr, reg, value >> 8);
|
||||||
return insert_command(wrptr, reg+1, value);
|
return insert_command(wrptr, reg+1, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -106,8 +106,8 @@ static char *insert_command_16(char *wrptr, u8 reg, u16 value)
|
|||||||
*/
|
*/
|
||||||
static char *insert_command_16be(char *wrptr, u8 reg, u16 value)
|
static char *insert_command_16be(char *wrptr, u8 reg, u16 value)
|
||||||
{
|
{
|
||||||
wrptr = insert_command(wrptr, reg, value);
|
wrptr = insert_command(wrptr, reg, value);
|
||||||
return insert_command(wrptr, reg+1, value >> 8);
|
return insert_command(wrptr, reg+1, value >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -339,7 +339,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
|
|||||||
|
|
||||||
static struct usb_driver dlfb_driver;
|
static struct usb_driver dlfb_driver;
|
||||||
|
|
||||||
// thanks to Henrik Bjerregaard Pedersen for this function
|
/* thanks to Henrik Bjerregaard Pedersen for this function */
|
||||||
static char *rle_compress16(uint16_t * src, char *dst, int rem)
|
static char *rle_compress16(uint16_t * src, char *dst, int rem)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ static char *rle_compress16(uint16_t * src, char *dst, int rem)
|
|||||||
uint16_t pix0;
|
uint16_t pix0;
|
||||||
char *end_if_raw = dst + 6 + 2 * rem;
|
char *end_if_raw = dst + 6 + 2 * rem;
|
||||||
|
|
||||||
dst += 6; // header will be filled in if RLE is worth it
|
dst += 6; /* header will be filled in if RLE is worth it */
|
||||||
|
|
||||||
while (rem && dst < end_if_raw) {
|
while (rem && dst < end_if_raw) {
|
||||||
char *start = (char *)src;
|
char *start = (char *)src;
|
||||||
@ -366,8 +366,8 @@ static char *rle_compress16(uint16_t * src, char *dst, int rem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Thanks to Henrik Bjerregaard Pedersen for rle implementation and code refactoring.
|
Thanks to Henrik Bjerregaard Pedersen for rle implementation
|
||||||
Next step is huffman compression.
|
and code refactoring. Next step is huffman compression.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -419,7 +419,7 @@ image_blit(struct dlfb_data *dev_info, int x, int y, int width, int height,
|
|||||||
bufptr - dev_info->buf);
|
bufptr - dev_info->buf);
|
||||||
bufptr = dev_info->buf;
|
bufptr = dev_info->buf;
|
||||||
}
|
}
|
||||||
// number of pixels to consider this time
|
/* number of pixels to consider this time */
|
||||||
thistime = rem;
|
thistime = rem;
|
||||||
if (thistime > 255)
|
if (thistime > 255)
|
||||||
thistime = 255;
|
thistime = 255;
|
||||||
@ -467,7 +467,7 @@ image_blit(struct dlfb_data *dev_info, int x, int y, int width, int height,
|
|||||||
bufptr = end_of_rle;
|
bufptr = end_of_rle;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// fallback to raw (or some other encoding?)
|
/* fallback to raw (or other?) */
|
||||||
*bufptr++ = 0xAF;
|
*bufptr++ = 0xAF;
|
||||||
*bufptr++ = 0x68;
|
*bufptr++ = 0x68;
|
||||||
|
|
||||||
@ -479,7 +479,6 @@ image_blit(struct dlfb_data *dev_info, int x, int y, int width, int height,
|
|||||||
*bufptr++ =
|
*bufptr++ =
|
||||||
(char)(base + firstdiff * 2);
|
(char)(base + firstdiff * 2);
|
||||||
*bufptr++ = thistime - firstdiff;
|
*bufptr++ = thistime - firstdiff;
|
||||||
// PUT COMPRESSION HERE
|
|
||||||
for (j = firstdiff * 2;
|
for (j = firstdiff * 2;
|
||||||
j < thistime * 2; j += 2) {
|
j < thistime * 2; j += 2) {
|
||||||
*bufptr++ = data[j + 1];
|
*bufptr++ = data[j + 1];
|
||||||
@ -621,7 +620,7 @@ static void swapfb(struct dlfb_data *dev_info)
|
|||||||
|
|
||||||
bufptr = dlfb_set_register(bufptr, 0xFF, 0x00);
|
bufptr = dlfb_set_register(bufptr, 0xFF, 0x00);
|
||||||
|
|
||||||
// set addresses
|
/* set addresses */
|
||||||
bufptr =
|
bufptr =
|
||||||
dlfb_set_register(bufptr, 0x20, (char)(dev_info->base16 >> 16));
|
dlfb_set_register(bufptr, 0x20, (char)(dev_info->base16 >> 16));
|
||||||
bufptr = dlfb_set_register(bufptr, 0x21, (char)(dev_info->base16 >> 8));
|
bufptr = dlfb_set_register(bufptr, 0x21, (char)(dev_info->base16 >> 8));
|
||||||
@ -803,9 +802,6 @@ static void dlfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
|
|||||||
|
|
||||||
copyarea(dev, area->dx, area->dy, area->sx, area->sy, area->width,
|
copyarea(dev, area->dx, area->dy, area->sx, area->sy, area->width,
|
||||||
area->height);
|
area->height);
|
||||||
|
|
||||||
/* printk("COPY AREA %d %d %d %d %d %d !!!\n", area->dx, area->dy, area->sx, area->sy, area->width, area->height); */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dlfb_imageblit(struct fb_info *info, const struct fb_image *image)
|
static void dlfb_imageblit(struct fb_info *info, const struct fb_image *image)
|
||||||
@ -813,12 +809,10 @@ static void dlfb_imageblit(struct fb_info *info, const struct fb_image *image)
|
|||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
struct dlfb_data *dev = info->par;
|
struct dlfb_data *dev = info->par;
|
||||||
/* printk("IMAGE BLIT (1) %d %d %d %d DEPTH %d {%p}!!!\n", image->dx, image->dy, image->width, image->height, image->depth, dev->udev); */
|
|
||||||
cfb_imageblit(info, image);
|
cfb_imageblit(info, image);
|
||||||
ret =
|
ret =
|
||||||
image_blit(dev, image->dx, image->dy, image->width, image->height,
|
image_blit(dev, image->dx, image->dy, image->width, image->height,
|
||||||
info->screen_base);
|
info->screen_base);
|
||||||
/* printk("IMAGE BLIT (2) %d %d %d %d DEPTH %d {%p} %d!!!\n", image->dx, image->dy, image->width, image->height, image->depth, dev->udev, ret); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dlfb_fillrect(struct fb_info *info,
|
static void dlfb_fillrect(struct fb_info *info,
|
||||||
|
@ -44,7 +44,6 @@ static void dlfb_edid(struct dlfb_data *dev_info)
|
|||||||
usb_rcvctrlpipe(dev_info->udev, 0), (0x02),
|
usb_rcvctrlpipe(dev_info->udev, 0), (0x02),
|
||||||
(0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
|
(0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
|
||||||
0);
|
0);
|
||||||
/*printk("ret control msg edid %d: %d [%d]\n",i, ret, rbuf[1]); */
|
|
||||||
dev_info->edid[i] = rbuf[1];
|
dev_info->edid[i] = rbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user