X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Fau1100fb.c;h=378f27745a1db94e18e8fd3b70d0318c2e88b490;hb=c93f216b5b985a12a18323e5ca2eb01db3d2f000;hp=80a81eccad363aeaf25d21fb805f4972c8bb5fdd;hpb=60f29b1e1600d89aee5e529acb4b276a6650cb8b;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 80a81eccad3..378f27745a1 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c @@ -115,6 +115,52 @@ static int nocursor = 0; module_param(nocursor, int, 0644); MODULE_PARM_DESC(nocursor, "cursor enable/disable"); +/* fb_blank + * Blank the screen. Depending on the mode, the screen will be + * activated with the backlight color, or desactivated + */ +static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) +{ + struct au1100fb_device *fbdev = to_au1100fb_device(fbi); + + print_dbg("fb_blank %d %p", blank_mode, fbi); + + switch (blank_mode) { + + case VESA_NO_BLANKING: + /* Turn on panel */ + fbdev->regs->lcd_control |= LCD_CONTROL_GO; +#ifdef CONFIG_MIPS_PB1100 + if (drv_info.panel_idx == 1) { + au_writew(au_readw(PB1100_G_CONTROL) + | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), + PB1100_G_CONTROL); + } +#endif + au_sync(); + break; + + case VESA_VSYNC_SUSPEND: + case VESA_HSYNC_SUSPEND: + case VESA_POWERDOWN: + /* Turn off panel */ + fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; +#ifdef CONFIG_MIPS_PB1100 + if (drv_info.panel_idx == 1) { + au_writew(au_readw(PB1100_G_CONTROL) + & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), + PB1100_G_CONTROL); + } +#endif + au_sync(); + break; + default: + break; + + } + return 0; +} + /* * Set hardware with var settings. This will enable the controller with a specific * mode, normally validated with the fb_check_var method @@ -272,52 +318,6 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned return 0; } -/* fb_blank - * Blank the screen. Depending on the mode, the screen will be - * activated with the backlight color, or desactivated - */ -int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) -{ - struct au1100fb_device *fbdev = to_au1100fb_device(fbi); - - print_dbg("fb_blank %d %p", blank_mode, fbi); - - switch (blank_mode) { - - case VESA_NO_BLANKING: - /* Turn on panel */ - fbdev->regs->lcd_control |= LCD_CONTROL_GO; -#ifdef CONFIG_MIPS_PB1100 - if (drv_info.panel_idx == 1) { - au_writew(au_readw(PB1100_G_CONTROL) - | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), - PB1100_G_CONTROL); - } -#endif - au_sync(); - break; - - case VESA_VSYNC_SUSPEND: - case VESA_HSYNC_SUSPEND: - case VESA_POWERDOWN: - /* Turn off panel */ - fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; -#ifdef CONFIG_MIPS_PB1100 - if (drv_info.panel_idx == 1) { - au_writew(au_readw(PB1100_G_CONTROL) - & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), - PB1100_G_CONTROL); - } -#endif - au_sync(); - break; - default: - break; - - } - return 0; -} - /* fb_pan_display * Pan display in x and/or y as specified */ @@ -457,7 +457,7 @@ static struct fb_ops au1100fb_ops = /* AU1100 LCD controller device driver */ -int au1100fb_drv_probe(struct device *dev) +static int __init au1100fb_drv_probe(struct platform_device *dev) { struct au1100fb_device *fbdev = NULL; struct resource *regs_res; @@ -475,7 +475,7 @@ int au1100fb_drv_probe(struct device *dev) fbdev->panel = &known_lcd_panels[drv_info.panel_idx]; - dev_set_drvdata(dev, (void*)fbdev); + platform_set_drvdata(dev, (void *)fbdev); /* Allocate region for our registers and map them */ if (!(regs_res = platform_get_resource(to_platform_device(dev), @@ -583,19 +583,19 @@ failed: fb_dealloc_cmap(&fbdev->info.cmap); } kfree(fbdev); - dev_set_drvdata(dev, NULL); + platform_set_drvdata(dev, NULL); return 0; } -int au1100fb_drv_remove(struct device *dev) +int au1100fb_drv_remove(struct platform_device *dev) { struct au1100fb_device *fbdev = NULL; if (!dev) return -ENODEV; - fbdev = (struct au1100fb_device*) dev_get_drvdata(dev); + fbdev = (struct au1100fb_device *) platform_get_drvdata(dev); #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); @@ -620,9 +620,9 @@ int au1100fb_drv_remove(struct device *dev) static u32 sys_clksrc; static struct au1100fb_regs fbregs; -int au1100fb_drv_suspend(struct device *dev, pm_message_t state) +int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state) { - struct au1100fb_device *fbdev = dev_get_drvdata(dev); + struct au1100fb_device *fbdev = platform_get_drvdata(dev); if (!fbdev) return 0; @@ -641,9 +641,9 @@ int au1100fb_drv_suspend(struct device *dev, pm_message_t state) return 0; } -int au1100fb_drv_resume(struct device *dev) +int au1100fb_drv_resume(struct platform_device *dev) { - struct au1100fb_device *fbdev = dev_get_drvdata(dev); + struct au1100fb_device *fbdev = platform_get_drvdata(dev); if (!fbdev) return 0; @@ -663,10 +663,11 @@ int au1100fb_drv_resume(struct device *dev) #define au1100fb_drv_resume NULL #endif -static struct device_driver au1100fb_driver = { - .name = "au1100-lcd", - .bus = &platform_bus_type, - +static struct platform_driver au1100fb_driver = { + .driver = { + .name = "au1100-lcd", + .owner = THIS_MODULE, + }, .probe = au1100fb_drv_probe, .remove = au1100fb_drv_remove, .suspend = au1100fb_drv_suspend, @@ -753,12 +754,12 @@ int __init au1100fb_init(void) return ret; } - return driver_register(&au1100fb_driver); + return platform_driver_register(&au1100fb_driver); } void __exit au1100fb_cleanup(void) { - driver_unregister(&au1100fb_driver); + platform_driver_unregister(&au1100fb_driver); kfree(drv_info.opt_mode); }