linux kernel framebuffer 驱动框架
努力成为linux kernel hacker的人李万鹏原创作品,为梦而战。转载请标明出处
http://doc.xuehai.net/woshixingaaa/archive/2011/05/29/6452689.aspx
下面详细分析一下framebuffer的驱动源码,framebuffer作为一个平台驱动注册进内核:1.static struct platform_driver s3c2410fb_driver = { 2.3.4.
5.
6.
7.
8.
9. .probe = s3c2410fb_probe, .remove = s3c2410fb_remove, .suspend = s3c2410fb_suspend, .resume = s3c2410fb_resume, .driver = { .name = "s3c2410-lcd", .owner = THIS_MODULE, },
10.};
11.
12.int __init s3c2410fb_init(void)
13.{
14. int ret = platform_driver_register(&s3c2410fb_driver);
15.
16. if (ret == 0)
17. ret = platform_driver_register(&s3c2412fb_driver);;
18.
19. return ret; Object 186Object 122Object 133Object 144Object 168Object 50Object 46
20.}
21.
22.static void __exit s3c2410fb_cleanup(void)
23.{
24. platform_driver_unregister(&s3c2410fb_driver);
25. platform_driver_unregister(&s3c2412fb_driver); Object 47
26.} Object 123Object 134
27.
Object 51
28.module_init(s3c2410fb_init);
29.module_exit(s3c2410fb_cleanup);
在arch/arm/plat-s3c24xx/devs.c中定义了framebuffer的平台设备:Object 67
1./* LCD Controller */
2.static struct resource s3c_lcd_resource[] = { Object 48
Object 107
3.
4.
5.
6.
7. [0] = { .start = S3C24XX_PA_LCD, //IO内存的物理起始地址 .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, //IO内存的物理结束地址 Object 52 .flags = IORESOURCE_MEM, }, Object 135Object 124Object 26
Object 53Object 49
Object 68
Object 18Object 17Object 16Object 15Object 14Object 13Object 12Object 11Object 10Object 35Object 34Object 33Object 32Object 31Object 30Object 29Object 28Object 27Object 25Object 24Object 23Object 22Object 21Object 9Object 8Object 7Object 6Object 5Object 4Object 3Object 2Object 1Object 20Object 19Object 43Object 42Object 41Object 40Object 39Object 38Object 37Object 59Object 58Object 57Object 56Object 55Object 106Object 105Object 104Object 103Object 102Object 101Object 100Object 121Object 120Object 119Object 118Object 117Object 116Object 115Object 114Object 113Object 112Object 111Object 110Object 109Object 108Object 132Object 131Object 130Object 129Object 128Object 127Object 126Object 125Object 143Object 142Object 141Object 140Object 139Object 138Object 137Object 136Object 167Object 166Object 165Object 164Object 163Object 162Object 161Object 160Object 159Object 158Object 157Object 156Object 155Object 154Object 153Object 152Object 151Object 150Object 149Object 148Object 147Object 146Object 145Object 185Object 184Object 183Object 182Object 181Object 180Object 179Object 178Object 177Object 176Object 175Object 174Object 173Object 172Object 171Object 170Object 169Object 206Object 205Object 204Object 203Object 202Object 201Object 200Object 199Object 198Object 197Object 196Object 195Object 194Object 193Object 192Object 191Object 190Object 189Object 188Object 187Object 45Object 44Object 66Object 65Object 64Object 63Object 62Object 61Object 60Object 95Object 94Object 93Object 92Object 91Object 90Object 89Object 88Object 87Object 86Object 85Object 84Object 83Object 82Object 81Object 80Object 79Object 78Object 77Object 76Object 75Object 74Object 73Object 72Object 71Object 70Object 69Object 36Object 99Object 98Object 97Object 96Object 54