Learning Vedon Video Experience (ii)

Source: Internet
Author: User

Learning Vedon Video Experience (ii)

1. character device driver

650) this.width=650; "Width=" 554 "height=" src= "http://set1.mail.qq.com/cgi-bin/viewfile?f=" 66a91c2d59b9219710e547f38e426ebf73c1f43bc261b6a905fca7b68826ff35c95863545fddb8342855c0b729bc204d2547d636eccfc8dd762f3308c B8aa7f6e5287fb24010ed42263ac9d5aa82ae97e802101bf2ad88ea03961f204dc625c0&mailid= zc4007-6srmlqr2zthzidlsxwyze55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" Border:none;vertical-align: Middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

650) this.width=650, "width=", "height=" 162 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebf73c1f43bc261b6a905fca7b68826ff35c95863545fddb8342855c0b729bc204d2547d636eccfc8ddf73ed9387 Ac3372910d7282c34f48f2dd7bba36f4be3fcb4aef36253222ffa294903fcde2a8bbeb2&mailid= zc4007-6srmlqr2zthzidlsxwyze55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" Border:none;vertical-align: Middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

Figure 2.7 LCD Hardware Framework

The character device is the most basic device driver in a Linux device and is the cornerstone of other large drives. Character Set

The driver model, as shown in 2.8.

Linux Kernel driver modules are usually composed of module loading function, module unloading function, module license declaration and so on. In the character device driver, register the main device in the module load function, register the operation method, create the device node and so on. Character device driver porting steps:

(1) Create the device file in the module load function, register the main device number, register the operation method

(2) implement their respective operation methods separately

Linux Kernel driver modules are usually composed of module loading function, module unloading function, module license declaration and so on. Registers the master device in the module load function in the character device driver, registers the operation method, creates

650) this.width=650; "width=" 552 "height=" 313 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebf73c1f43bc261b6a905fca7b68826ff35c95863545fddb8342855c0b729bc204d2547d636eccfc8dd56ba60349 544957afcd6a9a932a00575dfa626e969897b6608c11d2da63f7cd32ef9612e49acef26&mailid= zc4007-6srmlqr2zthzidlsxwyze55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" Border:none;vertical-align: Middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

Figure 2.8 Character Device frame diagram

operations such as device nodes. Character device driver porting steps:

(1) Create the device file in the module load function, register the main device number, register the operation method

(2) implement their respective operation methods separately

2. platform Device Drive mechanism

(8)

650) this.width=650; "Width=" 408 "height=" 224 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebf73c1f43bc261b6a905fca7b68826ff35c95863545fddb8342855c0b729bc204d2547d636eccfc8ddd3b4e399a 39be1a9b4300f420e34a2d4c5317eb97a6f7143be10aeb0434738d9b617a50e64ccb71a&mailid= zc4007-6srmlqr2zthzidlsxwyze55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" Border:none;vertical-align: Middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

Figure 2.9 Character device frame diagram

struct platform_device platform device structure, a platform device corresponding to an actual physical device, the most important thing in the actual device is the hardware information of the physical device, such as: Register address, interrupt number, etc. In linux void  * platform_register_device () Register the platform device structure into the platform device chain list. As shown in 2.9.

    struct Platform_driver platform-driven structure, A platform driver corresponds to a driver, the function interface platform_regisister_driver () Span style= "FONT-SIZE:16PX;" > Register the device driver in the device driver chain list. When the driver or platform device registers the corresponding linked list is constantly querying each other's linked list through struct platform_mach_id probe probe

Compared with the ordinary character device, the platform device driving mechanism separates the device resources from the drive, which makes the drive migration more convenient and convenient. But at the same time, because in order to make the driver universality and the portability characteristic, in the Linux kernel is often divides into the multilayer structure, several files, in the driving internal relations are intricate, the function call relation is very complex, the Linux drive and the kernel seamless.

In Linux device drivers tend to use layered thinking, so that the code has a high interoperability, in large-scale drive, multi-layered structure, the relationship is complex, while the Linux device driven by the idea of object-oriented, using a large number of structures, including the relationship is very complex. As shown in 2.10.

650) this.width=650; "Width=" 554 "height=" 203 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebf73c1f43bc261b6a905fca7b68826ff35c95863545fddb8342855c0b729bc204d2547d636eccfc8dd441ae131d 6856a3fbbf3f7fe8781c73095d1969ed961506468f5a212a5cc7cc1e078257005a9c5c8&mailid= zc4007-6srmlqr2zthzidlsxwyze55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" Border:none;vertical-align: Middle, "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

through the above-mentioned layered thought, it achieves the function of code interoperability, and draws on the object-oriented thought.


Learning Vedon Video Experience (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.