diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/aty/radeon_pm.c | 15 | ||||
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 4 | ||||
-rw-r--r-- | drivers/video/console/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/fbsysfs.c | 12 | ||||
-rw-r--r-- | drivers/video/hitfb.c | 229 | ||||
-rw-r--r-- | drivers/video/i810/i810-i2c.c | 1 | ||||
-rw-r--r-- | drivers/video/i810/i810_main.c | 12 | ||||
-rw-r--r-- | drivers/video/matrox/i2c-matroxfb.c | 12 | ||||
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 13 | ||||
-rw-r--r-- | drivers/video/pvr2fb.c | 22 | ||||
-rw-r--r-- | drivers/video/savage/savagefb-i2c.c | 1 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 14 |
12 files changed, 245 insertions, 92 deletions
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index e308ed2..365de5d 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c @@ -2621,25 +2621,28 @@ static int radeon_restore_pci_cfg(struct radeonfb_info *rinfo) } -int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) +int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) { struct fb_info *info = pci_get_drvdata(pdev); struct radeonfb_info *rinfo = info->par; int i; - if (state.event == pdev->dev.power.power_state.event) + if (mesg.event == pdev->dev.power.power_state.event) return 0; - printk(KERN_DEBUG "radeonfb (%s): suspending to state: %d...\n", - pci_name(pdev), state.event); + printk(KERN_DEBUG "radeonfb (%s): suspending for event: %d...\n", + pci_name(pdev), mesg.event); /* For suspend-to-disk, we cheat here. We don't suspend anything and * let fbcon continue drawing until we are all set. That shouldn't * really cause any problem at this point, provided that the wakeup * code knows that any state in memory may not match the HW */ - if (state.event == PM_EVENT_FREEZE) + switch (mesg.event) { + case PM_EVENT_FREEZE: /* about to take snapshot */ + case PM_EVENT_PRETHAW: /* before restoring snapshot */ goto done; + } acquire_console_sem(); @@ -2706,7 +2709,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) release_console_sem(); done: - pdev->dev.power.power_state = state; + pdev->dev.power.power_state = mesg; return 0; } diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index ffc72ae..fe14883 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c @@ -20,7 +20,7 @@ #include <asm/cpu/dac.h> #include <asm/hp6xx/hp6xx.h> -#include <asm/hd64461/hd64461.h> +#include <asm/hd64461.h> #define HP680_MAX_INTENSITY 255 #define HP680_DEFAULT_INTENSITY 10 @@ -163,6 +163,6 @@ static void __exit hp680bl_exit(void) module_init(hp680bl_init); module_exit(hp680bl_exit); -MODULE_AUTHOR("Andriy Skulysh <askulysh@image.kiev.ua>"); +MODULE_AUTHOR("Andriy Skulysh <askulysh@gmail.com>"); MODULE_DESCRIPTION("HP Jornada 680 Backlight Driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 4444bef..aa3935d 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -6,7 +6,7 @@ menu "Console display driver support" config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE && !SUPERH default y help Saying Y here will allow you to use Linux in text mode through a diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 4f78f23..c151dcf 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct class_device *class_device, u8 tmp_curve[FB_BACKLIGHT_LEVELS]; unsigned int i; + /* Some drivers don't use framebuffer_alloc(), but those also + * don't have backlights. + */ + if (!fb_info || !fb_info->bl_dev) + return -ENODEV; + if (count != (FB_BACKLIGHT_LEVELS / 8 * 24)) return -EINVAL; @@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct class_device *class_device, char *buf) ssize_t len = 0; unsigned int i; + /* Some drivers don't use framebuffer_alloc(), but those also + * don't have backlights. + */ + if (!fb_info || !fb_info->bl_dev) + return -ENODEV; + mutex_lock(&fb_info->bl_mutex); for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) len += snprintf(&buf[len], PAGE_SIZE, diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c index 4cc6b45..3afb472 100644 --- a/drivers/video/hitfb.c +++ b/drivers/video/hitfb.c @@ -4,7 +4,7 @@ * (C) 1999 Mihai Spatar * (C) 2000 YAEGASHI Takeshi * (C) 2003, 2004 Paul Mundt - * (C) 2003, 2004 Andriy Skulysh + * (C) 2003, 2004, 2006 Andriy Skulysh * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for @@ -20,18 +20,16 @@ #include <linux/slab.h> #include <linux/delay.h> #include <linux/init.h> +#include <linux/platform_device.h> #include <linux/fb.h> #include <asm/machvec.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/io.h> -#include <asm/hd64461/hd64461.h> - -#ifdef MACH_HP600 +#include <asm/hd64461.h> #include <asm/cpu/dac.h> #include <asm/hp6xx/hp6xx.h> -#endif #define WIDTH 640 @@ -45,7 +43,6 @@ static struct fb_var_screeninfo hitfb_var __initdata = { static struct fb_fix_screeninfo hitfb_fix __initdata = { .id = "Hitachi HD64461", .type = FB_TYPE_PACKED_PIXELS, - .ypanstep = 8, .accel = FB_ACCEL_NONE, }; @@ -73,26 +70,14 @@ static inline void hitfb_accel_set_dest(int truecolor, u16 dx, u16 dy, if (truecolor) saddr <<= 1; - fb_writew(width, HD64461_BBTDWR); - fb_writew(height, HD64461_BBTDHR); + fb_writew(width-1, HD64461_BBTDWR); + fb_writew(height-1, HD64461_BBTDHR); fb_writew(saddr & 0xffff, HD64461_BBTDSARL); fb_writew(saddr >> 16, HD64461_BBTDSARH); } -static inline void hitfb_accel_solidfill(int truecolor, u16 dx, u16 dy, - u16 width, u16 height, u16 color) -{ - hitfb_accel_set_dest(truecolor, dx, dy, width, height); - - fb_writew(0x00f0, HD64461_BBTROPR); - fb_writew(16, HD64461_BBTMDR); - fb_writew(color, HD64461_GRSCR); - - hitfb_accel_start(truecolor); -} - static inline void hitfb_accel_bitblt(int truecolor, u16 sx, u16 sy, u16 dx, u16 dy, u16 width, u16 height, u16 rop, u32 mask_addr) @@ -100,6 +85,8 @@ static inline void hitfb_accel_bitblt(int truecolor, u16 sx, u16 sy, u16 dx, u32 saddr, daddr; u32 maddr = 0; + height--; + width--; fb_writew(rop, HD64461_BBTROPR); if ((sy < dy) || ((sy == dy) && (sx <= dx))) { saddr = WIDTH * (sy + height) + sx + width; @@ -146,6 +133,7 @@ static void hitfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) if (rect->rop != ROP_COPY) cfb_fillrect(p, rect); else { + hitfb_accel_wait(); fb_writew(0x00f0, HD64461_BBTROPR); fb_writew(16, HD64461_BBTMDR); @@ -161,16 +149,15 @@ static void hitfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) rect->height); hitfb_accel_start(0); } - hitfb_accel_wait(); } } static void hitfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) { + hitfb_accel_wait(); hitfb_accel_bitblt(p->var.bits_per_pixel == 16, area->sx, area->sy, area->dx, area->dy, area->width, area->height, 0x00cc, 0); - hitfb_accel_wait(); } static int hitfb_pan_display(struct fb_var_screeninfo *var, @@ -182,7 +169,7 @@ static int hitfb_pan_display(struct fb_var_screeninfo *var, if (xoffset != 0) return -EINVAL; - fb_writew(yoffset, HD64461_LCDCBAR); + fb_writew((yoffset*info->fix.line_length)>>10, HD64461_LCDCBAR); return 0; } @@ -192,12 +179,6 @@ int hitfb_blank(int blank_mode, struct fb_info *info) unsigned short v; if (blank_mode) { -#ifdef MACH_HP600 - sh_dac_disable(DAC_LCD_BRIGHTNESS); - v = fb_readw(HD64461_GPBDR); - v |= HD64461_GPBDR_LCDOFF; - fb_writew(v, HD64461_GPBDR); -#endif v = fb_readw(HD64461_LDR1); v &= ~HD64461_LDR1_DON; fb_writew(v, HD64461_LDR1); @@ -213,19 +194,18 @@ int hitfb_blank(int blank_mode, struct fb_info *info) v = fb_readw(HD64461_STBCR); v &= ~HD64461_STBCR_SLCDST; fb_writew(v, HD64461_STBCR); -#ifdef MACH_HP600 - sh_dac_enable(DAC_LCD_BRIGHTNESS); - v = fb_readw(HD64461_GPBDR); - v &= ~HD64461_GPBDR_LCDOFF; - fb_writew(v, HD64461_GPBDR); -#endif - v = fb_readw(HD64461_LDR1); - v |= HD64461_LDR1_DON; - fb_writew(v, HD64461_LDR1); v = fb_readw(HD64461_LCDCCR); - v &= ~HD64461_LCDCCR_MOFF; + v &= ~(HD64461_LCDCCR_MOFF | HD64461_LCDCCR_STREQ); fb_writew(v, HD64461_LCDCCR); + + do { + v = fb_readw(HD64461_LCDCCR); + } while(v&HD64461_LCDCCR_STBACK); + + v = fb_readw(HD64461_LDR1); + v |= HD64461_LDR1_DON; + fb_writew(v, HD64461_LDR1); } return 0; } @@ -233,7 +213,7 @@ int hitfb_blank(int blank_mode, struct fb_info *info) static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info) { - if (regno >= info->cmap.len) + if (regno >= 256) return 1; switch (info->var.bits_per_pixel) { @@ -244,6 +224,8 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green, fb_writew(blue >> 10, HD64461_CPTWDR); break; case 16: + if (regno >= 16) + return 1; ((u32 *) (info->pseudo_palette))[regno] = ((red & 0xf800)) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11); @@ -252,26 +234,113 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } +static int hitfb_sync(struct fb_info *info) +{ + hitfb_accel_wait(); + + return 0; +} + +static int hitfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) +{ + int maxy; + + var->xres = info->var.xres; + var->xres_virtual = info->var.xres; + var->yres = info->var.yres; + + if ((var->bits_per_pixel != 8) && (var->bits_per_pixel != 16)) + var->bits_per_pixel = info->var.bits_per_pixel; + + if (var->yres_virtual < var->yres) + var->yres_virtual = var->yres; + + maxy = info->fix.smem_len / var->xres; + + if (var->bits_per_pixel == 16) + maxy /= 2; + + if (var->yres_virtual > maxy) + var->yres_virtual = maxy; + + var->xoffset = 0; + var->yoffset = 0; + + switch (var->bits_per_pixel) { + case 8: + var->red.offset = 0; + var->red.length = 8; + var->green.offset = 0; + var->green.length = 8; + var->blue.offset = 0; + var->blue.length = 8; + var->transp.offset = 0; + var->transp.length = 0; + break; + case 16: /* RGB 565 */ + var->red.offset = 11; + var->red.length = 5; + var->green.offset = 5; + var->green.length = 6; + var->blue.offset = 0; + var->blue.length = 5; + var->transp.offset = 0; + var->transp.length = 0; + break; + } + + return 0; +} + +static int hitfb_set_par(struct fb_info *info) +{ + unsigned short ldr3; + + switch (info->var.bits_per_pixel) { + case 8: + info->fix.line_length = info->var.xres; + info->fix.visual = FB_VISUAL_PSEUDOCOLOR; + info->fix.ypanstep = 16; + break; + case 16: + info->fix.line_length = info->var.xres*2; + info->fix.visual = FB_VISUAL_TRUECOLOR; + info->fix.ypanstep = 8; + break; + } + + fb_writew(info->fix.line_length, HD64461_LCDCLOR); + ldr3 = fb_readw(HD64461_LDR3); + ldr3 &= ~15; + ldr3 |= (info->var.bits_per_pixel == 8) ? 4 : 8; + fb_writew(ldr3, HD64461_LDR3); + return 0; +} + static struct fb_ops hitfb_ops = { .owner = THIS_MODULE, + .fb_check_var = hitfb_check_var, + .fb_set_par = hitfb_set_par, .fb_setcolreg = hitfb_setcolreg, .fb_blank = hitfb_blank, + .fb_sync = hitfb_sync, .fb_pan_display = hitfb_pan_display, .fb_fillrect = hitfb_fillrect, .fb_copyarea = hitfb_copyarea, .fb_imageblit = cfb_imageblit, }; -int __init hitfb_init(void) +static int __init hitfb_probe(struct platform_device *dev) { unsigned short lcdclor, ldr3, ldvndr; - int size; if (fb_get_options("hitfb", NULL)) return -ENODEV; + hitfb_fix.mmio_start = CONFIG_HD64461_IOBASE+0x1000; + hitfb_fix.mmio_len = 0x1000; hitfb_fix.smem_start = CONFIG_HD64461_IOBASE + 0x02000000; - hitfb_fix.smem_len = (MACH_HP690) ? 1024 * 1024 : 512 * 1024; + hitfb_fix.smem_len = 512 * 1024; lcdclor = fb_readw(HD64461_LCDCLOR); ldvndr = fb_readw(HD64461_LDVNDR); @@ -321,12 +390,12 @@ int __init hitfb_init(void) fb_info.var = hitfb_var; fb_info.fix = hitfb_fix; fb_info.pseudo_palette = pseudo_palette; - fb_info.flags = FBINFO_DEFAULT; + fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | + FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; fb_info.screen_base = (void *)hitfb_fix.smem_start; - size = (fb_info.var.bits_per_pixel == 8) ? 256 : 16; - fb_alloc_cmap(&fb_info.cmap, size, 0); + fb_alloc_cmap(&fb_info.cmap, 256, 0); if (register_framebuffer(&fb_info) < 0) return -EINVAL; @@ -336,9 +405,75 @@ int __init hitfb_init(void) return 0; } +static int __devexit hitfb_remove(struct platform_device *dev) +{ + return unregister_framebuffer(&fb_info); +} + +#ifdef CONFIG_PM +static int hitfb_suspend(struct platform_device *dev, pm_message_t state) +{ + u16 v; + + hitfb_blank(1,0); + v = fb_readw(HD64461_STBCR); + v |= HD64461_STBCR_SLCKE_IST; + fb_writew(v, HD64461_STBCR); + + return 0; +} + +static int hitfb_resume(struct platform_device *dev) +{ + u16 v; + + v = fb_readw(HD64461_STBCR); + v &= ~HD64461_STBCR_SLCKE_OST; + msleep(100); + v = fb_readw(HD64461_STBCR); + v &= ~HD64461_STBCR_SLCKE_IST; + fb_writew(v, HD64461_STBCR); + hitfb_blank(0,0); + + return 0; +} +#endif + +static struct platform_driver hitfb_driver = { + .probe = hitfb_probe, + .remove = __devexit_p(hitfb_remove), +#ifdef CONFIG_PM + .suspend = hitfb_suspend, + .resume = hitfb_resume, +#endif + .driver = { + .name = "hitfb", + }, +}; + +static struct platform_device hitfb_device = { + .name = "hitfb", + .id = -1, +}; + +static int __init hitfb_init(void) +{ + int ret; + + ret = platform_driver_register(&hitfb_driver); + if (!ret) { + ret = platform_device_register(&hitfb_device); + if (ret) + platform_driver_unregister(&hitfb_driver); + } + return ret; +} + + static void __exit hitfb_exit(void) { - unregister_framebuffer(&fb_info); + platform_device_unregister(&hitfb_device); + platform_driver_unregister(&hitfb_driver); } module_init(hitfb_init); diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index c1f7b49..7d06b38 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c @@ -98,7 +98,6 @@ static int i810_setup_i2c_bus(struct i810fb_i2c_chan *chan, const char *name) chan->algo.getsda = i810i2c_getsda; chan->algo.getscl = i810i2c_getscl; chan->algo.udelay = 10; - chan->algo.mdelay = 10; chan->algo.timeout = (HZ/2); chan->algo.data = chan; diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index a6ca02f..d42edac 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c @@ -1554,15 +1554,17 @@ static struct fb_ops i810fb_ops __devinitdata = { /*********************************************************************** * Power Management * ***********************************************************************/ -static int i810fb_suspend(struct pci_dev *dev, pm_message_t state) +static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg) { struct fb_info *info = pci_get_drvdata(dev); struct i810fb_par *par = info->par; - par->cur_state = state.event; + par->cur_state = mesg.event; - if (state.event == PM_EVENT_FREEZE) { - dev->dev.power.power_state = state; + switch (mesg.event) { + case PM_EVENT_FREEZE: + case PM_EVENT_PRETHAW: + dev->dev.power.power_state = mesg; return 0; } @@ -1578,7 +1580,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t state) pci_save_state(dev); pci_disable_device(dev); - pci_set_power_state(dev, pci_choose_state(dev, state)); + pci_set_power_state(dev, pci_choose_state(dev, mesg)); release_console_sem(); return 0; diff --git a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c index 57abbae..795c1a9 100644 --- a/drivers/video/matrox/i2c-matroxfb.c +++ b/drivers/video/matrox/i2c-matroxfb.c @@ -95,12 +95,12 @@ static struct i2c_adapter matrox_i2c_adapter_template = static struct i2c_algo_bit_data matrox_i2c_algo_template = { - NULL, - matroxfb_gpio_setsda, - matroxfb_gpio_setscl, - matroxfb_gpio_getsda, - matroxfb_gpio_getscl, - 10, 10, 100, + .setsda = matroxfb_gpio_setsda, + .setscl = matroxfb_gpio_setscl, + .getsda = matroxfb_gpio_getsda, + .getscl = matroxfb_gpio_getscl, + .udelay = 10, + .timeout = 100, }; static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index d4f8501..f8cd4c5 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -950,24 +950,25 @@ static struct fb_ops nvidia_fb_ops = { }; #ifdef CONFIG_PM -static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t state) +static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg) { struct fb_info *info = pci_get_drvdata(dev); struct nvidia_par *par = info->par; + if (mesg.event == PM_EVENT_PRETHAW) + mesg.event = PM_EVENT_FREEZE; acquire_console_sem(); - par->pm_state = state.event; + par->pm_state = mesg.event; - if (state.event == PM_EVENT_FREEZE) { - dev->dev.power.power_state = state; - } else { + if (mesg.event == PM_EVENT_SUSPEND) { fb_set_suspend(info, 1); nvidiafb_blank(FB_BLANK_POWERDOWN, info); nvidia_write_regs(par, &par->SavedReg); pci_save_state(dev); pci_disable_device(dev); - pci_set_power_state(dev, pci_choose_state(dev, state)); + pci_set_power_state(dev, pci_choose_state(dev, mesg)); } + dev->dev.power.power_state = mesg; release_console_sem(); return 0; diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index 940ba2b..78dc59a 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c @@ -187,7 +187,7 @@ static short do_blank = 0; /* (Un)Blank the screen */ static unsigned int is_blanked = 0; /* Is the screen blanked? */ #ifdef CONFIG_SH_STORE_QUEUES -static struct sq_mapping *pvr2fb_map; +static unsigned long pvr2fb_map; #endif #ifdef CONFIG_SH_DMA @@ -213,15 +213,17 @@ static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp); static int pvr2_init_cable(void); static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val, int size); +#ifdef CONFIG_SH_DMA static ssize_t pvr2fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos); +#endif static struct fb_ops pvr2fb_ops = { - .owner = THIS_MODULE, - .fb_setcolreg = pvr2fb_setcolreg, - .fb_blank = pvr2fb_blank, - .fb_check_var = pvr2fb_check_var, - .fb_set_par = pvr2fb_set_par, + .owner = THIS_MODULE, + .fb_setcolreg = pvr2fb_setcolreg, + .fb_blank = pvr2fb_blank, + .fb_check_var = pvr2fb_check_var, + .fb_set_par = pvr2fb_set_par, #ifdef CONFIG_SH_DMA .fb_write = pvr2fb_write, #endif @@ -783,7 +785,7 @@ static int __init pvr2fb_common_init(void) goto out_err; } - fb_memset((unsigned long)fb_info->screen_base, 0, pvr2_fix.smem_len); + fb_memset(fb_info->screen_base, 0, pvr2_fix.smem_len); pvr2_fix.ypanstep = nopan ? 0 : 1; pvr2_fix.ywrapstep = nowrap ? 0 : 1; @@ -820,7 +822,7 @@ static int __init pvr2fb_common_init(void) modememused >> 10, (unsigned long)(fb_info->fix.smem_len >> 10)); printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", fb_info->node, fb_info->var.xres, fb_info->var.yres, - fb_info->var.bits_per_pixel, + fb_info->var.bits_per_pixel, get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), (char *)pvr2_get_param(cables, NULL, cable_type, 3), (char *)pvr2_get_param(outputs, NULL, video_output, 3)); @@ -829,10 +831,10 @@ static int __init pvr2fb_common_init(void) printk(KERN_NOTICE "fb%d: registering with SQ API\n", fb_info->node); pvr2fb_map = sq_remap(fb_info->fix.smem_start, fb_info->fix.smem_len, - fb_info->fix.id); + fb_info->fix.id, pgprot_val(PAGE_SHARED)); printk(KERN_NOTICE "fb%d: Mapped video memory to SQ addr 0x%lx\n", - fb_info->node, pvr2fb_map->sq_addr); + fb_info->node, pvr2fb_map); #endif return 0; diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index e83befd..d7d810db 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -148,7 +148,6 @@ static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan, chan->adapter.algo_data = &chan->algo; chan->adapter.dev.parent = &chan->par->pcidev->dev; chan->algo.udelay = 40; - chan->algo.mdelay = 5; chan->algo.timeout = 20; chan->algo.data = chan; diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 461e094..82b3dea 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -2323,24 +2323,24 @@ static void __devexit savagefb_remove(struct pci_dev *dev) } } -static int savagefb_suspend(struct pci_dev* dev, pm_message_t state) +static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg) { struct fb_info *info = pci_get_drvdata(dev); struct savagefb_par *par = info->par; DBG("savagefb_suspend"); - - par->pm_state = state.event; + if (mesg.event == PM_EVENT_PRETHAW) + mesg.event = PM_EVENT_FREEZE; + par->pm_state = mesg.event; + dev->dev.power.power_state = mesg; /* * For PM_EVENT_FREEZE, do not power down so the console * can remain active. */ - if (state.event == PM_EVENT_FREEZE) { - dev->dev.power.power_state = state; + if (mesg.event == PM_EVENT_FREEZE) return 0; - } acquire_console_sem(); fb_set_suspend(info, 1); @@ -2353,7 +2353,7 @@ static int savagefb_suspend(struct pci_dev* dev, pm_message_t state) savage_disable_mmio(par); pci_save_state(dev); pci_disable_device(dev); - pci_set_power_state(dev, pci_choose_state(dev, state)); + pci_set_power_state(dev, pci_choose_state(dev, mesg)); release_console_sem(); return 0; |