aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/clps711xfb.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-11-17 08:57:09 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 01:21:48 -0500
commitdd850f1223fe039ed649b34b1d2872b1f4221de9 (patch)
tree8fafc01a8b86e508f3430a0cbf77f15bb7d6e4da /drivers/video/clps711xfb.c
parentb3a076dd0270507e1976b141a2aa5c53b9b553d1 (diff)
ARM: clps711x: Transform clps711x-framebuffer to platform driver and use it
clps711x-framebuffer driver needs to be updated and this is a first step to make driver better. With this patch we are convert clps711x-framebuffer to platform device and load this driver from board code. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/video/clps711xfb.c')
-rw-r--r--drivers/video/clps711xfb.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c
index f994c8b8f10a..2ccbb9b2a255 100644
--- a/drivers/video/clps711xfb.c
+++ b/drivers/video/clps711xfb.c
@@ -270,7 +270,7 @@ static const struct file_operations backlight_proc_fops = {
270 .write = backlight_proc_write, 270 .write = backlight_proc_write,
271}; 271};
272 272
273static void __init clps711x_guess_lcd_params(struct fb_info *info) 273static void __devinit clps711x_guess_lcd_params(struct fb_info *info)
274{ 274{
275 unsigned int lcdcon, syscon, size; 275 unsigned int lcdcon, syscon, size;
276 unsigned long phys_base = PAGE_OFFSET; 276 unsigned long phys_base = PAGE_OFFSET;
@@ -358,7 +358,7 @@ static void __init clps711x_guess_lcd_params(struct fb_info *info)
358 info->fix.type = FB_TYPE_PACKED_PIXELS; 358 info->fix.type = FB_TYPE_PACKED_PIXELS;
359} 359}
360 360
361int __init clps711xfb_init(void) 361static int __devinit clps711x_fb_probe(struct platform_device *pdev)
362{ 362{
363 int err = -ENOMEM; 363 int err = -ENOMEM;
364 364
@@ -410,7 +410,7 @@ int __init clps711xfb_init(void)
410out: return err; 410out: return err;
411} 411}
412 412
413static void __exit clps711xfb_exit(void) 413static int __devexit clps711x_fb_remove(struct platform_device *pdev)
414{ 414{
415 unregister_framebuffer(cfb); 415 unregister_framebuffer(cfb);
416 kfree(cfb); 416 kfree(cfb);
@@ -422,11 +422,20 @@ static void __exit clps711xfb_exit(void)
422 PLD_LCDEN = 0; 422 PLD_LCDEN = 0;
423 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON); 423 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
424 } 424 }
425
426 return 0;
425} 427}
426 428
427module_init(clps711xfb_init); 429static struct platform_driver clps711x_fb_driver = {
428module_exit(clps711xfb_exit); 430 .driver = {
431 .name = "video-clps711x",
432 .owner = THIS_MODULE,
433 },
434 .probe = clps711x_fb_probe,
435 .remove = __devexit_p(clps711x_fb_remove),
436};
437module_platform_driver(clps711x_fb_driver);
429 438
430MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 439MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
431MODULE_DESCRIPTION("CLPS711x framebuffer driver"); 440MODULE_DESCRIPTION("CLPS711X framebuffer driver");
432MODULE_LICENSE("GPL"); 441MODULE_LICENSE("GPL");