diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:09 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 01:21:48 -0500 |
commit | dd850f1223fe039ed649b34b1d2872b1f4221de9 (patch) | |
tree | 8fafc01a8b86e508f3430a0cbf77f15bb7d6e4da | |
parent | b3a076dd0270507e1976b141a2aa5c53b9b553d1 (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>
-rw-r--r-- | arch/arm/mach-clps711x/autcpu12.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/edb7211.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/p720t.c | 6 | ||||
-rw-r--r-- | drivers/video/clps711xfb.c | 21 |
4 files changed, 23 insertions, 6 deletions
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index d9b7f94a7ec9..c20043ba2076 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c | |||
@@ -61,6 +61,7 @@ static struct platform_device autcpu12_nvram_pdev __initdata = { | |||
61 | 61 | ||
62 | static void __init autcpu12_init(void) | 62 | static void __init autcpu12_init(void) |
63 | { | 63 | { |
64 | platform_device_register_simple("video-clps711x", 0, NULL, 0); | ||
64 | platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, | 65 | platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, |
65 | ARRAY_SIZE(autcpu12_cs8900_resource)); | 66 | ARRAY_SIZE(autcpu12_cs8900_resource)); |
66 | platform_device_register(&autcpu12_nvram_pdev); | 67 | platform_device_register(&autcpu12_nvram_pdev); |
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index 7add9add5bf3..59dec3bd0705 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c | |||
@@ -83,6 +83,7 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) | |||
83 | 83 | ||
84 | static void __init edb7211_init(void) | 84 | static void __init edb7211_init(void) |
85 | { | 85 | { |
86 | platform_device_register_simple("video-clps711x", 0, NULL, 0); | ||
86 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, | 87 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, |
87 | ARRAY_SIZE(edb7211_cs8900_resource)); | 88 | ARRAY_SIZE(edb7211_cs8900_resource)); |
88 | } | 89 | } |
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index 8fe33b3a204c..d95cb8ace251 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c | |||
@@ -119,6 +119,11 @@ static struct gpio_led_platform_data p720t_gpio_led_pdata __initdata = { | |||
119 | .num_leds = ARRAY_SIZE(p720t_gpio_leds), | 119 | .num_leds = ARRAY_SIZE(p720t_gpio_leds), |
120 | }; | 120 | }; |
121 | 121 | ||
122 | static void __init p720t_init(void) | ||
123 | { | ||
124 | platform_device_register_simple("video-clps711x", 0, NULL, 0); | ||
125 | } | ||
126 | |||
122 | static void __init p720t_init_late(void) | 127 | static void __init p720t_init_late(void) |
123 | { | 128 | { |
124 | platform_device_register_data(&platform_bus, "leds-gpio", 0, | 129 | platform_device_register_data(&platform_bus, "leds-gpio", 0, |
@@ -134,6 +139,7 @@ MACHINE_START(P720T, "ARM-Prospector720T") | |||
134 | .init_early = p720t_init_early, | 139 | .init_early = p720t_init_early, |
135 | .init_irq = clps711x_init_irq, | 140 | .init_irq = clps711x_init_irq, |
136 | .timer = &clps711x_timer, | 141 | .timer = &clps711x_timer, |
142 | .init_machine = p720t_init, | ||
137 | .init_late = p720t_init_late, | 143 | .init_late = p720t_init_late, |
138 | .restart = clps711x_restart, | 144 | .restart = clps711x_restart, |
139 | MACHINE_END | 145 | MACHINE_END |
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 | ||
273 | static void __init clps711x_guess_lcd_params(struct fb_info *info) | 273 | static 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 | ||
361 | int __init clps711xfb_init(void) | 361 | static 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) | |||
410 | out: return err; | 410 | out: return err; |
411 | } | 411 | } |
412 | 412 | ||
413 | static void __exit clps711xfb_exit(void) | 413 | static 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 | ||
427 | module_init(clps711xfb_init); | 429 | static struct platform_driver clps711x_fb_driver = { |
428 | module_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 | }; | ||
437 | module_platform_driver(clps711x_fb_driver); | ||
429 | 438 | ||
430 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 439 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
431 | MODULE_DESCRIPTION("CLPS711x framebuffer driver"); | 440 | MODULE_DESCRIPTION("CLPS711X framebuffer driver"); |
432 | MODULE_LICENSE("GPL"); | 441 | MODULE_LICENSE("GPL"); |