You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: Vojtech P. <vo...@us...> - 2002-03-13 10:09:22
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv31313/serio Modified Files: parkbd.c Log Message: Use time_after() Index: parkbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/parkbd.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- parkbd.c 22 Jan 2002 20:44:10 -0000 1.9 +++ parkbd.c 13 Mar 2002 10:09:20 -0000 1.10 @@ -109,7 +109,7 @@ if (parkbd_writing) { - if (parkbd_counter && ((parkbd_counter == 11) || (jiffies - parkbd_last > 1))) { + if (parkbd_counter && ((parkbd_counter == 11) || time_after(jiffies, parkbd_last + HZ/100))) { parkbd_counter = 0; parkbd_buffer = 0; parkbd_writing = 0; @@ -128,7 +128,7 @@ } else { - if ((parkbd_counter == parkbd_mode + 10) || (jiffies - parkbd_last > 1)) { + if ((parkbd_counter == parkbd_mode + 10) || time_after(jiffies, parkbd_last + HZ/100)) { parkbd_counter = 0; parkbd_buffer = 0; } |
From: Vojtech P. <vo...@us...> - 2002-03-13 10:03:46
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/mouse In directory usw-pr-cvs1:/tmp/cvs-serv29918 Modified Files: psmouse.c sermouse.c Log Message: Use time_after() macros and HZ-based timeout for packet timeout in mouse drivers. Index: psmouse.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/mouse/psmouse.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- psmouse.c 12 Feb 2002 09:34:34 -0000 1.17 +++ psmouse.c 13 Mar 2002 10:03:43 -0000 1.18 @@ -200,7 +200,7 @@ return; } - if (psmouse->pktcnt && jiffies - psmouse->last > 2) { + if (psmouse->pktcnt && time_after(jiffies, psmouse->last + HZ/20)) { printk(KERN_WARNING "psmouse.c: Lost synchronization, throwing %d bytes away.\n", psmouse->pktcnt); psmouse->pktcnt = 0; } Index: sermouse.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/mouse/sermouse.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- sermouse.c 22 Jan 2002 20:49:17 -0000 1.16 +++ sermouse.c 13 Mar 2002 10:03:43 -0000 1.17 @@ -200,7 +200,7 @@ { struct sermouse *sermouse = serio->private; - if (jiffies - sermouse->last > 2) sermouse->count = 0; + if (time_after(jiffies, sermouse->last + HZ/20)) sermouse->count = 0; sermouse->last = jiffies; if (sermouse->type > SERIO_SUN) |
From: James S. <jsi...@us...> - 2002-03-12 20:34:10
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv13280 Removed Files: cfbimgblt_old.c Log Message: Outdated code. --- cfbimgblt_old.c DELETED --- |
From: James S. <jsi...@us...> - 2002-03-12 20:33:25
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv13048 Modified Files: cfbcopyarea.c cfbfillrect.c Log Message: tabbing cleanups. Index: cfbcopyarea.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbcopyarea.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cfbcopyarea.c 5 Mar 2002 17:14:28 -0000 1.4 +++ cfbcopyarea.c 12 Mar 2002 20:33:19 -0000 1.5 @@ -30,186 +30,188 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) { - unsigned long start_index, end_index, start_mask, end_mask, last,tmp, height; - int x2, y2, n, j, lineincr, shift, shift_right, shift_left, old_dx,old_dy; - int linesize = p->fix.line_length, bpl = sizeof(unsigned long); - unsigned long *dst = NULL, *src = NULL; - char *src1,*dst1; + unsigned long start_index, end_index, start_mask, end_mask, last, tmp, height; + int x2, y2, n, j, lineincr, shift, shift_right, shift_left, old_dx, old_dy; + int linesize = p->fix.line_length, bpl = sizeof(unsigned long); + unsigned long *dst = NULL, *src = NULL; + char *src1,*dst1; - /* clip the destination */ - old_dx = area->dx; - old_dy = area->dy; + /* clip the destination */ + old_dx = area->dx; + old_dy = area->dy; - /* We could use hardware clipping but on many cards you get around hardware - clipping by writing to framebuffer directly. */ - x2 = area->dx + area->width; - y2 = area->dy + area->height; - area->dx = area->dx > 0 ? area->dx : 0; - area->dy = area->dy > 0 ? area->dy : 0; - x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; - y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; - area->width = x2 - area->dx; - area->height = y2 - area->dy; + /* + * We could use hardware clipping but on many cards you get around + * hardware clipping by writing to framebuffer directly. + */ + x2 = area->dx + area->width; + y2 = area->dy + area->height; + area->dx = area->dx > 0 ? area->dx : 0; + area->dy = area->dy > 0 ? area->dy : 0; + x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; + y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; + area->width = x2 - area->dx; + area->height = y2 - area->dy; - /* update sx1,sy1 */ - area->sx += (area->dx - old_dx); - area->sy += (area->dy - old_dy); + /* update sx1,sy1 */ + area->sx += (area->dx - old_dx); + area->sy += (area->dy - old_dy); - height = area->height; + height = area->height; - /* the source must be completely inside the virtual screen */ - if (area->sx < 0 || area->sy < 0 || (area->sx + area->width) > p->var.xres_virtual || - (area->sy + area->height) > p->var.yres_virtual) return; + /* the source must be completely inside the virtual screen */ + if (area->sx < 0 || area->sy < 0 || + (area->sx + area->width) > p->var.xres_virtual || + (area->sy + area->height) > p->var.yres_virtual) + return; - if (area->dy < area->sy || (area->dy == area->sy && area->dx < area->sx)) { - /* start at the top */ - src1 = p->screen_base + area->sy * linesize + - ((area->sx * p->var.bits_per_pixel) >> 3); - dst1 = p->screen_base + area->dy * linesize + - ((area->dx * p->var.bits_per_pixel) >> 3); - lineincr = linesize; - } else { - /* start at the bottom */ - src1 = p->screen_base + (area->sy + area->height - 1) * linesize + - (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3); - dst1 = p->screen_base + (area->dy + area->height - 1) * linesize + - (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3); - lineincr = -linesize; - } + if (area->dy < area->sy || (area->dy == area->sy && area->dx < area->sx)) { + /* start at the top */ + src1 = p->screen_base + area->sy * linesize + + ((area->sx * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + area->dy * linesize + + ((area->dx * p->var.bits_per_pixel) >> 3); + lineincr = linesize; + } else { + /* start at the bottom */ + src1 = p->screen_base + (area->sy + area->height-1)*linesize + + (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + (area->dy + area->height-1)*linesize + + (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3); + lineincr = -linesize; + } - if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { - int ppw = BITS_PER_LONG/p->var.bits_per_pixel; - int n = ((area->width * p->var.bits_per_pixel) >> 3); + if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { + int ppw = BITS_PER_LONG/p->var.bits_per_pixel; + int n = ((area->width * p->var.bits_per_pixel) >> 3); - start_index = ((unsigned long) src1 & (bpl-1)); - end_index = ((unsigned long) (src1 + n) & (bpl-1)); - shift = ((unsigned long)dst1 & (bpl-1)) - ((unsigned long) src1 & (bpl-1)); - start_mask = end_mask = 0; + start_index = ((unsigned long) src1 & (bpl-1)); + end_index = ((unsigned long) (src1 + n) & (bpl-1)); + shift = ((unsigned long)dst1 & (bpl-1)) - ((unsigned long) src1 & (bpl-1)); + start_mask = end_mask = 0; - if (start_index) { - start_mask = -1 >> (start_index << 3); - n -= (bpl - start_index); - } + if (start_index) { + start_mask = -1 >> (start_index << 3); + n -= (bpl - start_index); + } - if (end_index) { - end_mask = -1 << ((bpl - end_index) << 3); - n -= end_index; - } - n = n/bpl; + if (end_index) { + end_mask = -1 << ((bpl - end_index) << 3); + n -= end_index; + } + n = n/bpl; - if (n <= 0) { - if (start_mask) { - if (end_mask) - end_mask &= start_mask; - else - end_mask = start_mask; - start_mask = 0; - } - n = 0; - } + if (n <= 0) { + if (start_mask) { + if (end_mask) + end_mask &= start_mask; + else + end_mask = start_mask; + start_mask = 0; + } + n = 0; + } - if (shift) { - if (shift > 0) { - /* dest is over to right more */ - shift_right= shift * p->var.bits_per_pixel; - shift_left= (ppw - shift) * p->var.bits_per_pixel; - } else { - /* source is to the right more */ - shift_right= (ppw + shift) * p->var.bits_per_pixel; - shift_left= -shift * p->var.bits_per_pixel; - } - /* general case, positive increment */ - if (lineincr > 0) { - if (shift < 0) - n++; - do { - dst = (unsigned long *)dst1; - src = (unsigned long *)src1; + if (shift) { + if (shift > 0) { + /* dest is over to right more */ + shift_right = shift * p->var.bits_per_pixel; + shift_left = (ppw - shift) * p->var.bits_per_pixel; + } else { + /* source is to the right more */ + shift_right = (ppw + shift) * p->var.bits_per_pixel; + shift_left = -shift * p->var.bits_per_pixel; + } + /* general case, positive increment */ + if (lineincr > 0) { + if (shift < 0) + n++; + do { + dst = (unsigned long *) dst1; + src = (unsigned long *) src1; - last = (fb_readl(src) & start_mask); + last = (fb_readl(src) & start_mask); - if (shift > 0) - fb_writel(fb_readl(dst) | (last >> shift_right), dst); - for (j = 0; j<n; j++) { - dst++; - tmp = fb_readl(src); - src++; - fb_writel((last << shift_left) | - (tmp >> shift_right),dst); - last = tmp; - src++; - } - fb_writel(fb_readl(dst) | (last << shift_left), - dst); - src1 += lineincr; - dst1 += lineincr; - } while (--height); - } else { - /* general case, negative increment */ - if (shift > 0) - n++; - do { - dst = (unsigned long *)dst1; - src = (unsigned long *)src1; + if (shift > 0) + fb_writel(fb_readl(dst) | (last >> shift_right), dst); + for (j = 0; j < n; j++) { + dst++; + tmp = fb_readl(src); + src++; + fb_writel((last << shift_left) | + (tmp >> shift_right),dst); + last = tmp; + src++; + } + fb_writel(fb_readl(dst) | (last << shift_left), dst); + src1 += lineincr; + dst1 += lineincr; + } while (--height); + } else { + /* general case, negative increment */ + if (shift > 0) + n++; + do { + dst = (unsigned long *) dst1; + src = (unsigned long *) src1; - last = (fb_readl(src) & end_mask); + last = (fb_readl(src) & end_mask); - if (shift < 0) + if (shift < 0) + fb_writel(fb_readl(dst) | (last >> shift_right), dst); + for (j = 0; j < n; j++) { + dst--; + tmp = fb_readl(src); + src--; + fb_writel((tmp << shift_left) | + (last >> shift_right),dst); + last = tmp; + src--; + } fb_writel(fb_readl(dst) | (last >> shift_right), dst); - for ( j=0; j<n; j++) { - dst--; - tmp = fb_readl(src); - src--; - fb_writel((tmp << shift_left) | - (last >> shift_right),dst); - last = tmp; - src--; - } - fb_writel(fb_readl(dst) | (last >> shift_right), - dst); - src1 += lineincr; - dst1 += lineincr; - } while (--height); - } - } else { - /* no shift needed */ - if (lineincr > 0) { - /* positive increment */ - do { - dst = (unsigned long *) (dst1 - start_index); - src = (unsigned long *) (src1 - start_index); - - if (start_mask) - fb_writel(fb_readl(src) | start_mask, dst); + src1 += lineincr; + dst1 += lineincr; + } while (--height); + } + } else { + /* no shift needed */ + if (lineincr > 0) { + /* positive increment */ + do { + dst = (unsigned long *) (dst1 - start_index); + src = (unsigned long *) (src1 - start_index); + + if (start_mask) + fb_writel(fb_readl(src) | start_mask, dst); - for (j = 0; j < n; j++) { - fb_writel(fb_readl(src), dst); - dst++; - src++; - } + for (j = 0; j < n; j++) { + fb_writel(fb_readl(src), dst); + dst++; + src++; + } - if (end_mask) - fb_writel(fb_readl(src) | end_mask,dst); - src1 += lineincr; - dst1 += lineincr; - } while (--height); - } else { - /* negative increment */ - do { - dst = (unsigned long *)dst1; - src = (unsigned long *)src1; + if (end_mask) + fb_writel(fb_readl(src) | end_mask,dst); + src1 += lineincr; + dst1 += lineincr; + } while (--height); + } else { + /* negative increment */ + do { + dst = (unsigned long *) dst1; + src = (unsigned long *) src1; - if (start_mask) - fb_writel(fb_readl(src) | start_mask, dst); - for (j = 0; j < n; j++) { - fb_writel(fb_readl(src), dst); - dst--; - src--; - } - src1 += lineincr; - dst1 += lineincr; - } while (--height); + if (start_mask) + fb_writel(fb_readl(src) | start_mask, dst); + for (j = 0; j < n; j++) { + fb_writel(fb_readl(src), dst); + dst--; + src--; + } + src1 += lineincr; + dst1 += lineincr; + } while (--height); + } } - } - } + } } Index: cfbfillrect.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbfillrect.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cfbfillrect.c 6 Mar 2002 23:05:56 -0000 1.7 +++ cfbfillrect.c 12 Mar 2002 20:33:19 -0000 1.8 @@ -24,175 +24,166 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) { - unsigned long start_index, end_index, start_mask = 0, end_mask = 0; - unsigned long height, ppw, fg, fgcolor; - int i, n, x2, y2, linesize = p->fix.line_length; - int bpl = sizeof(unsigned long); - unsigned long *dst; - char *dst1; + unsigned long start_index, end_index, start_mask = 0, end_mask = 0; + unsigned long height, ppw, fg, fgcolor; + int i, n, x2, y2, linesize = p->fix.line_length; + int bpl = sizeof(unsigned long); + unsigned long *dst; + char *dst1; - if (!rect->width || !rect->height) return; + if (!rect->width || !rect->height) return; - /* We could use hardware clipping but on many cards you get around hardware - clipping by writing to framebuffer directly. */ - x2 = rect->dx + rect->width; - y2 = rect->dy + rect->height; - x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; - y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; - rect->width = x2 - rect->dx; - height = y2 - rect->dy; - - /* Size of the scanline in bytes */ - n = ((rect->width * p->var.bits_per_pixel) >> 3); - ppw = BITS_PER_LONG/p->var.bits_per_pixel; + /* We could use hardware clipping but on many cards you get around + * hardware clipping by writing to framebuffer directly. */ + x2 = rect->dx + rect->width; + y2 = rect->dy + rect->height; + x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; + y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; + rect->width = x2 - rect->dx; + height = y2 - rect->dy; - dst1 = p->screen_base + rect->dy * linesize + ((rect->dx * p->var.bits_per_pixel) >> 3); - start_index = ((unsigned long) dst1 & (bpl-1)); - end_index = ((unsigned long)(dst1 + n) & (bpl-1)); + /* Size of the scanline in bytes */ + n = ((rect->width * p->var.bits_per_pixel) >> 3); + ppw = BITS_PER_LONG/p->var.bits_per_pixel; - // printk("start_index is %ld\n", start_index); - // printk("end_index is %ld\n", end_index); - // printk("width is %d\n", width); + dst1 = p->screen_base + rect->dy * linesize + ((rect->dx * p->var.bits_per_pixel) >> 3); + start_index = ((unsigned long) dst1 & (bpl-1)); + end_index = ((unsigned long)(dst1 + n) & (bpl-1)); - if (p->fix.visual == FB_VISUAL_TRUECOLOR) - fg = fgcolor = ((u32 *)(p->pseudo_palette))[rect->color]; - else - fg = fgcolor = rect->color; + if (p->fix.visual == FB_VISUAL_TRUECOLOR) + fg = fgcolor = ((u32 *)(p->pseudo_palette))[rect->color]; + else + fg = fgcolor = rect->color; - for (i = 0; i < ppw-1; i++) { - fg <<= p->var.bits_per_pixel; - fg |= fgcolor; - } + for (i = 0; i < ppw-1; i++) { + fg <<= p->var.bits_per_pixel; + fg |= fgcolor; + } - if (start_index) { - start_mask = fg << (start_index << 3); - n -= (bpl - start_index); - } + if (start_index) { + start_mask = fg << (start_index << 3); + n -= (bpl - start_index); + } - if (end_index) { - end_mask = fg >> ((bpl - end_index) << 3); - n -= end_index; - } - - n = n/bpl; + if (end_index) { + end_mask = fg >> ((bpl - end_index) << 3); + n -= end_index; + } - if (n <= 0) { - if (start_mask) { - if (end_mask) - end_mask &= start_mask; - else - end_mask = start_mask; - start_mask = 0; - } - n = 0; - } + n = n/bpl; - // printk("start_mask is %ld\n", start_mask); -// printk("end_mask is %ld\n", end_mask); -// printk("n is %d\n", n); + if (n <= 0) { + if (start_mask) { + if (end_mask) + end_mask &= start_mask; + else + end_mask = start_mask; + start_mask = 0; + } + n = 0; + } - if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { - switch (rect->rop) { - case ROP_COPY: - do { - /* Word align to increases performace :-) */ - dst = (unsigned long *) (dst1 - start_index); + if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { + switch (rect->rop) { + case ROP_COPY: + do { + /* Word align to increases performace :-) */ + dst = (unsigned long *) (dst1 - start_index); - if (start_mask) { + if (start_mask) { #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) | start_mask, dst); + fb_writel(fb_readl(dst) | start_mask, dst); #else - fb_writeq(fb_readq(dst) | start_mask, dst); + fb_writeq(fb_readq(dst) | start_mask, dst); #endif - dst++; - } + dst++; + } - for(i=0;i<n;i++) { + for ( i=0; i < n; i++) { #if BITS_PER_LONG == 32 - fb_writel(fg, dst); + fb_writel(fg, dst); #else - fb_writeq(fg, dst); + fb_writeq(fg, dst); #endif - dst++; - } + dst++; + } - if (end_mask) + if (end_mask) #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) | end_mask, dst); + fb_writel(fb_readl(dst) | end_mask, dst); #else - fb_writeq(fb_readq(dst) | end_mask, dst); + fb_writeq(fb_readq(dst) | end_mask, dst); #endif - dst1+=linesize; - } while (--height); - break; - case ROP_XOR: - do { - dst = (unsigned long *) (dst1 - start_index); - + dst1+=linesize; + } while (--height); + break; + case ROP_XOR: + do { + dst = (unsigned long *) (dst1 - start_index); #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) ^ start_mask, dst); + fb_writel(fb_readl(dst) ^ start_mask, dst); #else - fb_writeq(fb_readq(dst) ^ start_mask, dst); + fb_writeq(fb_readq(dst) ^ start_mask, dst); #endif - for(i=0;i<n;i++) { - dst++; + for( i=0; i < n; i++) { + dst++; #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) ^ fg, dst); + fb_writel(fb_readl(dst) ^ fg, dst); #else - fb_writeq(fb_readq(dst) ^ fg, dst); + fb_writeq(fb_readq(dst) ^ fg, dst); #endif - } + } - if (end_mask) { - dst++; + if (end_mask) { + dst++; #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) ^ end_mask, dst); + fb_writel(fb_readl(dst) ^ end_mask, dst); #else - fb_writeq(fb_readq(dst) ^ end_mask, dst); + fb_writeq(fb_readq(dst) ^ end_mask, dst); #endif - } - dst1+=linesize; - } while (--height); - break; - } - } else { - /* Odd modes like 24 or 80 bits per pixel */ - start_mask = fg >> (start_index * p->var.bits_per_pixel); - end_mask = fg << (end_index * p->var.bits_per_pixel); - /* start_mask =& PFILL24(x1,fg); - end_mask_or = end_mask & PFILL24(x1+width-1,fg); */ + } + dst1+=linesize; + } while (--height); + break; + } + } else { + /* Odd modes like 24 or 80 bits per pixel */ + start_mask = fg >> (start_index * p->var.bits_per_pixel); + end_mask = fg << (end_index * p->var.bits_per_pixel); + /* start_mask =& PFILL24(x1,fg); + end_mask_or = end_mask & PFILL24(x1+width-1,fg); */ - n = (rect->width - start_index - end_index)/ppw; + n = (rect->width - start_index - end_index)/ppw; - switch (rect->rop) { - case ROP_COPY: - do { - dst = (unsigned long *)dst1; - if (start_mask) *dst |= start_mask; - if ((start_index + rect->width) > ppw) dst++; + switch (rect->rop) { + case ROP_COPY: + do { + dst = (unsigned long *)dst1; + if (start_mask) *dst |= start_mask; + if ((start_index + rect->width) > ppw) dst++; - /* XXX: slow */ - for(i=0;i<n;i++) { - *dst++ = fg; - } - if (end_mask) *dst |= end_mask; - dst1+=linesize; - } while (--height); - break; - case ROP_XOR: - do { - dst = (unsigned long *)dst1; - if (start_mask) *dst ^= start_mask; - if ((start_mask + rect->width) > ppw) dst++; + /* XXX: slow */ + for (i = 0;i < n; i++) { + *dst++ = fg; + } + if (end_mask) *dst |= end_mask; + dst1+=linesize; + } while (--height); + break; + case ROP_XOR: + do { + dst = (unsigned long *)dst1; + if (start_mask) *dst ^= start_mask; + if ((start_mask + rect->width) > ppw) dst++; - for(i=0;i<n;i++) { - *dst++ ^= fg; /* PFILL24(fg,x1+i); */ + for( i = 0; i < n; i++) { + *dst++ ^= fg; /* PFILL24(fg,x1+i); */ + } + if (end_mask) *dst ^= end_mask; + dst1+=linesize; + } while (--height); + break; + } } - if (end_mask) *dst ^= end_mask; - dst1+=linesize; - } while (--height); - break; - } - } - return; + return; } |
From: johann d. <jd...@us...> - 2002-03-11 23:25:49
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv1717 Modified Files: hid-ff.c Log Message: Removed timer code. I will add it later when the current code has stabilized. Code cosmetics. Index: hid-ff.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-ff.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hid-ff.c 10 Mar 2002 17:19:57 -0000 1.3 +++ hid-ff.c 11 Mar 2002 23:25:46 -0000 1.4 @@ -27,10 +27,6 @@ * e-mail - mail your message to <de...@if...> */ -#if 0 -#include <linux/timer.h> -#endif - #include <linux/input.h> #include <linux/sched.h> @@ -87,53 +83,56 @@ + +/* **************************************************************************/ /* Implements the protocol used by the Logitech WingMan Cordless rumble pad */ +/* **************************************************************************/ #ifdef CONFIG_LOGITECH_RUMBLE +#define LGFF_CHECK_OWNERSHIP(i, l) \ + (i>=0 && i<LGFF_EFFECTS \ + && test_bit(EFFECT_USED, l->effects[i].flags) \ + && CHECK_OWNERSHIP(l->effects[i])) + +#define LGFF_BUFFER_SIZE 8 +#define LGFF_EFFECTS 8 + struct lgff_effect { pid_t owner; unsigned char left; /* Magnitude of vibration for left motor */ unsigned char right; /* Magnitude of vibration for right motor */ struct ff_replay replay; unsigned long flags[1]; -#if 0 - struct timer_list timer; -#endif }; -#define LGFF_CHECK_OWNERSHIP(i, l) \ - (i>=0 && i<LGFF_EFFECTS && \ - test_bit(EFFECT_USED, l->effects[i].flags) && CHECK_OWNERSHIP(l->effects[i])) - -#define LGFF_BUFFER_SIZE 8 -#define LGFF_EFFECTS 8 - struct hid_ff_logitech { - struct urb* urbffout; /* Output URB used to send ff commands */ - struct usb_ctrlrequest ffcr; /* ff commands are sent using control URBs */ + struct urb* urbffout; /* Output URB used to send ff commands */ + struct usb_ctrlrequest ffcr; /* ff commands use control URBs */ char buf[LGFF_BUFFER_SIZE]; struct lgff_effect effects[LGFF_EFFECTS]; }; + static void hid_lgff_ctrl_out(struct urb *urb); static void hid_lgff_exit(struct hid_device* hid); static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, unsigned int type, unsigned int code, int value); static void hid_lgff_make_rumble(struct hid_device* hid); -static void hid_lgff_timer(unsigned long id); static int hid_lgff_flush(struct input_dev *input, struct file *file); -static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect); +static int hid_lgff_upload_effect(struct input_dev* input, + struct ff_effect* effect); static int hid_lgff_erase(struct input_dev *input, int id); + static int hid_lgff_init(struct hid_device* hid) { struct hid_ff_logitech *private; - int i; /* Private data */ - private = hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); + hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); + private = hid->ff_private; if (!private) return -1; memset(private, 0, sizeof(struct hid_ff_logitech)); @@ -150,7 +149,9 @@ return -1; } - usb_fill_control_urb(private->urbffout, hid->dev, 0, (void*) &private->ffcr, private->buf, 8, hid_lgff_ctrl_out, hid); + usb_fill_control_urb(private->urbffout, hid->dev, 0, + (void*) &private->ffcr, private->buf, 8, + hid_lgff_ctrl_out, hid); dbg("Created ff output control urb"); /* Input init */ @@ -160,16 +161,6 @@ set_bit(EV_FF, hid->input.evbit); hid->input.ff_effects_max = LGFF_EFFECTS; - /* Initialize array of effects */ - memset(private->effects, 0, LGFF_EFFECTS * sizeof(struct lgff_effect)); - for (i=0; i<LGFF_EFFECTS; ++i) { -#if 0 - init_timer(&lgff_effects[i].timer); - private->effects[i].timer.data = i; - private->effects[i].timer.function = hid_lgff_timer; -#endif - } - printk(KERN_INFO "Force feedback for Logitech rumble devices by Johann Deneux <de...@if...>\n"); return 0; @@ -185,64 +176,28 @@ } } -#if 0 -static void hid_lgff_timer(unsigned long id) -{ - struct lgff_effect *effect = lgff_effects + id; - - if (test_bit(EFFECT_STARTED, effect->flags)) { - clear_bit(EFFECT_STARTED, effect->flags); - if (effect->replay.length != 0) { - set_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_make_rumble(hid); - mod_timer(&effect->timer, RUN_AT(effect->replay.length * HZ / 1000)); - } - } else if (test_bit(EFFECT_PLAYING, effect->flags)) { - } else { - /* BUG */ - } - -} -#endif - static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, unsigned int type, unsigned int code, int value) { struct hid_ff_logitech *lgff = hid->ff_private; + struct lgff_effect *effect = lgff->effects + code; - if (type == EV_FF) { - - if (LGFF_CHECK_OWNERSHIP(code, lgff)) { - struct lgff_effect *effect = lgff->effects + code; - struct timer_list* timer; + if (type != EV_FF) return -EINVAL; + + if (!LGFF_CHECK_OWNERSHIP(code, lgff)) return -EACCES; - if (value > 0) { -#if 0 - if (effect->replay.delay != 0) { - set_bit(EFFECT_STARTED, effect->flags); - clear_bit(EFFECT_PLAYING, effect->flags); - - mod_timer(&effect->timer, RUN_AT(effect->replay.delay * HZ / 1000)); - } else if (effect->replay.length != 0) { - clear_bit(EFFECT_STARTED, effect->flags); - set_bit(EFFECT_PLAYING, effect->flags); - - hid_lgff_make_rumble(hid); - mod_timer(&effect->timer, RUN_AT(effect->replay.length * HZ / 1000)); - } -#else - set_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_make_rumble(hid); - } else if (value == 0) { - clear_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_make_rumble(hid); - } + if (value < 0) return -EINVAL; -#endif - return 0; - } else return -EACCES; + if (value > 0) { + set_bit(EFFECT_PLAYING, effect->flags); + hid_lgff_make_rumble(hid); + } else /* value == 0*/ { + clear_bit(EFFECT_PLAYING, effect->flags); + hid_lgff_make_rumble(hid); } - else return -EINVAL; + + return 0; + } static void hid_lgff_make_rumble(struct hid_device* hid) @@ -268,12 +223,14 @@ lgff->buf[3] = left > 0x7f ? 0x7f : left; lgff->buf[4] = right > 0x7f ? 0x7f : right; - /*FIXME: may need a queue. I should at least check if the urb is available */ + /*FIXME: needs a queue. I should at least check if the urb is + available */ lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; lgff->ffcr.bRequest = 9; - lgff->ffcr.wValue = 0x0203; /*NOTE: Potential problem with little/big endian */ + lgff->ffcr.wValue = 0x0203; /*NOTE: Potential problem with + little/big endian */ lgff->ffcr.wIndex = 0; lgff->urbffout->dev = hid->dev; @@ -299,12 +256,12 @@ input_report_ff(dev, i, 0); /* Free ressources assigned to effect */ - if (hid_lgff_erase(dev, i)) { + if (hid_lgff_erase(dev, i)) warn("erase effect %d failed\n", i); - } } } + return 0; } @@ -313,15 +270,12 @@ struct hid_device *hid = dev->private; struct hid_ff_logitech *lgff = hid->ff_private; - if (LGFF_CHECK_OWNERSHIP(id, lgff)) { + if (!LGFF_CHECK_OWNERSHIP(id, lgff)) return -EACCES; - input_report_ff(dev, id, 0); /* Stop effect */ - lgff->effects[id].flags[0] = 0; + input_report_ff(dev, id, 0); /* Stop effect */ + lgff->effects[id].flags[0] = 0; - return 0; - } else { - return -EACCES; - } + return 0; } static void hid_lgff_ctrl_out(struct urb *urb) @@ -343,38 +297,37 @@ if (!test_bit(effect->type, input->ffbit)) return -EINVAL; + if (effect->type != FF_RUMBLE) return -EINVAL; + if (effect->id == -1) { int i; + for (i=0; i<LGFF_EFFECTS && test_bit(EFFECT_USED, lgff->effects[i].flags); ++i); if (i >= LGFF_EFFECTS) return -ENOSPC; + effect->id = i; lgff->effects[i].owner = current->pid; set_bit(EFFECT_USED, lgff->effects[i].flags); - } else { - if (!LGFF_CHECK_OWNERSHIP(effect->id, lgff)) return -EACCES; } + else if (!LGFF_CHECK_OWNERSHIP(effect->id, lgff)) return -EACCES; + id = effect->id; new = lgff->effects[id]; - switch (effect->type) { - case FF_RUMBLE: - new.right = effect->u.rumble.strong_magnitude >> 9; - new.left = effect->u.rumble.weak_magnitude >> 9; - new.replay = effect->replay; - break; - - default: - return -EINVAL; - } + new.right = effect->u.rumble.strong_magnitude >> 9; + new.left = effect->u.rumble.weak_magnitude >> 9; + new.replay = effect->replay; - /* If we updated an effect that was being played, we need to remake the rumble effect */ + /* If we updated an effect that was being played, we need to remake + the rumble effect */ if (test_bit(EFFECT_STARTED, lgff->effects[id].flags) || test_bit(EFFECT_STARTED, lgff->effects[id].flags)) { - /* Changing replay parameters is not allowed (for the time being) */ + /* Changing replay parameters is not allowed (for the time + being) */ if (new.replay.delay != lgff->effects[id].replay.delay || new.replay.length != lgff->effects[id].replay.length) - return -EPERM; + return -ENOSYS; lgff->effects[id] = new; hid_lgff_make_rumble(hid); |
From: James S. <jsi...@us...> - 2002-03-11 21:37:26
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv1966 Modified Files: cfbimgblt.c Log Message: Fixed soft accel image drawing function. Fonts work at 8,16,32 bpp. Index: cfbimgblt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbimgblt.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cfbimgblt.c 6 Mar 2002 23:05:56 -0000 1.8 +++ cfbimgblt.c 11 Mar 2002 21:37:23 -0000 1.9 @@ -43,13 +43,12 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) { - unsigned long end_index, end_mask, mask, eorx; - int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l; - int linesize = p->fix.line_length; - unsigned long fgx, bgx, fgcolor, bgcolor; - unsigned long *dst, *src = NULL; - long tmp = -1 >> (BITS_PER_LONG - p->var.bits_per_pixel); - u8 *dst1, *src1; + int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l = 7; + unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel); + unsigned long fgx, bgx, fgcolor, bgcolor, eorx; + unsigned long end_index, end_mask, mask; + unsigned long *dst = NULL; + u8 *dst1, *src; /* * We could use hardware clipping but on many cards you get around hardware @@ -64,12 +63,12 @@ image->width = x2 - image->dx; image->height = y2 - image->dy; - dst1 = p->screen_base + image->dy * linesize + + dst1 = p->screen_base + image->dy * p->fix.line_length + ((image->dx * p->var.bits_per_pixel) >> 3); ppw = BITS_PER_LONG/p->var.bits_per_pixel; - src1 = image->data; + src = image->data; if (p->fix.visual == FB_VISUAL_TRUECOLOR) { fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color]; @@ -86,18 +85,19 @@ bgx |= bgcolor; } eorx = fgx ^ bgx; - l = 8; + l = 7; for (i = 0; i < image->height; i++) { dst = (unsigned long *) dst1; for (j = image->width/ppw; j > 0; j--) { mask = 0; - for (k = ppw; k > 0; k--) { - if (test_bit(l, src1)) - mask |= (tmp << (p->var.bits_per_pixel*(ppw-k))); + + for (k = ppw; k > 0; k--) { + if (test_bit(l, src)) + mask |= (tmp >> (p->var.bits_per_pixel*(k-1))); l--; - if (!l) { l = 8; src1++; } + if (l < 0) { l = 7; src++; } } fb_writel((mask & eorx)^bgx, dst); dst++; |
From: johann d. <jd...@us...> - 2002-03-10 17:19:59
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv23608 Modified Files: hid-ff.c Log Message: Added support for several effects. Added flush and erase callbacks. Index: hid-ff.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-ff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- hid-ff.c 10 Mar 2002 12:26:40 -0000 1.2 +++ hid-ff.c 10 Mar 2002 17:19:57 -0000 1.3 @@ -27,8 +27,12 @@ * e-mail - mail your message to <de...@if...> */ +#if 0 +#include <linux/timer.h> +#endif #include <linux/input.h> +#include <linux/sched.h> #undef DEBUG @@ -36,6 +40,15 @@ #include "hid.h" +/* Effect status */ +#define EFFECT_STARTED 0 /* Effect is going to play after some time (ff_replay.delay) */ +#define EFFECT_PLAYING 1 /* Effect is being played */ +#define EFFECT_USED 2 + +/* Check that the current process can access an effect */ +#define CHECK_OWNERSHIP(effect) (current->pid == 0 || effect.owner == current->pid) + + /* Drivers' initializing functions */ static int hid_lgff_init(struct hid_device* hid); @@ -63,7 +76,7 @@ return init->idVendor? init : NULL; } -int hid_init_ff(struct hid_device* hid) +int hid_ff_init(struct hid_device* hid) { struct hid_ff_initializer *init; @@ -78,33 +91,54 @@ #ifdef CONFIG_LOGITECH_RUMBLE +struct lgff_effect { + pid_t owner; + unsigned char left; /* Magnitude of vibration for left motor */ + unsigned char right; /* Magnitude of vibration for right motor */ + struct ff_replay replay; + unsigned long flags[1]; +#if 0 + struct timer_list timer; +#endif +}; + +#define LGFF_CHECK_OWNERSHIP(i, l) \ + (i>=0 && i<LGFF_EFFECTS && \ + test_bit(EFFECT_USED, l->effects[i].flags) && CHECK_OWNERSHIP(l->effects[i])) + #define LGFF_BUFFER_SIZE 8 +#define LGFF_EFFECTS 8 struct hid_ff_logitech { struct urb* urbffout; /* Output URB used to send ff commands */ struct usb_ctrlrequest ffcr; /* ff commands are sent using control URBs */ char buf[LGFF_BUFFER_SIZE]; - unsigned char left; /* Magnitude of left motor */ - unsigned char right; /* Magnitude of right motor */ - int play; /* Enable rumbling */ + struct lgff_effect effects[LGFF_EFFECTS]; }; static void hid_lgff_ctrl_out(struct urb *urb); -static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect); static void hid_lgff_exit(struct hid_device* hid); static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, unsigned int type, unsigned int code, int value); static void hid_lgff_make_rumble(struct hid_device* hid); +static void hid_lgff_timer(unsigned long id); + +static int hid_lgff_flush(struct input_dev *input, struct file *file); +static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect); +static int hid_lgff_erase(struct input_dev *input, int id); static int hid_lgff_init(struct hid_device* hid) { struct hid_ff_logitech *private; + int i; /* Private data */ private = hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); + if (!private) return -1; + memset(private, 0, sizeof(struct hid_ff_logitech)); - if (!hid->ff_private) return -1; + hid->ff_private = private; /* Event and exit callbacks */ hid->ff_exit = hid_lgff_exit; @@ -121,10 +155,22 @@ /* Input init */ hid->input.upload_effect = hid_lgff_upload_effect; + hid->input.flush = hid_lgff_flush; set_bit(FF_RUMBLE, hid->input.ffbit); set_bit(EV_FF, hid->input.evbit); - hid->input.ff_effects_max = 1; + hid->input.ff_effects_max = LGFF_EFFECTS; + + /* Initialize array of effects */ + memset(private->effects, 0, LGFF_EFFECTS * sizeof(struct lgff_effect)); + for (i=0; i<LGFF_EFFECTS; ++i) { +#if 0 + init_timer(&lgff_effects[i].timer); + private->effects[i].timer.data = i; + private->effects[i].timer.function = hid_lgff_timer; +#endif + } + printk(KERN_INFO "Force feedback for Logitech rumble devices by Johann Deneux <de...@if...>\n"); return 0; } @@ -139,17 +185,62 @@ } } +#if 0 +static void hid_lgff_timer(unsigned long id) +{ + struct lgff_effect *effect = lgff_effects + id; + + if (test_bit(EFFECT_STARTED, effect->flags)) { + clear_bit(EFFECT_STARTED, effect->flags); + if (effect->replay.length != 0) { + set_bit(EFFECT_PLAYING, effect->flags); + hid_lgff_make_rumble(hid); + mod_timer(&effect->timer, RUN_AT(effect->replay.length * HZ / 1000)); + } + } else if (test_bit(EFFECT_PLAYING, effect->flags)) { + } else { + /* BUG */ + } + +} +#endif + static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, unsigned int type, unsigned int code, int value) { struct hid_ff_logitech *lgff = hid->ff_private; if (type == EV_FF) { - int old = lgff->play; - lgff->play = (value!=0); - if (old != lgff->play) hid_lgff_make_rumble(hid); - return 0; + if (LGFF_CHECK_OWNERSHIP(code, lgff)) { + struct lgff_effect *effect = lgff->effects + code; + struct timer_list* timer; + + if (value > 0) { +#if 0 + if (effect->replay.delay != 0) { + set_bit(EFFECT_STARTED, effect->flags); + clear_bit(EFFECT_PLAYING, effect->flags); + + mod_timer(&effect->timer, RUN_AT(effect->replay.delay * HZ / 1000)); + } else if (effect->replay.length != 0) { + clear_bit(EFFECT_STARTED, effect->flags); + set_bit(EFFECT_PLAYING, effect->flags); + + hid_lgff_make_rumble(hid); + mod_timer(&effect->timer, RUN_AT(effect->replay.length * HZ / 1000)); + } +#else + set_bit(EFFECT_PLAYING, effect->flags); + hid_lgff_make_rumble(hid); + } else if (value == 0) { + clear_bit(EFFECT_PLAYING, effect->flags); + hid_lgff_make_rumble(hid); + } + +#endif + return 0; + } else return -EACCES; } else return -EINVAL; } @@ -159,17 +250,25 @@ struct hid_ff_logitech *lgff = hid->ff_private; char packet[] = {0x03, 0x42, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00}; int err; - + int left = 0, right = 0; + int i; + dbg("in hid_make_rumble"); memcpy(lgff->buf, packet, 8); - if (lgff->play) { - lgff->buf[3] = lgff->left; - lgff->buf[4] = lgff->right; - } else { - lgff->buf[3] = 0; - lgff->buf[4] = 0; + + + for (i=0; i<LGFF_EFFECTS; ++i) { + if (test_bit(EFFECT_USED, lgff->effects[i].flags) + && test_bit(EFFECT_PLAYING, lgff->effects[i].flags)) { + left += lgff->effects[i].left; + right += lgff->effects[i].right; + } } + lgff->buf[3] = left > 0x7f ? 0x7f : left; + lgff->buf[4] = right > 0x7f ? 0x7f : right; + + /*FIXME: may need a queue. I should at least check if the urb is available */ lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; @@ -184,6 +283,47 @@ dbg("rumble urb submited"); } +static int hid_lgff_flush(struct input_dev *dev, struct file *file) +{ + struct hid_device *hid = dev->private; + struct hid_ff_logitech *lgff = hid->ff_private; + int i; + + /* Erase all effects this process owns */ + for (i=0; i<dev->ff_effects_max; ++i) { + + if (test_bit(EFFECT_USED, lgff->effects[i].flags) && + current->pid == lgff->effects[i].owner) { + + /* Stop effect */ + input_report_ff(dev, i, 0); + + /* Free ressources assigned to effect */ + if (hid_lgff_erase(dev, i)) { + warn("erase effect %d failed\n", i); + } + } + + } + return 0; +} + +static int hid_lgff_erase(struct input_dev *dev, int id) +{ + struct hid_device *hid = dev->private; + struct hid_ff_logitech *lgff = hid->ff_private; + + if (LGFF_CHECK_OWNERSHIP(id, lgff)) { + + input_report_ff(dev, id, 0); /* Stop effect */ + lgff->effects[id].flags[0] = 0; + + return 0; + } else { + return -EACCES; + } +} + static void hid_lgff_ctrl_out(struct urb *urb) { struct hid_device *hid = urb->context; @@ -196,20 +336,51 @@ { struct hid_device *hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; - + struct lgff_effect new; + int id; + dbg("ioctl rumble"); if (!test_bit(effect->type, input->ffbit)) return -EINVAL; + if (effect->id == -1) { + int i; + for (i=0; i<LGFF_EFFECTS && test_bit(EFFECT_USED, lgff->effects[i].flags); ++i); + if (i >= LGFF_EFFECTS) return -ENOSPC; + effect->id = i; + lgff->effects[i].owner = current->pid; + set_bit(EFFECT_USED, lgff->effects[i].flags); + } else { + if (!LGFF_CHECK_OWNERSHIP(effect->id, lgff)) return -EACCES; + } + id = effect->id; + new = lgff->effects[id]; + switch (effect->type) { case FF_RUMBLE: - lgff->left = effect->u.rumble.strong_magnitude >> 9; - lgff->right = effect->u.rumble.weak_magnitude >> 9; - + new.right = effect->u.rumble.strong_magnitude >> 9; + new.left = effect->u.rumble.weak_magnitude >> 9; + new.replay = effect->replay; break; default: return -EINVAL; + } + + /* If we updated an effect that was being played, we need to remake the rumble effect */ + if (test_bit(EFFECT_STARTED, lgff->effects[id].flags) + || test_bit(EFFECT_STARTED, lgff->effects[id].flags)) { + + /* Changing replay parameters is not allowed (for the time being) */ + if (new.replay.delay != lgff->effects[id].replay.delay + || new.replay.length != lgff->effects[id].replay.length) + return -EPERM; + + lgff->effects[id] = new; + hid_lgff_make_rumble(hid); + + } else { + lgff->effects[id] = new; } return 0; |
From: johann d. <jd...@us...> - 2002-03-10 17:02:59
|
Update of /cvsroot/linuxconsole/ruby/utils In directory usw-pr-cvs1:/tmp/cvs-serv16640 Modified Files: fftest.c Log Message: Created a weak and a strong rumble effect. Index: fftest.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/fftest.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- fftest.c 8 Mar 2002 19:29:53 -0000 1.16 +++ fftest.c 10 Mar 2002 17:02:53 -0000 1.17 @@ -1,4 +1,6 @@ /* + * $id$ + * * Tests the force feedback driver * Copyright 2001-2002 Johann Deneux <de...@if...> */ @@ -37,7 +39,16 @@ #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) -#define N_EFFECTS 5 +#define N_EFFECTS 6 + +char* effect_names[] = { + "Sine vibration", + "Constant Force", + "Spring Condition", + "Damping Condition", + "Strong Rumble", + "Weak Rumble" +}; int main(int argc, char** argv) { @@ -101,24 +112,6 @@ printf("%d\n", n_effects); - /* download a constant effect */ - effects[1].type = FF_CONSTANT; - effects[1].id = -1; - effects[1].u.constant.level = 0x2000; /* Strength : 25 % */ - effects[1].direction = 0x6000; /* 135 degrees */ - effects[1].u.constant.envelope.attack_length = 0x100; - effects[1].u.constant.envelope.attack_level = 0; - effects[1].u.constant.envelope.fade_length = 0x100; - effects[1].u.constant.envelope.fade_level = 0; - effects[1].trigger.button = 0; - effects[1].trigger.interval = 0; - effects[1].replay.length = 20000; /* 20 seconds */ - effects[1].replay.delay = 0; - - if (ioctl(fd, EVIOCSFF, &effects[1]) == -1) { - perror("Upload effects[1]"); - } - /* download a periodic sinusoidal effect */ effects[0].type = FF_PERIODIC; effects[0].id = -1; @@ -140,6 +133,24 @@ if (ioctl(fd, EVIOCSFF, &effects[0]) == -1) { perror("Upload effects[0]"); } + + /* download a constant effect */ + effects[1].type = FF_CONSTANT; + effects[1].id = -1; + effects[1].u.constant.level = 0x2000; /* Strength : 25 % */ + effects[1].direction = 0x6000; /* 135 degrees */ + effects[1].u.constant.envelope.attack_length = 0x100; + effects[1].u.constant.envelope.attack_level = 0; + effects[1].u.constant.envelope.fade_length = 0x100; + effects[1].u.constant.envelope.fade_level = 0; + effects[1].trigger.button = 0; + effects[1].trigger.interval = 0; + effects[1].replay.length = 20000; /* 20 seconds */ + effects[1].replay.delay = 0; + + if (ioctl(fd, EVIOCSFF, &effects[1]) == -1) { + perror("Upload effects[1]"); + } /* download an condition spring effect */ effects[2].type = FF_SPRING; @@ -179,12 +190,27 @@ perror("Upload effects[3]"); } + /* a strong rumbling effect */ effects[4].type = FF_RUMBLE; - + effects[4].id = -1; + effects[4].u.rumble.strong_magnitude = 0x8000; + effects[4].u.rumble.weak_magnitude = 0; + if (ioctl(fd, EVIOCSFF, &effects[4]) == -1) { perror("Upload effects[4]"); } + /* a weak rumbling effect */ + effects[5].type = FF_RUMBLE; + effects[5].id = -1; + effects[5].u.rumble.strong_magnitude = 0; + effects[5].u.rumble.weak_magnitude = 0xc000; + + if (ioctl(fd, EVIOCSFF, &effects[5]) == -1) { + perror("Upload effects[5]"); + } + + /* Ask user what effects to play */ do { printf("Enter effect number, -1 to exit\n"); @@ -198,6 +224,8 @@ perror("Play effect"); exit(1); } + + printf("Now Playing: %s\n", effect_names[i]); } else { printf("No such effect\n"); |
From: johann d. <jd...@us...> - 2002-03-10 12:26:43
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv5822 Modified Files: hid-core.c hid-ff.c hid-input.c hid.h Log Message: Cosmetics. Moved hid_ff_exit calls to hid_free_device. Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-core.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- hid-core.c 6 Mar 2002 23:02:58 -0000 1.47 +++ hid-core.c 10 Mar 2002 12:26:40 -0000 1.48 @@ -519,6 +519,10 @@ { unsigned i,j; +#ifdef CONFIG_HID_FF + hid_ff_exit(device); +#endif + for (i = 0; i < HID_REPORT_TYPES; i++) { struct hid_report_enum *report_enum = device->report_enum + i; @@ -1374,10 +1378,6 @@ return hid; fail: -#ifdef CONFIG_HID_FF - if (hid->exit_ff) - hid->exit_ff(hid); -#endif hid_free_device(hid); if (hid->urbin) usb_free_urb(hid->urbin); if (hid->urbout) usb_free_urb(hid->urbout); @@ -1403,7 +1403,7 @@ hid_dump_device(hid); #ifdef CONFIG_HID_FF - if (hid_init_ff(hid)) { + if (hid_ff_init(hid)) { hid_free_device(hid); return NULL; } @@ -1465,10 +1465,6 @@ if (hid->urbout) usb_free_urb(hid->urbout); -#ifdef CONFIG_HID_FF - if (hid->exit_ff) - hid->exit_ff(hid); -#endif hid_free_device(hid); } Index: hid-ff.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-ff.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- hid-ff.c 6 Mar 2002 23:02:58 -0000 1.1 +++ hid-ff.c 10 Mar 2002 12:26:40 -0000 1.2 @@ -81,18 +81,19 @@ #define LGFF_BUFFER_SIZE 8 struct hid_ff_logitech { - struct urb* urbffout; /* Output URB used to send ff commands */ - struct usb_ctrlrequest ffcr; /* ff commands are sent using control URBs */ - char ffoutbuf[LGFF_BUFFER_SIZE]; - signed char rumble_left; /* Magnitude of left motor */ - signed char rumble_right; /* Magnitude of right motor */ - int rumble_play; /* Enable rumbling */ + struct urb* urbffout; /* Output URB used to send ff commands */ + struct usb_ctrlrequest ffcr; /* ff commands are sent using control URBs */ + char buf[LGFF_BUFFER_SIZE]; + unsigned char left; /* Magnitude of left motor */ + unsigned char right; /* Magnitude of right motor */ + int play; /* Enable rumbling */ }; static void hid_lgff_ctrl_out(struct urb *urb); static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect); static void hid_lgff_exit(struct hid_device* hid); -static int hid_lgff_event(struct input_dev* input, unsigned int type, unsigned int code, int value); +static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, + unsigned int type, unsigned int code, int value); static void hid_lgff_make_rumble(struct hid_device* hid); static int hid_lgff_init(struct hid_device* hid) @@ -101,10 +102,12 @@ /* Private data */ private = hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); + memset(private, 0, sizeof(struct hid_ff_logitech)); + if (!hid->ff_private) return -1; /* Event and exit callbacks */ - hid->exit_ff = hid_lgff_exit; + hid->ff_exit = hid_lgff_exit; hid->ff_event = hid_lgff_event; /* USB init */ @@ -113,7 +116,7 @@ return -1; } - FILL_CONTROL_URB(private->urbffout, hid->dev, 0, (void*) &private->ffcr, private->ffoutbuf, 8, hid_lgff_ctrl_out, hid); + usb_fill_control_urb(private->urbffout, hid->dev, 0, (void*) &private->ffcr, private->buf, 8, hid_lgff_ctrl_out, hid); dbg("Created ff output control urb"); /* Input init */ @@ -122,6 +125,7 @@ set_bit(EV_FF, hid->input.evbit); hid->input.ff_effects_max = 1; + return 0; } @@ -135,15 +139,15 @@ } } -static int hid_lgff_event(struct input_dev* input, unsigned int type, unsigned int code, int value) +static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, + unsigned int type, unsigned int code, int value) { - struct hid_device *hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; if (type == EV_FF) { - int old = lgff->rumble_play; - lgff->rumble_play = (value!=0); - if (old != lgff->rumble_play) hid_lgff_make_rumble(hid); + int old = lgff->play; + lgff->play = (value!=0); + if (old != lgff->play) hid_lgff_make_rumble(hid); return 0; } @@ -157,20 +161,20 @@ int err; dbg("in hid_make_rumble"); - memcpy(lgff->ffoutbuf, packet, 8); - if (lgff->rumble_play) { - lgff->ffoutbuf[3] = lgff->rumble_left; - lgff->ffoutbuf[4] = lgff->rumble_right; + memcpy(lgff->buf, packet, 8); + if (lgff->play) { + lgff->buf[3] = lgff->left; + lgff->buf[4] = lgff->right; } else { - lgff->ffoutbuf[3] = 0; - lgff->ffoutbuf[4] = 0; + lgff->buf[3] = 0; + lgff->buf[4] = 0; } lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; lgff->ffcr.bRequest = 9; - lgff->ffcr.wValue = 0x0203; + lgff->ffcr.wValue = 0x0203; /*NOTE: Potential problem with little/big endian */ lgff->ffcr.wIndex = 0; lgff->urbffout->dev = hid->dev; @@ -190,7 +194,7 @@ static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect) { - struct hid_device* hid = input->private; + struct hid_device *hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; dbg("ioctl rumble"); @@ -199,8 +203,8 @@ switch (effect->type) { case FF_RUMBLE: - lgff->rumble_left = 0x80; - lgff->rumble_right = 0x00; + lgff->left = effect->u.rumble.strong_magnitude >> 9; + lgff->right = effect->u.rumble.weak_magnitude >> 9; break; Index: hid-input.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-input.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- hid-input.c 6 Mar 2002 23:02:58 -0000 1.21 +++ hid-input.c 10 Mar 2002 12:26:40 -0000 1.22 @@ -382,7 +382,7 @@ #ifdef CONFIG_HID_FF if (type == EV_FF) { - return hid->ff_event? hid->ff_event(dev, type, code, value) : -1; + return hid_ff_event(hid, dev, type, code, value); } #else if (0) {} Index: hid.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- hid.h 6 Mar 2002 23:02:58 -0000 1.28 +++ hid.h 10 Mar 2002 12:26:40 -0000 1.29 @@ -358,8 +358,9 @@ char uniq[64]; /* Device unique identifier (serial #) */ void *ff_private; /* Private data for the force-feedback driver */ - void (*exit_ff)(struct hid_device*); /* Called by hid_exit_ff(hid) */ - int (*ff_event)(struct input_dev*, unsigned int type, unsigned int code, int value); + void (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */ + int (*ff_event)(struct hid_device *hid, struct input_dev *input, + unsigned int type, unsigned int code, int value); }; #define HID_GLOBAL_STACK_SIZE 4 @@ -415,6 +416,19 @@ void hid_submit_report(struct hid_device *, struct hid_report *, unsigned char dir); void hid_init_reports(struct hid_device *hid); + #ifdef CONFIG_HID_FF -int hid_init_ff(struct hid_device *hid); + +int hid_ff_init(struct hid_device *hid); +static inline void hid_ff_exit(struct hid_device *hid) +{ + if (hid->ff_exit) hid->ff_exit(hid); +} + +static inline int hid_ff_event(struct hid_device *hid, struct input_dev *input, + unsigned int type, unsigned int code, int value) +{ + if (hid->ff_event) return hid->ff_event(hid, input, type, code, value); + return -ENOSYS; +} #endif |
From: johann d. <jd...@us...> - 2002-03-10 12:20:59
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv5086/include/linux Modified Files: input.h Log Message: Added struct ff_rumble_effect. Index: input.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/input.h,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- input.h 20 Feb 2002 18:00:53 -0000 1.63 +++ input.h 10 Mar 2002 12:20:56 -0000 1.64 @@ -586,6 +586,16 @@ * therefore dispose of the memory after the upload/update */ }; +/* FF_RUMBLE */ +/* Some rumble pads have two motors of different weight. + strong_magnitude represents the magnitude of the vibration generated + by the heavy motor. +*/ +struct ff_rumble_effect { + __u16 strong_magnitude; /* Magnitude of the heavy motor */ + __u16 weak_magnitude; /* Magnitude of the light one */ +}; + /* * Structure sent through ioctl from the application to the driver */ @@ -611,6 +621,7 @@ struct ff_ramp_effect ramp; struct ff_periodic_effect periodic; struct ff_condition_effect condition[2]; /* One for each axis */ + struct ff_rumble_effect rumble; } u; }; |
From: johann d. <jd...@us...> - 2002-03-08 19:34:34
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce In directory usw-pr-cvs1:/tmp/cvs-serv8510 Modified Files: iforce-main.c iforce-packets.c iforce-usb.c iforce.h Log Message: Use usb_alloc_urb. Index: iforce-main.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iforce-main.c 10 Feb 2002 23:41:31 -0000 1.14 +++ iforce-main.c 8 Mar 2002 19:34:30 -0000 1.15 @@ -230,8 +230,8 @@ switch (iforce->bus) { #ifdef IFORCE_USB case IFORCE_USB: - iforce->irq.dev = iforce->usbdev; - if (usb_submit_urb(&iforce->irq, GFP_KERNEL)) + iforce->irq->dev = iforce->usbdev; + if (usb_submit_urb(iforce->irq, GFP_KERNEL)) return -EIO; break; #endif @@ -277,7 +277,7 @@ switch (iforce->bus) { #ifdef IFORCE_USB case IFORCE_USB: - usb_unlink_urb(&iforce->irq); + usb_unlink_urb(iforce->irq); /* The device was unplugged before the file * was released */ Index: iforce-packets.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-packets.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- iforce-packets.c 12 Feb 2002 21:54:47 -0000 1.12 +++ iforce-packets.c 8 Mar 2002 19:34:30 -0000 1.13 @@ -238,25 +238,25 @@ case IFORCE_USB: iforce->cr.bRequest = packet[0]; - iforce->ctrl.dev = iforce->usbdev; + iforce->ctrl->dev = iforce->usbdev; set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&iforce->wait, &wait); - if (usb_submit_urb(&iforce->ctrl, GFP_KERNEL)) { + if (usb_submit_urb(iforce->ctrl, GFP_KERNEL)) { set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); return -1; } - while (timeout && iforce->ctrl.status == -EINPROGRESS) + while (timeout && iforce->ctrl->status == -EINPROGRESS) timeout = schedule_timeout(timeout); set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); if (!timeout) { - usb_unlink_urb(&iforce->ctrl); + usb_unlink_urb(iforce->ctrl); return -1; } Index: iforce-usb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-usb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iforce-usb.c 26 Feb 2002 23:07:56 -0000 1.14 +++ iforce-usb.c 8 Mar 2002 19:34:30 -0000 1.15 @@ -1,4 +1,4 @@ -/* + /* * $Id$ * * Copyright (c) 2000-2002 Vojtech Pavlik <vo...@uc...> @@ -42,29 +42,29 @@ return; } - ((char *)iforce->out.transfer_buffer)[0] = iforce->xmit.buf[iforce->xmit.tail]; + ((char *)iforce->out->transfer_buffer)[0] = iforce->xmit.buf[iforce->xmit.tail]; XMIT_INC(iforce->xmit.tail, 1); n = iforce->xmit.buf[iforce->xmit.tail]; XMIT_INC(iforce->xmit.tail, 1); - iforce->out.transfer_buffer_length = n + 1; - iforce->out.dev = iforce->usbdev; + iforce->out->transfer_buffer_length = n + 1; + iforce->out->dev = iforce->usbdev; /* Copy rest of data then */ c = CIRC_CNT_TO_END(iforce->xmit.head, iforce->xmit.tail, XMIT_SIZE); if (n < c) c=n; - memcpy(iforce->out.transfer_buffer + 1, + memcpy(iforce->out->transfer_buffer + 1, &iforce->xmit.buf[iforce->xmit.tail], c); if (n != c) { - memcpy(iforce->out.transfer_buffer + 1 + c, + memcpy(iforce->out->transfer_buffer + 1 + c, &iforce->xmit.buf[0], n-c); } XMIT_INC(iforce->xmit.tail, n); - if ( (n=usb_submit_urb(&iforce->out, GFP_ATOMIC)) ) { + if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { printk(KERN_WARNING "iforce-usb.c: iforce_usb_xmit: usb_submit_urb failed %d\n", n); } @@ -112,9 +112,23 @@ epirq = dev->config[0].interface[ifnum].altsetting[0].endpoint + 0; epout = dev->config[0].interface[ifnum].altsetting[0].endpoint + 1; - if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL))) return NULL; + if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL))) + goto fail; + memset(iforce, 0, sizeof(struct iforce)); + if (!(iforce->irq = usb_alloc_urb(0, GFP_KERNEL))) { + goto fail; + } + + if (!(iforce->out = usb_alloc_urb(0, GFP_KERNEL))) { + goto fail; + } + + if (!(iforce->ctrl = usb_alloc_urb(0, GFP_KERNEL))) { + goto fail; + } + iforce->bus = IFORCE_USB; iforce->usbdev = dev; @@ -122,29 +136,40 @@ iforce->cr.wIndex = 0; iforce->cr.wLength = 16; - usb_fill_int_urb(&iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), + usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval); - usb_fill_bulk_urb(&iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), + usb_fill_bulk_urb(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), iforce + 1, 32, iforce_usb_out, iforce); - usb_fill_control_urb(&iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), + usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce); - if (iforce_init_device(iforce)) { + if (iforce_init_device(iforce)) goto fail; + + return iforce; + +fail: + if (iforce) { + if (iforce->irq) usb_free_urb(iforce->irq); + if (iforce->out) usb_free_urb(iforce->out); + if (iforce->ctrl) usb_free_urb(iforce->ctrl); kfree(iforce); - return NULL; } - return iforce; + return NULL; } /* Called by iforce_delete() */ void iforce_usb_delete(struct iforce* iforce) { - usb_unlink_urb(&iforce->irq); - usb_unlink_urb(&iforce->out); - usb_unlink_urb(&iforce->ctrl); + usb_unlink_urb(iforce->irq); + usb_unlink_urb(iforce->out); + usb_unlink_urb(iforce->ctrl); + + usb_free_urb(iforce->irq); + usb_free_urb(iforce->out); + usb_free_urb(iforce->ctrl); } static void iforce_usb_disconnect(struct usb_device *dev, void *ptr) Index: iforce.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- iforce.h 12 Feb 2002 21:53:58 -0000 1.10 +++ iforce.h 8 Mar 2002 19:34:30 -0000 1.11 @@ -136,7 +136,7 @@ #endif #ifdef IFORCE_USB struct usb_device *usbdev; /* USB transfer */ - struct urb irq, out, ctrl; /*TODO: Use pointers and usb_alloc_urb */ + struct urb *irq, *out, *ctrl; struct usb_ctrlrequest cr; #endif spinlock_t xmit_lock; |
From: johann d. <jd...@us...> - 2002-03-08 19:29:56
|
Update of /cvsroot/linuxconsole/ruby/utils In directory usw-pr-cvs1:/tmp/cvs-serv7398 Modified Files: fftest.c Log Message: Added (incomplete) rumble effect. Index: fftest.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/fftest.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- fftest.c 13 Feb 2002 22:17:21 -0000 1.15 +++ fftest.c 8 Mar 2002 19:29:53 -0000 1.16 @@ -37,7 +37,7 @@ #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) -#define N_EFFECTS 4 +#define N_EFFECTS 5 int main(int argc, char** argv) { @@ -97,7 +97,6 @@ if (ioctl(fd, EVIOCGEFFECTS, &n_effects) == -1) { perror("Ioctl number of effects"); - exit(1); } printf("%d\n", n_effects); @@ -118,7 +117,6 @@ if (ioctl(fd, EVIOCSFF, &effects[1]) == -1) { perror("Upload effects[1]"); - exit(1); } /* download a periodic sinusoidal effect */ @@ -141,7 +139,6 @@ if (ioctl(fd, EVIOCSFF, &effects[0]) == -1) { perror("Upload effects[0]"); - exit(1); } /* download an condition spring effect */ @@ -161,7 +158,6 @@ if (ioctl(fd, EVIOCSFF, &effects[2]) == -1) { perror("Upload effects[2]"); - exit(1); } /* download an condition damper effect */ @@ -181,7 +177,12 @@ if (ioctl(fd, EVIOCSFF, &effects[3]) == -1) { perror("Upload effects[3]"); - exit(1); + } + + effects[4].type = FF_RUMBLE; + + if (ioctl(fd, EVIOCSFF, &effects[4]) == -1) { + perror("Upload effects[4]"); } /* Ask user what effects to play */ |
From: James S. <jsi...@us...> - 2002-03-06 23:05:58
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv17231 Modified Files: cfbfillrect.c cfbimgblt.c Log Message: soft accel updates. Index: cfbfillrect.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbfillrect.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- cfbfillrect.c 5 Mar 2002 17:14:28 -0000 1.6 +++ cfbfillrect.c 6 Mar 2002 23:05:56 -0000 1.7 @@ -25,7 +25,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) { unsigned long start_index, end_index, start_mask = 0, end_mask = 0; - unsigned long height, ppw, fg; + unsigned long height, ppw, fg, fgcolor; int i, n, x2, y2, linesize = p->fix.line_length; int bpl = sizeof(unsigned long); unsigned long *dst; @@ -54,11 +54,14 @@ // printk("end_index is %ld\n", end_index); // printk("width is %d\n", width); - fg = rect->color; + if (p->fix.visual == FB_VISUAL_TRUECOLOR) + fg = fgcolor = ((u32 *)(p->pseudo_palette))[rect->color]; + else + fg = fgcolor = rect->color; - for (i = 0; i < ppw; i++) { - fg <<= p->var.bits_per_pixel; - fg |= rect->color; + for (i = 0; i < ppw-1; i++) { + fg <<= p->var.bits_per_pixel; + fg |= fgcolor; } if (start_index) { Index: cfbimgblt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbimgblt.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cfbimgblt.c 18 Jul 2001 00:40:15 -0000 1.7 +++ cfbimgblt.c 6 Mar 2002 23:05:56 -0000 1.8 @@ -31,6 +31,8 @@ #include <linux/fb.h> #include <asm/types.h> +#include <video/fbcon.h> + #define DEBUG #ifdef DEBUG @@ -41,59 +43,65 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) { - unsigned long end_index, end_mask, mask, fgx, bgx, eorx; - int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k; - int linesize = p->fix.line_length; - unsigned long *dst, *src = NULL; - long tmp = -1 >> (BITS_PER_LONG - p->var.bits_per_pixel); - u8 *dst1, *src1; + unsigned long end_index, end_mask, mask, eorx; + int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l; + int linesize = p->fix.line_length; + unsigned long fgx, bgx, fgcolor, bgcolor; + unsigned long *dst, *src = NULL; + long tmp = -1 >> (BITS_PER_LONG - p->var.bits_per_pixel); + u8 *dst1, *src1; - /* We could use hardware clipping but on many cards you get around hardware - clipping by writing to framebuffer directly like we are doing here. */ - x2 = image->x + image->width; - y2 = image->y + image->height; - image->x = image->x > 0 ? image->x : 0; - image->y = image->y > 0 ? image->y : 0; - x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; - y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; - image->width = x2 - image->x; - image->height = y2 - image->y; + /* + * We could use hardware clipping but on many cards you get around hardware + * clipping by writing to framebuffer directly like we are doing here. + */ + x2 = image->dx + image->width; + y2 = image->dy + image->height; + image->dx = image->dx > 0 ? image->dx : 0; + image->dy = image->dy > 0 ? image->dy : 0; + x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; + y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; + image->width = x2 - image->dx; + image->height = y2 - image->dy; - dst1 = p->screen_base + image->y * linesize + - ((image->x * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + image->dy * linesize + + ((image->dx * p->var.bits_per_pixel) >> 3); - ppw = BITS_PER_LONG/p->var.bits_per_pixel; + ppw = BITS_PER_LONG/p->var.bits_per_pixel; - src1 = image->data; - - fgx = image->fg_color; - - for (i = 0; i < ppw; i++) { - fgx <<= p->var.bits_per_pixel; - fgx |= image->fg_color; - } + src1 = image->data; - bgx = image->bg_color; + if (p->fix.visual == FB_VISUAL_TRUECOLOR) { + fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color]; + bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color]; + } else { + fgx = fgcolor = image->fg_color; + bgx = bgcolor = image->bg_color; + } - for (i = 0; i < ppw; i++) { - bgx <<= p->var.bits_per_pixel; - bgx |= image->bg_color; - } - eorx = fgx ^ bgx; + for (i = 0; i < ppw-1; i++) { + fgx <<= p->var.bits_per_pixel; + bgx <<= p->var.bits_per_pixel; + fgx |= fgcolor; + bgx |= bgcolor; + } + eorx = fgx ^ bgx; + l = 8; - for (i = 0; i < image->height; i++) { - dst = (unsigned long *) dst1; - for (j = image->width; j > 0; j--) { - mask = 0; - for (k = 0; k < ppw; k++) { - if (test_bit(j-k, src1)) - mask |= (tmp << (p->var.bits_per_pixel*k)); + for (i = 0; i < image->height; i++) { + dst = (unsigned long *) dst1; + + for (j = image->width/ppw; j > 0; j--) { + mask = 0; + for (k = ppw; k > 0; k--) { + if (test_bit(l, src1)) + mask |= (tmp << (p->var.bits_per_pixel*(ppw-k))); + l--; + if (!l) { l = 8; src1++; } + } + fb_writel((mask & eorx)^bgx, dst); + dst++; } - fb_writel((mask & eorx)^bgx, dst); - j -= (k-1); - dst++; - } - dst1 += p->fix.line_length; - src1++; - } + dst1 += p->fix.line_length; + } } |
From: johann d. <jd...@us...> - 2002-03-06 23:03:01
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv14841 Modified Files: Config.help Config.in hid-core.c hid-input.c hid.h Added Files: hid-ff.c Log Message: Added force feedback interface to hid (needed because different protocols are used). Added basic force feedback support for Logitech WingMan Cordless rumble pad. Updated Config files. --- NEW FILE: hid-ff.c --- /* * $Id: hid-ff.c,v 1.1 2002/03/06 23:02:58 jdeneux Exp $ * * Force feedback support for hid devices. * Not all hid devices use the same protocol. For example, some use PID, * other use their own proprietary procotol. * * Copyright (c) 2002 Johann Deneux */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so by * e-mail - mail your message to <de...@if...> */ #include <linux/input.h> #undef DEBUG #include <linux/usb.h> #include "hid.h" /* Drivers' initializing functions */ static int hid_lgff_init(struct hid_device* hid); struct hid_ff_initializer { __u16 idVendor; __u16 idProduct; int (*init)(struct hid_device*); }; static struct hid_ff_initializer inits[] = { #ifdef CONFIG_LOGITECH_RUMBLE {0x46d, 0xc211, hid_lgff_init}, #endif {0, 0, NULL} /* Terminating entry */ }; static struct hid_ff_initializer *hid_get_ff_init(__u16 idVendor, __u16 idProduct) { struct hid_ff_initializer *init; for (init = inits; init->idVendor && !(init->idVendor == idVendor && init->idProduct == idProduct); init++); return init->idVendor? init : NULL; } int hid_init_ff(struct hid_device* hid) { struct hid_ff_initializer *init; init = hid_get_ff_init(hid->dev->descriptor.idVendor, hid->dev->descriptor.idProduct); return init? init->init(hid) : -ENOSYS; } /* Implements the protocol used by the Logitech WingMan Cordless rumble pad */ #ifdef CONFIG_LOGITECH_RUMBLE #define LGFF_BUFFER_SIZE 8 struct hid_ff_logitech { struct urb* urbffout; /* Output URB used to send ff commands */ struct usb_ctrlrequest ffcr; /* ff commands are sent using control URBs */ char ffoutbuf[LGFF_BUFFER_SIZE]; signed char rumble_left; /* Magnitude of left motor */ signed char rumble_right; /* Magnitude of right motor */ int rumble_play; /* Enable rumbling */ }; static void hid_lgff_ctrl_out(struct urb *urb); static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect); static void hid_lgff_exit(struct hid_device* hid); static int hid_lgff_event(struct input_dev* input, unsigned int type, unsigned int code, int value); static void hid_lgff_make_rumble(struct hid_device* hid); static int hid_lgff_init(struct hid_device* hid) { struct hid_ff_logitech *private; /* Private data */ private = hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); if (!hid->ff_private) return -1; /* Event and exit callbacks */ hid->exit_ff = hid_lgff_exit; hid->ff_event = hid_lgff_event; /* USB init */ if (!(private->urbffout = usb_alloc_urb(0, GFP_KERNEL))) { kfree(hid->ff_private); return -1; } FILL_CONTROL_URB(private->urbffout, hid->dev, 0, (void*) &private->ffcr, private->ffoutbuf, 8, hid_lgff_ctrl_out, hid); dbg("Created ff output control urb"); /* Input init */ hid->input.upload_effect = hid_lgff_upload_effect; set_bit(FF_RUMBLE, hid->input.ffbit); set_bit(EV_FF, hid->input.evbit); hid->input.ff_effects_max = 1; return 0; } static void hid_lgff_exit(struct hid_device* hid) { struct hid_ff_logitech *lgff = hid->ff_private; if (lgff->urbffout) { usb_unlink_urb(lgff->urbffout); usb_free_urb(lgff->urbffout); } } static int hid_lgff_event(struct input_dev* input, unsigned int type, unsigned int code, int value) { struct hid_device *hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; if (type == EV_FF) { int old = lgff->rumble_play; lgff->rumble_play = (value!=0); if (old != lgff->rumble_play) hid_lgff_make_rumble(hid); return 0; } else return -EINVAL; } static void hid_lgff_make_rumble(struct hid_device* hid) { struct hid_ff_logitech *lgff = hid->ff_private; char packet[] = {0x03, 0x42, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00}; int err; dbg("in hid_make_rumble"); memcpy(lgff->ffoutbuf, packet, 8); if (lgff->rumble_play) { lgff->ffoutbuf[3] = lgff->rumble_left; lgff->ffoutbuf[4] = lgff->rumble_right; } else { lgff->ffoutbuf[3] = 0; lgff->ffoutbuf[4] = 0; } lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; lgff->ffcr.bRequest = 9; lgff->ffcr.wValue = 0x0203; lgff->ffcr.wIndex = 0; lgff->urbffout->dev = hid->dev; if ((err=usb_submit_urb(lgff->urbffout, GFP_ATOMIC))) warn("usb_submit_urb returned %d", err); dbg("rumble urb submited"); } static void hid_lgff_ctrl_out(struct urb *urb) { struct hid_device *hid = urb->context; if (urb->status) warn("hid_irq_ffout status %d received", urb->status); } static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect) { struct hid_device* hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; dbg("ioctl rumble"); if (!test_bit(effect->type, input->ffbit)) return -EINVAL; switch (effect->type) { case FF_RUMBLE: lgff->rumble_left = 0x80; lgff->rumble_right = 0x00; break; default: return -EINVAL; } return 0; } #endif /* CONFIG_LOGITECH_RUMBLE */ Index: Config.help =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.help,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Config.help 26 Jan 2002 19:20:37 -0000 1.1 +++ Config.help 6 Mar 2002 23:02:58 -0000 1.2 @@ -105,6 +105,18 @@ The module will be called hid.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. +CONFIG_HID_FF + Say Y here is you want force feedback support for a few hid devices. See + below for a list of supported devices. + See Documentation/input/ff.txt for a description of the force feedback API. + + If unsure, say N. + +CONFIG_LOGITECH_RUMBLE + Say Y here if you have a Logitech WingMan Cordless rumble pad and if you + want to enable force feedback. Note: if you say N here, this device will + still be supported, but without force feedback. + CONFIG_USB_HIDDEV Say Y here if you want to support HID devices (from the USB specification standpoint) that aren't strictly user interface @@ -519,6 +531,21 @@ The module will be called dabusb.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. +CONFIG_USB_KONICAWC + Say Y here if you want support for webcams based on a Konica + chipset. This is known to work with the Intel YC76 webcam. + + This driver uses the Video For Linux API. You must enable + (Y or M in config) Video For Linux (under Character Devices) + to use this driver. Information on this API and pointers to + "v4l" programs may be found on the WWW at + <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. + + This code is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called konicawc.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + CONFIG_USB_USBNET This driver supports network links over USB with USB "Network" or "data transfer" cables, often used to network laptops to PCs. @@ -592,14 +619,14 @@ Support for anything but the X6 is experimental. Please report failures and successes. The scanner will appear as a scsi generic device to the rest - of the system. Scsi support is required for this driver to compile - and work. SANE 1.0.4 or newer is needed to make use of your scanner. - This driver can be compiled as a module. + of the system. Scsi support is required. + This driver can be compiled as a module, called microtek.o. CONFIG_USB_HPUSBSCSI Say Y here if you want support for the HP 53xx series of scanners and the Minolta Scan Dual. This driver is experimental. The scanner will be accessible as a SCSI device. + This can be compiled as a module, called hpusbscsi.o. CONFIG_USB_BLUETOOTH Say Y here if you want to connect a USB Bluetooth device to your Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Config.in 26 Dec 2001 21:08:33 -0000 1.19 +++ Config.in 6 Mar 2002 23:02:58 -0000 1.20 @@ -18,7 +18,8 @@ bool ' Long timeout for slow-responding devices (some MGE Ellipse UPSes)' CONFIG_USB_LONG_TIMEOUT fi -comment 'USB Controllers' +comment 'USB Host Controller Drivers' +source drivers/usb/hcd/Config.in if [ "$CONFIG_USB_UHCI_ALT" != "y" ]; then dep_tristate ' UHCI (Intel PIIX4, VIA, ...) support' CONFIG_USB_UHCI $CONFIG_USB fi @@ -32,6 +33,9 @@ comment 'USB Device Class drivers' dep_tristate ' USB Audio support' CONFIG_USB_AUDIO $CONFIG_USB $CONFIG_SOUND dep_tristate ' USB Bluetooth support (EXPERIMENTAL)' CONFIG_USB_BLUETOOTH $CONFIG_USB $CONFIG_EXPERIMENTAL +if [ "$CONFIG_SCSI" = "n" ]; then + comment ' SCSI support is needed for USB Storage' +fi dep_tristate ' USB Mass Storage support' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI dep_mbool ' USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG $CONFIG_USB_STORAGE dep_mbool ' Datafab MDCFE-B Compact Flash Reader support' CONFIG_USB_STORAGE_DATAFAB $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL @@ -44,6 +48,22 @@ dep_tristate ' USB Modem (CDC ACM) support' CONFIG_USB_ACM $CONFIG_USB dep_tristate ' USB Printer support' CONFIG_USB_PRINTER $CONFIG_USB +comment 'USB Human Interface Devices (HID)' +if [ "$CONFIG_INPUT" = "n" ]; then + comment ' Input core support is needed for USB HID' +else + dep_tristate ' USB Human Interface Device (full HID) support' CONFIG_USB_HID $CONFIG_USB $CONFIG_INPUT + dep_mbool ' /dev/hiddev raw HID device support (EXPERIMENTAL)' CONFIG_USB_HIDDEV $CONFIG_USB_HID + if [ "$CONFIG_USB_HID" != "y" ]; then + dep_tristate ' USB HIDBP Keyboard (basic) support' CONFIG_USB_KBD $CONFIG_USB $CONFIG_INPUT + dep_tristate ' USB HIDBP Mouse (basic) support' CONFIG_USB_MOUSE $CONFIG_USB $CONFIG_INPUT + fi + dep_tristate ' Wacom Intuos/Graphire tablet support' CONFIG_USB_WACOM $CONFIG_USB $CONFIG_INPUT + dep_tristate ' Griffin Technology PowerMate support' CONFIG_USB_POWERMATE $CONFIG_USB $CONFIG_INPUT + dep_mbool ' Force feedback support' CONFIG_HID_FF $CONFIG_USB_HID + dep_mbool ' Logitech RumblePad support' CONFIG_LOGITECH_RUMBLE $CONFIG_USB_HID $CONFIG_HID_FF +fi + comment 'USB Imaging devices' dep_tristate ' USB Kodak DC-2xx Camera support' CONFIG_USB_DC2XX $CONFIG_USB dep_tristate ' USB Mustek MDC800 Digital Camera support (EXPERIMENTAL)' CONFIG_USB_MDC800 $CONFIG_USB $CONFIG_EXPERIMENTAL @@ -59,8 +79,11 @@ dep_tristate ' USB OV511 Camera support' CONFIG_USB_OV511 $CONFIG_USB $CONFIG_VIDEO_DEV dep_tristate ' USB Philips Cameras' CONFIG_USB_PWC $CONFIG_USB $CONFIG_VIDEO_DEV dep_tristate ' USB SE401 Camera support' CONFIG_USB_SE401 $CONFIG_USB $CONFIG_VIDEO_DEV + dep_tristate ' USB STV680 (Pencam) Camera support' CONFIG_USB_STV680 $CONFIG_USB $CONFIG_VIDEO_DEV + dep_tristate ' USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)' CONFIG_USB_VICAM $CONFIG_USB $CONFIG_VIDEO_DEV $CONFIG_EXPERIMENTAL dep_tristate ' D-Link USB FM radio support (EXPERIMENTAL)' CONFIG_USB_DSBR $CONFIG_USB $CONFIG_VIDEO_DEV $CONFIG_EXPERIMENTAL dep_tristate ' DABUSB driver' CONFIG_USB_DABUSB $CONFIG_USB + dep_tristate ' USB Konica Webcam support' CONFIG_USB_KONICAWC $CONFIG_USB $CONFIG_VIDEO_DEV fi comment 'USB Network adaptors' @@ -80,5 +103,6 @@ comment 'USB Miscellaneous drivers' dep_tristate ' USB Diamond Rio500 support (EXPERIMENTAL)' CONFIG_USB_RIO500 $CONFIG_USB $CONFIG_EXPERIMENTAL +dep_tristate ' USB Auerswald ISDN support (EXPERIMENTAL)' CONFIG_USB_AUERSWALD $CONFIG_USB $CONFIG_EXPERIMENTAL endmenu Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-core.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- hid-core.c 27 Feb 2002 22:26:58 -0000 1.46 +++ hid-core.c 6 Mar 2002 23:02:58 -0000 1.47 @@ -1374,7 +1374,10 @@ return hid; fail: - +#ifdef CONFIG_HID_FF + if (hid->exit_ff) + hid->exit_ff(hid); +#endif hid_free_device(hid); if (hid->urbin) usb_free_urb(hid->urbin); if (hid->urbout) usb_free_urb(hid->urbout); @@ -1399,6 +1402,13 @@ hid_init_reports(hid); hid_dump_device(hid); +#ifdef CONFIG_HID_FF + if (hid_init_ff(hid)) { + hid_free_device(hid); + return NULL; + } +#endif + if (!hidinput_connect(hid)) hid->claimed |= HID_CLAIMED_INPUT; #ifdef CONFIG_USB_HIDDEV @@ -1455,6 +1465,10 @@ if (hid->urbout) usb_free_urb(hid->urbout); +#ifdef CONFIG_HID_FF + if (hid->exit_ff) + hid->exit_ff(hid); +#endif hid_free_device(hid); } Index: hid-input.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-input.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- hid-input.c 24 Jan 2002 19:51:26 -0000 1.20 +++ hid-input.c 6 Mar 2002 23:02:58 -0000 1.21 @@ -377,16 +377,28 @@ static int hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { struct hid_device *hid = dev->private; - struct hid_field *field = NULL; - int offset; - if ((offset = hid_find_field(hid, type, code, &field)) == -1) { - warn("event field not found"); - return -1; + warn("hid input event"); + +#ifdef CONFIG_HID_FF + if (type == EV_FF) { + return hid->ff_event? hid->ff_event(dev, type, code, value) : -1; } +#else + if (0) {} +#endif + else { + struct hid_field *field = NULL; + int offset; - hid_set_field(field, offset, value); - hid_submit_report(hid, field->report, USB_DIR_OUT); + if ((offset = hid_find_field(hid, type, code, &field)) == -1) { + warn("event field not found"); + return -1; + } + + hid_set_field(field, offset, value); + hid_submit_report(hid, field->report, USB_DIR_OUT); + } return 0; } @@ -428,7 +440,6 @@ hid->input.event = hidinput_input_event; hid->input.open = hidinput_open; hid->input.close = hidinput_close; - hid->input.name = hid->name; hid->input.phys = hid->phys; hid->input.uniq = hid->uniq; Index: hid.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- hid.h 24 Jan 2002 19:51:26 -0000 1.27 +++ hid.h 6 Mar 2002 23:02:58 -0000 1.28 @@ -356,6 +356,10 @@ char name[128]; /* Device name */ char phys[64]; /* Device physical location */ char uniq[64]; /* Device unique identifier (serial #) */ + + void *ff_private; /* Private data for the force-feedback driver */ + void (*exit_ff)(struct hid_device*); /* Called by hid_exit_ff(hid) */ + int (*ff_event)(struct input_dev*, unsigned int type, unsigned int code, int value); }; #define HID_GLOBAL_STACK_SIZE 4 @@ -410,3 +414,7 @@ int hid_set_field(struct hid_field *, unsigned, __s32); void hid_submit_report(struct hid_device *, struct hid_report *, unsigned char dir); void hid_init_reports(struct hid_device *hid); + +#ifdef CONFIG_HID_FF +int hid_init_ff(struct hid_device *hid); +#endif |
From: James S. <jsi...@us...> - 2002-03-05 17:14:31
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv19726/include/linux Modified Files: fb.h Log Message: MOved to cleaner fbdev api for accel handling. Index: fb.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/fb.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- fb.h 20 Jan 2002 03:54:46 -0000 1.46 +++ fb.h 5 Mar 2002 17:14:28 -0000 1.47 @@ -338,13 +338,11 @@ /* pan display */ int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); /* draws a rectangle */ - void (*fb_fillrect)(struct fb_info *p, int x1, int y1, unsigned int width, - unsigned int height, unsigned long color, int rop); + void (*fb_fillrect)(struct fb_info *info, struct fb_fillrect *rect); /* Copy data from area to another */ - void (*fb_copyarea)(struct fb_info *p, int sx, int sy, unsigned int width, - unsigned int height, int dx, int dy); + void (*fb_copyarea)(struct fb_info *info, struct fb_copyarea *area); /* Draws a image to the display */ - void (*fb_imageblit)(struct fb_info *p, struct fb_image *image); + void (*fb_imageblit)(struct fb_info *info, struct fb_image *image); /* perform polling on fb device */ int (*fb_poll)(struct fb_info *info, poll_table *wait); /* perform fb specific ioctl */ |
From: James S. <jsi...@us...> - 2002-03-05 17:14:31
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv19726/drivers/char Modified Files: keyboard.c Log Message: MOved to cleaner fbdev api for accel handling. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/keyboard.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- keyboard.c 4 Mar 2002 18:07:25 -0000 1.72 +++ keyboard.c 5 Mar 2002 17:14:28 -0000 1.73 @@ -945,9 +945,8 @@ } #endif -void kbd_keycode(void *private, unsigned int keycode, int down) +void kbd_keycode(struct vt_struct *vt, unsigned int keycode, int down) { - struct vt_struct *vt = (struct vt_struct *) private; struct vc_data *vc = vt->fg_console; unsigned short keysym, *key_map; unsigned char type, raw_mode; @@ -1044,9 +1043,11 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type, unsigned int keycode, int down) { - if (event_type != EV_KEY) return; - if (handle->private) - kbd_keycode(handle->private, keycode, down); + struct vt_struct *vt = (struct vt_struct *) handle->private; + + if ((event_type != EV_KEY) || !vt || !vt->fg_console->vc_kam) + return; + kbd_keycode(vt, keycode, down); tasklet_schedule(&keyboard_tasklet); } |
From: James S. <jsi...@us...> - 2002-03-05 17:14:31
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv19726/drivers/video Modified Files: cfbcopyarea.c cfbfillrect.c Log Message: MOved to cleaner fbdev api for accel handling. Index: cfbcopyarea.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbcopyarea.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cfbcopyarea.c 4 Apr 2001 02:05:26 -0000 1.3 +++ cfbcopyarea.c 5 Mar 2002 17:14:28 -0000 1.4 @@ -26,9 +26,9 @@ #include <linux/slab.h> #include <asm/types.h> #include <asm/io.h> +#include <video/fbcon.h> -void cfb_copyarea(struct fb_info *p, int sx, int sy, unsigned int width, - unsigned int rows, int dx, int dy) +void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) { unsigned long start_index, end_index, start_mask, end_mask, last,tmp, height; int x2, y2, n, j, lineincr, shift, shift_right, shift_left, old_dx,old_dy; @@ -37,49 +37,49 @@ char *src1,*dst1; /* clip the destination */ - old_dx=dx; - old_dy=dy; + old_dx = area->dx; + old_dy = area->dy; /* We could use hardware clipping but on many cards you get around hardware clipping by writing to framebuffer directly. */ - x2 = dx + width; - y2 = dy + rows; - dx = dx > 0 ? dx : 0; - dy = dy > 0 ? dy : 0; + x2 = area->dx + area->width; + y2 = area->dy + area->height; + area->dx = area->dx > 0 ? area->dx : 0; + area->dy = area->dy > 0 ? area->dy : 0; x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; - width = x2 - dx; - rows = y2 - dy; + area->width = x2 - area->dx; + area->height = y2 - area->dy; /* update sx1,sy1 */ - sx += (dx - old_dx); - sy += (dy - old_dy); + area->sx += (area->dx - old_dx); + area->sy += (area->dy - old_dy); - height = rows; + height = area->height; /* the source must be completely inside the virtual screen */ - if (sx < 0 || sy < 0 || (sx + width) > p->var.xres_virtual || - (sy + height) > p->var.yres_virtual) return; + if (area->sx < 0 || area->sy < 0 || (area->sx + area->width) > p->var.xres_virtual || + (area->sy + area->height) > p->var.yres_virtual) return; - if (dy < sy || (dy == sy && dx < sx)) { + if (area->dy < area->sy || (area->dy == area->sy && area->dx < area->sx)) { /* start at the top */ - src1 = p->screen_base + sy * linesize + - ((sx * p->var.bits_per_pixel) >> 3); - dst1 = p->screen_base + dy * linesize + - ((dx * p->var.bits_per_pixel) >> 3); + src1 = p->screen_base + area->sy * linesize + + ((area->sx * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + area->dy * linesize + + ((area->dx * p->var.bits_per_pixel) >> 3); lineincr = linesize; } else { /* start at the bottom */ - src1 = p->screen_base + (sy + height - 1) * linesize + - (((sx + width - 1) * p->var.bits_per_pixel) >> 3); - dst1 = p->screen_base + (dy + height - 1) * linesize + - (((dx + width - 1) * p->var.bits_per_pixel) >> 3); + src1 = p->screen_base + (area->sy + area->height - 1) * linesize + + (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + (area->dy + area->height - 1) * linesize + + (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3); lineincr = -linesize; } if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { int ppw = BITS_PER_LONG/p->var.bits_per_pixel; - int n = ((width * p->var.bits_per_pixel) >> 3); + int n = ((area->width * p->var.bits_per_pixel) >> 3); start_index = ((unsigned long) src1 & (bpl-1)); end_index = ((unsigned long) (src1 + n) & (bpl-1)); Index: cfbfillrect.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbfillrect.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cfbfillrect.c 16 Apr 2001 15:05:29 -0000 1.5 +++ cfbfillrect.c 5 Mar 2002 17:14:28 -0000 1.6 @@ -20,9 +20,9 @@ #include <linux/string.h> #include <linux/fb.h> #include <asm/types.h> +#include <video/fbcon.h> -void cfb_fillrect(struct fb_info *p, int x1, int y1, unsigned int width, - unsigned int rows, unsigned long color, int rop) +void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) { unsigned long start_index, end_index, start_mask = 0, end_mask = 0; unsigned long height, ppw, fg; @@ -31,22 +31,22 @@ unsigned long *dst; char *dst1; - if (!width || !rows) return; + if (!rect->width || !rect->height) return; /* We could use hardware clipping but on many cards you get around hardware clipping by writing to framebuffer directly. */ - x2 = x1 + width; - y2 = y1 + rows; + x2 = rect->dx + rect->width; + y2 = rect->dy + rect->height; x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; - width = x2 - x1; - height = y2 - y1; + rect->width = x2 - rect->dx; + height = y2 - rect->dy; /* Size of the scanline in bytes */ - n = ((width * p->var.bits_per_pixel) >> 3); + n = ((rect->width * p->var.bits_per_pixel) >> 3); ppw = BITS_PER_LONG/p->var.bits_per_pixel; - dst1 = p->screen_base + y1 * linesize + ((x1 * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + rect->dy * linesize + ((rect->dx * p->var.bits_per_pixel) >> 3); start_index = ((unsigned long) dst1 & (bpl-1)); end_index = ((unsigned long)(dst1 + n) & (bpl-1)); @@ -54,11 +54,11 @@ // printk("end_index is %ld\n", end_index); // printk("width is %d\n", width); - fg = color; + fg = rect->color; for (i = 0; i < ppw; i++) { fg <<= p->var.bits_per_pixel; - fg |= color; + fg |= rect->color; } if (start_index) { @@ -89,7 +89,7 @@ // printk("n is %d\n", n); if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) { - switch(rop) { + switch (rect->rop) { case ROP_COPY: do { /* Word align to increases performace :-) */ @@ -159,14 +159,14 @@ /* start_mask =& PFILL24(x1,fg); end_mask_or = end_mask & PFILL24(x1+width-1,fg); */ - n = (width - start_index - end_index)/ppw; + n = (rect->width - start_index - end_index)/ppw; - switch(rop) { + switch (rect->rop) { case ROP_COPY: do { dst = (unsigned long *)dst1; if (start_mask) *dst |= start_mask; - if ((start_index + width) > ppw) dst++; + if ((start_index + rect->width) > ppw) dst++; /* XXX: slow */ for(i=0;i<n;i++) { @@ -180,7 +180,7 @@ do { dst = (unsigned long *)dst1; if (start_mask) *dst ^= start_mask; - if ((start_mask + width) > ppw) dst++; + if ((start_mask + rect->width) > ppw) dst++; for(i=0;i<n;i++) { *dst++ ^= fg; /* PFILL24(fg,x1+i); */ |
From: James S. <jsi...@us...> - 2002-03-04 18:07:29
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv16880 Modified Files: keyboard.c Log Message: Added support for kam flag. This way users can use control characters to prevent key events from reaching the tty. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/keyboard.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- keyboard.c 20 Feb 2002 17:49:34 -0000 1.71 +++ keyboard.c 4 Mar 2002 18:07:25 -0000 1.72 @@ -1088,6 +1088,9 @@ vt->keyboard = handle; handle->private = vt; vt_map_input(vt); + /* enable receieving key events for each VC */ + for (i = 0; i < MAX_NR_USER_CONSOLES; i++) + vt->vc_cons[i]->vc_kam = 1; break; } else vt = vt->next; @@ -1107,7 +1110,10 @@ { struct vt_struct *vt = handle->private; - if (vt && vt->keyboard == handle) { + if (vt && vt->keyboard == handle) { + /* disable receieving key events for each VC */ + for (i = 0; i < MAX_NR_USER_CONSOLES; i++) + vt->vc_cons[i]->vc_kam = 1; vt->keyboard = NULL; handle->private = NULL; } |
From: johann d. <jd...@us...> - 2002-03-03 16:28:09
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv25719 Modified Files: Makefile Log Message: "Updated" by copying the Makefile from 2.5.5-dj1. Do we need this Makefile in linuxconsole at all ? Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile 15 Oct 2001 01:13:17 -0000 1.15 +++ Makefile 3 Mar 2002 16:28:06 -0000 1.16 @@ -10,18 +10,13 @@ # Objects that export symbols. -export-objs := usb.o +export-objs := usb.o hcd.o ov511.o pwc-uncompress.o # Multipart objects. -list-multi := usbcore.o -usbcore-objs := usb.o usb-debug.o hub.o - -ifneq ($(CONFIG_USB_PWC),n) - export-objs += pwc-uncompress.o - list-multi += pwc.o -endif - +list-multi := usbcore.o hid.o pwc.o +usbcore-objs := usb.o usb-debug.o hub.o hcd.o +hid-objs := hid-core.o hid-input.o pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o @@ -31,6 +26,14 @@ usbcore-objs += devio.o inode.o drivers.o devices.o endif +ifeq ($(CONFIG_USB_HIDDEV),y) + hid-objs += hiddev.o +endif + +ifeq ($(CONFIG_LOGITECH_RUMBLE),y) + hid-objs += hid-ff.o +endif + # Object file lists. obj-y := @@ -41,22 +44,41 @@ # Each configuration option enables a list of files. obj-$(CONFIG_USB) += usbcore.o + +# EHCI needs to be linked before the other HCD drivers +ifeq ($(CONFIG_USB_EHCI_HCD),y) + obj-y += hcd/ehci-hcd.o +endif + +ifeq ($(CONFIG_USB_OHCI_HCD),y) + obj-y += hcd/ohci-hcd.o +endif + obj-$(CONFIG_USB_UHCI) += usb-uhci.o obj-$(CONFIG_USB_UHCI_ALT) += uhci.o obj-$(CONFIG_USB_OHCI) += usb-ohci.o +obj-$(CONFIG_USB_MOUSE) += usbmouse.o +obj-$(CONFIG_USB_HID) += hid.o +obj-$(CONFIG_USB_KBD) += usbkbd.o +obj-$(CONFIG_USB_WACOM) += wacom.o +obj-$(CONFIG_USB_POWERMATE) += powermate.o + obj-$(CONFIG_USB_SCANNER) += scanner.o obj-$(CONFIG_USB_ACM) += acm.o obj-$(CONFIG_USB_PRINTER) += printer.o obj-$(CONFIG_USB_AUDIO) += audio.o obj-$(CONFIG_USB_IBMCAM) += ibmcam.o usbvideo.o ultracam.o +obj-$(CONFIG_USB_KONICAWC) += konicawc.o usbvideo.o obj-$(CONFIG_USB_PWC) += pwc.o obj-$(CONFIG_USB_DC2XX) += dc2xx.o obj-$(CONFIG_USB_MDC800) += mdc800.o obj-$(CONFIG_USB_USS720) += uss720.o obj-$(CONFIG_USB_DABUSB) += dabusb.o +obj-$(CONFIG_USB_VICAM) += vicam.o obj-$(CONFIG_USB_OV511) += ov511.o obj-$(CONFIG_USB_SE401) += se401.o +obj-$(CONFIG_USB_STV680) += stv680.o obj-$(CONFIG_USB_PEGASUS) += pegasus.o obj-$(CONFIG_USB_CATC) += catc.o obj-$(CONFIG_USB_KAWETH) += kaweth.o @@ -67,9 +89,13 @@ obj-$(CONFIG_USB_HPUSBSCSI) += hpusbscsi.o obj-$(CONFIG_USB_BLUETOOTH) += bluetooth.o obj-$(CONFIG_USB_USBNET) += usbnet.o +obj-$(CONFIG_USB_AUERSWALD) += auerswald.o # Object files in subdirectories +mod-subdirs := serial hcd +subdir-$(CONFIG_USB_EHCI_HCD) += hcd +subdir-$(CONFIG_USB_OHCI_HCD) += hcd subdir-$(CONFIG_USB_SERIAL) += serial subdir-$(CONFIG_USB_STORAGE) += storage @@ -87,6 +113,9 @@ usbcore.o: $(usbcore-objs) $(LD) -r -o $@ $(usbcore-objs) + +hid.o: $(hid-objs) + $(LD) -r -o $@ $(hid-objs) pwc.o: $(pwc-objs) $(LD) -r -o $@ $(pwc-objs) |
From: johann d. <jd...@us...> - 2002-03-03 12:13:13
|
Update of /cvsroot/linuxconsole/ruby/linux/Documentation/input In directory usw-pr-cvs1:/tmp/cvs-serv2297 Modified Files: joystick.txt Log Message: Updated the section dedicated to I-Force devices. Index: joystick.txt =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/Documentation/input/joystick.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- joystick.txt 8 Feb 2002 23:10:51 -0000 1.11 +++ joystick.txt 3 Mar 2002 12:13:07 -0000 1.12 @@ -503,15 +503,16 @@ 3.21 I-Force devices ~~~~~~~~~~~~~~~~~~~~ - All I-Force devices are supported by the iforce.c module. This includes: + All I-Force devices are supported by the iforce.o module. This includes: * AVB Mag Turbo Force * AVB Top Shot Pegasus +* AVB Top Shot Force Feedback Racing Wheel * Logitech WingMan Force -* Logitech WingMan Force 3D (no force feedback support) * Logitech WingMan Force Wheel -* Logitech WingMan Strike Force 3D (no force feedback support) * Guillemot Race Leader Force Feedback +* Guillemot Force Feedback Racing Wheel +* Thrustmaster Motor Sport GT To use it, you need to attach the serial port to the driver using the @@ -523,9 +524,11 @@ In case you're using the device via the USB port, the inputattach command isn't needed. - The I-Force driver now supports force feedback via the event interface for -*some* of the I-Force devices. The recent Logitech * 3D devices are not -supported. I-Force rumble pads are not supported either. + The I-Force driver now supports force feedback via the event interface. + + Please note that Logitech WingMan *3D devices are _not_ supported by this +module, rather by hid. Force feedback is not supported for those devices. +Logitech gamepads are also hid devices. 3.22 Gravis Stinger gamepad ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
From: James S. <jsi...@us...> - 2002-03-01 22:09:34
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv26284 Modified Files: i8042.c Log Message: Reverse changes commited accidently. Index: i8042.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- i8042.c 1 Mar 2002 21:52:47 -0000 1.20 +++ i8042.c 1 Mar 2002 22:09:27 -0000 1.21 @@ -58,7 +58,6 @@ struct i8042_values { int irq; - int ioport; unsigned char disable; unsigned char irqen; unsigned char exists; @@ -265,7 +264,7 @@ * Allocate the interrupt */ - if (request_irq(values->irq, i8042_interrupt, 0, "i8042", values)) { + if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) { printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name); return -1; } @@ -325,7 +324,6 @@ static struct i8042_values i8042_kbd_values = { irq: I8042_KBD_IRQ, - ioport: I8042_DATA_REG, irqen: I8042_CTR_KBDINT, disable: I8042_CTR_KBDDIS, name: "KBD", @@ -345,7 +343,6 @@ static struct i8042_values i8042_aux_values = { irq: I8042_AUX_IRQ, - ioport: I8042_DATA_REG, irqen: I8042_CTR_AUXINT, disable: I8042_CTR_AUXDIS, name: "AUX", @@ -371,13 +368,12 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct i8042_values *values = dev_id; - unsigned char str, data; unsigned long flags; + unsigned char str, data; spin_lock_irqsave(&i8042_lock, flags); - while ((str = inb(values->ioport + 4)) & I8042_STR_OBF) { + while ((str = inb(I8042_STATUS_REG)) & I8042_STR_OBF) { data = inb(I8042_DATA_REG); @@ -386,11 +382,11 @@ data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", (int) (jiffies - i8042_start)); #endif - if (values->exists && (str & I8042_STR_AUXDATA)) { + if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { if (i8042_aux_port.dev) i8042_aux_port.dev->interrupt(&i8042_aux_port, data, 0); } else { - if (i8042_kbd_port.dev) { + if (i8042_kbd_values.exists && i8042_kbd_port.dev) { if (!i8042_direct) { if (data > 0x7f) { if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) { @@ -406,6 +402,7 @@ } } } + spin_unlock_irqrestore(&i8042_lock, flags); } @@ -421,7 +418,7 @@ * Check the i/o region before we touch it. */ #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) - if (check_region(i8042_kbd_values.ioport, 16)) { + if (check_region(I8042_DATA_REG, 16)) { printk(KERN_ERR "i8042.c: %#x port already in use!\n", I8042_DATA_REG); return -1; } |
From: James S. <jsi...@us...> - 2002-03-01 21:52:52
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv21567 Modified Files: i8042.c i8042.h Removed Files: serport_old.c Log Message: Renamed to serport.c Index: i8042.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- i8042.c 15 Feb 2002 00:25:24 -0000 1.19 +++ i8042.c 1 Mar 2002 21:52:47 -0000 1.20 @@ -58,6 +58,7 @@ struct i8042_values { int irq; + int ioport; unsigned char disable; unsigned char irqen; unsigned char exists; @@ -264,7 +265,7 @@ * Allocate the interrupt */ - if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) { + if (request_irq(values->irq, i8042_interrupt, 0, "i8042", values)) { printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name); return -1; } @@ -324,6 +325,7 @@ static struct i8042_values i8042_kbd_values = { irq: I8042_KBD_IRQ, + ioport: I8042_DATA_REG, irqen: I8042_CTR_KBDINT, disable: I8042_CTR_KBDDIS, name: "KBD", @@ -343,6 +345,7 @@ static struct i8042_values i8042_aux_values = { irq: I8042_AUX_IRQ, + ioport: I8042_DATA_REG, irqen: I8042_CTR_AUXINT, disable: I8042_CTR_AUXDIS, name: "AUX", @@ -368,12 +371,13 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - unsigned long flags; + struct i8042_values *values = dev_id; unsigned char str, data; + unsigned long flags; spin_lock_irqsave(&i8042_lock, flags); - while ((str = inb(I8042_STATUS_REG)) & I8042_STR_OBF) { + while ((str = inb(values->ioport + 4)) & I8042_STR_OBF) { data = inb(I8042_DATA_REG); @@ -382,11 +386,11 @@ data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", (int) (jiffies - i8042_start)); #endif - if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { + if (values->exists && (str & I8042_STR_AUXDATA)) { if (i8042_aux_port.dev) i8042_aux_port.dev->interrupt(&i8042_aux_port, data, 0); } else { - if (i8042_kbd_values.exists && i8042_kbd_port.dev) { + if (i8042_kbd_port.dev) { if (!i8042_direct) { if (data > 0x7f) { if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) { @@ -402,7 +406,6 @@ } } } - spin_unlock_irqrestore(&i8042_lock, flags); } @@ -418,7 +421,7 @@ * Check the i/o region before we touch it. */ #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) - if (check_region(I8042_DATA_REG, 16)) { + if (check_region(i8042_kbd_values.ioport, 16)) { printk(KERN_ERR "i8042.c: %#x port already in use!\n", I8042_DATA_REG); return -1; } Index: i8042.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- i8042.h 2 Feb 2002 22:26:44 -0000 1.9 +++ i8042.h 1 Mar 2002 21:52:48 -0000 1.10 @@ -66,9 +66,9 @@ * Register numbers. */ -#define I8042_COMMAND_REG CONFIG_I8042_REG_BASE + 4 -#define I8042_STATUS_REG CONFIG_I8042_REG_BASE + 4 #define I8042_DATA_REG CONFIG_I8042_REG_BASE +#define I8042_COMMAND_REG I8042_DATA_REG + 4 +#define I8042_STATUS_REG I8042_DATA_REG + 4 /* * Status register bits. --- serport_old.c DELETED --- |
From: James S. <jsi...@us...> - 2002-02-28 18:56:03
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv31190 Added Files: serport_new.c Removed Files: serport.c Log Message: Ended the confusion of serport_old and serport. --- NEW FILE: serport_new.c --- /* * $Id: serport_new.c,v 1.1 2002/02/28 18:55:58 jsimmons Exp $ */ /* * This is a module that converts a tty line into a much simpler * 'serial io port' abstraction that the input device drivers use. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <asm/uaccess.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/init.h> #include <linux/serio.h> #include <linux/tty.h> #include <linux/circ_buf.h> static DECLARE_MUTEX(port_sem); /* * Callback functions from the serio code. */ static int serport_serio_write(struct serio *serio, unsigned char data) { struct uart_info *info = serio->driver; unsigned long flags; int retval = -1; if (!info->xmit.buf) return retval; save_flags(flags); cli(); if (CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) != 0) { info->xmit.buf[info->xmit.head] = ch; info->xmit.head = (info->xmit.head + 1) & (UART_XMIT_SIZE - 1); retval = 0; } restore_flags(flags); return retval; } static int serport_serio_open(struct serio *serio) { struct uart_info *info = serio->driver; int retval = -ENODEV; /* if (!try_inc_mod_count(drv->owner)) goto fail; */ if (!info) goto out; /* * If the port is in the middle of closing, bail out now. */ if (info->flags & ASYNC_CLOSING) { interruptible_sleep_on(&info->close_wait); retval = (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS; goto out; } /* * Make sure the device is in D0 state. */ if (info->state->count == 1) #ifdef CONFIG_PM pm_send(info->state->pm, PM_RESUME, (void *)0); #else if (info->ops->pm) info->ops->pm(info->port, 0, 3); #endif /* * Start up the serial port */ retval = uart_startup(info); if (retval) goto out; uart_change_speed(info, NULL); out: if (drv->owner) __MOD_DEC_USE_COUNT(drv->owner); fail: return retval; } static void serport_serio_close(struct serio *serio) { struct uart_info *info = serio->private; struct uart_state *state = info->state; down(&state->count_sem); save_flags(flags); cli(); if (state->count) { restore_flags(flags); up(&state->count_sem); goto done; } info->flags |= ASYNC_CLOSING; restore_flags(flags); up(&state->count_sem); /* * At this point, we stop accepting input. To do this, we * disable the receive line status interrupts. */ if (info->flags & ASYNC_INITIALIZED) { info->ops->stop_rx(info->port); /* * Before we drop DTR, make sure the UART transmitter * has completely drained; this is especially * important if there is a transmit FIFO! */ uart_wait_until_sent(tty, info->timeout); } uart_shutdown(info); info->event = 0; if (info->blocked_open) { if (info->state->close_delay) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(info->state->close_delay); set_current_state(TASK_RUNNING); } wake_up_interruptible(&info->open_wait); } else { #ifdef CONFIG_PM /* * Put device into D3 state. */ pm_send(info->state->pm, PM_SUSPEND, (void *)3); #else if (info->ops->pm) info->ops->pm(info->port, 3, 0); #endif } info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE| ASYNC_CLOSING); wake_up_interruptible(&info->close_wait); done: if (drv->owner) __MOD_DEC_USE_COUNT(drv->owner); } /* * The functions for insering/removing us as a module. */ int __init serport_init(void) { struct uart_driver *input; uart_register_driver(&input) return 0; } void __exit serport_exit(void) { uart_unregister_driver(&input); } module_init(serport_init); module_exit(serport_exit); --- serport.c DELETED --- |
From: James S. <jsi...@us...> - 2002-02-28 18:31:56
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv23609 Modified Files: q40fb.c Log Message: Updates. Index: q40fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/q40fb.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- q40fb.c 27 Aug 2001 16:36:15 -0000 1.6 +++ q40fb.c 28 Feb 2002 18:31:50 -0000 1.7 @@ -49,25 +49,18 @@ /* frame buffer operations */ int q40fb_init(void); -static int q40fb_check_var(struct fb_var_screeninfo *var,struct fb_info *info); static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info); static struct fb_ops q40fb_ops = { owner: THIS_MODULE, - fb_check_var: q40fb_check_var, fb_setcolreg: q40fb_setcolreg, fb_fillrect: cfb_fillrect, fb_copyarea: cfb_copyarea, fb_imageblit: cfb_imageblit, }; -static int q40fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - return 0; -} - static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info) @@ -100,7 +93,7 @@ fb_info.var = q40fb_var; fb_info.fix = q40fb_fix; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &q40fb_ops; fb_info.flags = FBINFO_FLAG_DEFAULT; /* not as module for now */ fb_info.pseudo_palette = pseudo_palette; @@ -116,4 +109,6 @@ printk(KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n", GET_FB_IDX(fb_info.node)); return 0; -} +} + +MODULE_LICENSE("GPL"); |
From: James S. <jsi...@us...> - 2002-02-28 18:29:00
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv22970 Modified Files: fm2fb.c hpfb.c Log Message: More updates. Index: fm2fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fm2fb.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- fm2fb.c 26 Dec 2001 17:28:11 -0000 1.8 +++ fm2fb.c 28 Feb 2002 18:28:58 -0000 1.9 @@ -114,7 +114,6 @@ * */ - /* * definitions */ @@ -135,7 +134,7 @@ static u32 pseudo_palette[17]; static struct fb_fix_screeninfo fb_fix __initdata = { - "", (unsigned long) NULL, FRAMEMASTER_REG, FB_TYPE_PACKED_PIXELS, 0, + NULL, (unsigned long) NULL, FRAMEMASTER_REG, FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_TRUECOLOR, 0, 0, 0, 768<<2, (unsigned long)NULL, 8, FB_ACCEL_NONE }; @@ -165,48 +164,29 @@ */ int fm2fb_init(void); -static int fm2fb_check_var(struct fb_var_screeninfo *var,struct fb_info *info); static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int fm2fb_blank(int blank, struct fb_info *info); -static int fm2fb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info); static struct fb_ops fm2fb_ops = { - owner: THIS_MODULE, - fb_check_var: fm2fb_check_var, - fb_setcolreg: fm2fb_setcolreg, - fb_blank: fm2fb_blank, - fb_pan_display: fm2fb_pan_display, + owner: THIS_MODULE, + fb_setcolreg: fm2fb_setcolreg, + fb_blank: fm2fb_blank, + fb_fillrect: cfb_fillrect, + fb_copyarea: cfb_copyarea, + fb_imageblit: cfb_imageblit, }; /* - * Set the User Defined Part of the Display - */ - -static int fm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - if (var->xres > info->var.xres || var->yres > info->var.yres || - var->xres_virtual > info->var.xres_virtual || - var->yres_virtual > info->var.yres_virtual || - var->bits_per_pixel > info->var.bits_per_pixel || - var->nonstd || - (var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED) - return -EINVAL; - return 0; -} - - /* * Blank the display. */ - -static void fm2fb_blank(int blank, struct fb_info *info) +static int fm2fb_blank(int blank, struct fb_info *info) { - unsigned char t = FRAMEMASTER_ROM; + unsigned char t = FRAMEMASTER_ROM; - if (!blank) - t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE; - fm2fb_reg[0] = t; + if (!blank) + t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE; + fm2fb_reg[0] = t; } /* @@ -214,32 +194,16 @@ * rounded down to the hardware's capabilities (according to the * entries in the var structure). Return != 0 for invalid regno. */ - static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - if (regno > 15) - return 1; - red >>= 8; - green >>= 8; - blue >>= 8; - - ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue; - return 0; -} - - /* - * Pan or Wrap the Display - * - * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag - */ + if (regno > 15) + return 1; + red >>= 8; + green >>= 8; + blue >>= 8; -static int fm2fb_pan_display(struct fb_var_screeninfo *var, int con, - struct fb_info *info) -{ - if (var->xoffset || var->yoffset) - return -EINVAL; - else + ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue; return 0; } @@ -249,109 +213,79 @@ int __init fm2fb_init(void) { - int is_fm; - struct zorro_dev *z = NULL; - unsigned long *ptr; - int x, y; + struct zorro_dev *z = NULL; + unsigned long *ptr; + int is_fm; + int x, y; - while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { - if (z->id == ZORRO_PROD_BSC_FRAMEMASTER_II) - is_fm = 1; - else if (z->id == ZORRO_PROD_HELFRICH_RAINBOW_II) - is_fm = 0; - else - continue; - if (!request_mem_region(z->resource.start, FRAMEMASTER_SIZE, "fm2fb")) - continue; + while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { + if (z->id == ZORRO_PROD_BSC_FRAMEMASTER_II) + is_fm = 1; + else if (z->id == ZORRO_PROD_HELFRICH_RAINBOW_II) + is_fm = 0; + else + continue; + + if (!request_mem_region(z->resource.start, FRAMEMASTER_SIZE, "fm2fb")) + continue; - /* assigning memory to kernel space */ - fb_fix.smem_start = z->resource.start; - fb_info.screen_base = ioremap(fb_fix.smem_start, FRAMEMASTER_SIZE); - fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG; - fm2fb_reg = (unsigned char *)(fb_info.screen_base+FRAMEMASTER_REG); + /* assigning memory to kernel space */ + fb_fix.smem_start = z->resource.start; + fb_info.screen_base = ioremap(fb_fix.smem_start, FRAMEMASTER_SIZE); + fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG; + fm2fb_reg = (unsigned char *)(fb_info.screen_base+FRAMEMASTER_REG); - strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II"); + strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II"); - /* make EBU color bars on display */ - ptr = (unsigned long *)fb_fix.smem_start; - for (y = 0; y < 576; y++) { - for (x = 0; x < 96; x++) *ptr++ = 0xffffff; /* white */ - for (x = 0; x < 96; x++) *ptr++ = 0xffff00; /* yellow */ - for (x = 0; x < 96; x++) *ptr++ = 0x00ffff; /* cyan */ - for (x = 0; x < 96; x++) *ptr++ = 0x00ff00; /* green */ - for (x = 0; x < 96; x++) *ptr++ = 0xff00ff; /* magenta */ - for (x = 0; x < 96; x++) *ptr++ = 0xff0000; /* red */ - for (x = 0; x < 96; x++) *ptr++ = 0x0000ff; /* blue */ - for (x = 0; x < 96; x++) *ptr++ = 0x000000; /* black */ - } - fm2fb_blank(0, NULL); + /* make EBU color bars on display */ + ptr = (unsigned long *)fb_fix.smem_start; + for (y = 0; y < 576; y++) { + for (x = 0; x < 96; x++) *ptr++ = 0xffffff;/* white */ + for (x = 0; x < 96; x++) *ptr++ = 0xffff00;/* yellow */ + for (x = 0; x < 96; x++) *ptr++ = 0x00ffff;/* cyan */ + for (x = 0; x < 96; x++) *ptr++ = 0x00ff00;/* green */ + for (x = 0; x < 96; x++) *ptr++ = 0xff00ff;/* magenta */ + for (x = 0; x < 96; x++) *ptr++ = 0xff0000;/* red */ + for (x = 0; x < 96; x++) *ptr++ = 0x0000ff;/* blue */ + for (x = 0; x < 96; x++) *ptr++ = 0x000000;/* black */ + } + fm2fb_blank(0, NULL); - if (fm2fb_mode == -1) - fm2fb_mode = FM2FB_MODE_PAL; + if (fm2fb_mode == -1) + fm2fb_mode = FM2FB_MODE_PAL; - strcpy(fb_info.modename, fb_fix.id); - fb_info.node = -1; - fb_info.fbops = &fm2fb_ops; - fb_info.var = fb_var_modes[fm2fb_mode]; - fb_info.screen_base = (char *)fb_fix.smem_start; - fb_info.pseudo_palette = pseudo_palette; - fb_info.fix = fb_fix; - fb_info.flags = FBINFO_FLAG_DEFAULT; + strcpy(fb_info.modename, fb_fix.id); + fb_info.node = NODEV; + fb_info.fbops = &fm2fb_ops; + fb_info.var = fb_var_modes[fm2fb_mode]; + fb_info.screen_base = (char *)fb_fix.smem_start; + fb_info.pseudo_palette = pseudo_palette; + fb_info.fix = fb_fix; + fb_info.flags = FBINFO_FLAG_DEFAULT; - if (register_framebuffer(&fb_info) < 0) - return -EINVAL; + if (register_framebuffer(&fb_info) < 0) + return -EINVAL; - printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node), - fb_fix.id); - return 0; - } - return -ENXIO; + printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node), fb_fix.id); + return 0; + } + return -ENXIO; } int __init fm2fb_setup(char *options) { - char *this_opt; - - if (!options || !*options) - return 0; - - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!strncmp(this_opt, "pal", 3)) - fm2fb_mode = FM2FB_MODE_PAL; - else if (!strncmp(this_opt, "ntsc", 4)) - fm2fb_mode = FM2FB_MODE_NTSC; - } - return 0; -} - - /* - * Blank the display. - */ + char *this_opt; -static void fm2fb_blank(int blank, struct fb_info *info) -{ - unsigned char t = FRAMEMASTER_ROM; + if (!options || !*options) + return 0; - if (!blank) - t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE; - fm2fb_reg[0] = t; + while ((this_opt = strsep(&options, ",")) != NULL) { + if (!strncmp(this_opt, "pal", 3)) + fm2fb_mode = FM2FB_MODE_PAL; + else if (!strncmp(this_opt, "ntsc", 4)) + fm2fb_mode = FM2FB_MODE_NTSC; + } + return 0; } - - /* - * Set a single color register. The values supplied are already - * rounded down to the hardware's capabilities (according to the - * entries in the var structure). Return != 0 for invalid regno. - */ -static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) -{ - if (regno > 15) - return 1; - red >>= 8; - green >>= 8; - blue >>= 8; - - ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue; - return 0; -} +MODULE_LICENSE("GPL"); Index: hpfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/hpfb.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- hpfb.c 28 Feb 2002 17:42:25 -0000 1.8 +++ hpfb.c 28 Feb 2002 18:28:58 -0000 1.9 @@ -99,9 +99,9 @@ static struct fb_ops hpfb_ops = { owner: THIS_MODULE, - fb_setcolreg: hpfb_setcolreg, - fb_fillrect: cfb_fillrect, - fb_copyarea: hpfb_copyarea, + fb_setcolreg: hpfb_setcolreg, + fb_fillrect: cfb_fillrect, + fb_copyarea: hpfb_copyarea, fb_imageblit: cfb_imageblit, }; @@ -186,27 +186,26 @@ */ #define INTFBADDR 0xf0560000 - if (hwreg_present((void *)INTFBADDR) && (DIO_ID(INTFBADDR) == DIO_ID_FBUFFER) - && topcat_sid_ok(sid = DIO_SECID(INTFBADDR))) - { + if (hwreg_present((void *)INTFBADDR) && + (DIO_ID(INTFBADDR) == DIO_ID_FBUFFER) && + topcat_sid_ok(sid = DIO_SECID(INTFBADDR))) { printk("Internal Topcat found (secondary id %02x)\n", sid); hpfb_init_one(INTFBADDR); - } - else - { + } else { int sc = dio_find(DIO_ID_FBUFFER); - if (sc) - { + + if (sc) { unsigned long addr = (unsigned long)dio_scodetoviraddr(sc); unsigned int sid = DIO_SECID(addr); - if (topcat_sid_ok(sid)) - { + if (topcat_sid_ok(sid)) { printk("Topcat found at DIO select code %02x " - "(secondary id %02x)\n", sc, sid); + "(secondary id %02x)\n", sc, sid); hpfb_init_one(addr); } } } return 0; } + +MODULE_LICENSE("GPL"); |