05-S3C2440 learning kernel (porting) linux3.4.2 porting (4) support LED driver, button driver

Publisher:吉州古玩斋Latest update time:2022-05-28 Source: eefocusKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Previous work:

(1) Re-port the 3.4.2 kernel, modify the partitions, and create the jffs2 file system


http://blog.csdn.net/fengyuwuzu0519/article/details/69802922


(2) Modify the kernel to support yffs2, create a yffs2 file system, trim the kernel, and create patches


http://blog.csdn.net/fengyuwuzu0519/article/details/70162666


(3) Transplant kernel to support DM9000C network card driver (can use mount nfs) and three-way serial port


http://blog.csdn.net/fengyuwuzu0519/article/details/72846205


So far, the kernel we have ported is basically complete and includes the network card driver, but there are still too few drivers. Now we port the previously written 2.6.22 driver to linux3.4.2 to expand the system driver.


The next job:


There are many kernel upgrades, and many header files will be deleted, or some macros will be renamed or no longer used, resulting in some header files in the driver being no longer valid and some functions being unable to be used as before. Therefore, when we modify the driver, we mainly address the function changes brought about by the kernel upgrade, because the compilation of the driver depends on the kernel.


2. Transplant linux2.26LED, button and other drivers to 3.4.2 kernel

1. Driver migration method between kernels


1. Compile

2. Solve the error

2.1 Wrong header file: remove or rename

2.2 Wrong macro: rename and use a new macro

2.3 Some functions are gone: rename and use new functions

2. Transplantation process

(1) Transplant LED driver

Update the kernel directory in the kernel, which needs to be compiled in advance

Make directly and see what errors there are

Some header files no longer exist, just remove them and see

Compile again

If there is a problem with the class_create declaration, then see how other kernel drivers use this function.

It should be the missing header file, including:

Compile again

I found that this function is black, so it should be no longer used. So search for class_create.



The function name is changed to: device_create

The export function is renamed to: device_destroy(firstdrv_class, MKDEV(major, 0));

Compile successfully and copy to the board

Loading Driver

 

 

This is the LED driver transplantation result.

(2) Transplanting the key driver

Modify the makefile and then make directly

Add the above header files

Pin declaration is gone

See which function is used, kernel search

The solution is given below



Continue compiling

After this is expanded, there is this variable, which should be due to some headers not being included.

Missing header file, see how others use this function


Continue compiling


How to use the search request_irq

The name of the macro has changed. How to use this function?



Many drivers are similar, we can modify them by comparing the software:

Continue compiling:



Uninstall error:

The function parameters have changed

 

Kill the application that uses it before uninstalling the driver.

Keywords:S3C2440 Reference address:05-S3C2440 learning kernel (porting) linux3.4.2 porting (4) support LED driver, button driver

Previous article:06-S3C2440 learning: transplanting 2012u-boot to S3C2440 (transplantation process 1) creating a new board + modifying the clock + SDRAM + UART
Next article:05-S3C2440 learning kernel (porting) linux3.4.2 porting (3) support DM9000C network card and modify support serial port 2

Recommended ReadingLatest update time:2024-11-21 20:28

Design of educational robot based on STC12C5A60S2
At present, many higher education institutions use educational robots for classroom teaching and cultivating students' innovative ability. The educational robot designed in this paper detects road information through an infrared photoelectric sensor array and uses a fuzzy self-tuning PID algorithm to process the col
[Microcontroller]
Design of educational robot based on STC12C5A60S2
China's power battery market in April: overall positive
Let's take stock of the situation of China's power battery industry. Driven by the demand for new energy vehicles, the overall industry was still good in April. ● In April, production, sales, installation and export volumes were 58.5GWh, 55.1GWh, 35.4GWh and 9.0GWh respectively. Note: Full-cali
[Automotive Electronics]
After launching its first 4K OLED TV, Hisense is going against the grain by withdrawing from the field?
After launching its first 4K OLED TV, Hisense has officially withdrawn from the OLED TV product line and switched to ULED-XD technology to compete in the high-end market. Hisense told reporters that they believe their new ULED XD technology will be the OLED killer.    At last year's CES, the company talked up the pote
[Embedded]
After launching its first 4K OLED TV, Hisense is going against the grain by withdrawing from the field?
Automotive chips are showing two new development trends
After the chip shortage problem has developed for some time, the automotive chip industry is showing two new development trends: one is that production capacity will increase, and the other is that chips will develop towards integration. Mainstream chip manufacturers have significantly expanded their production capa
[Automotive Electronics]
Automotive chips are showing two new development trends
Steps for configuring the PROFINET X2 interface in the S7-1200 project
In the safety system, F-CPUs can use the PN/PN Coupler module to perform safety-related communication between controllers. Communication is performed through two safety application blocks, namely the SENDDP block for sending data and the RCVDP block for receiving data. These blocks are called by the user in the corr
[Embedded]
Steps for configuring the PROFINET X2 interface in the S7-1200 project
Introduction to Semiconductor CV Measurement (2)
Basic Test Configuration Figure 3 shows a basic CV measurement configuration block diagram. Since CV measurements are actually performed at AC frequencies, the capacitance of the device under test (DUT) can be calculated using the following formula: CDUT = IDUT / 2πfVac, where IDUT is the AC current amplitude throug
[Test Measurement]
Introduction to Semiconductor CV Measurement (2)
SEMI: Global semiconductor equipment shipments in Q2 were $13.3 billion, down 20% year-on-year
The Semiconductor Industry and Equipment International (SEMI) released a report on September 10 stating that global semiconductor manufacturing equipment shipments in the second quarter of 2019 decreased by 20% year-on-year to US$13.3 billion, and decreased by 3% from the first quarter of this year. Specifically, Euro
[Mobile phone portable]
SEMI: Global semiconductor equipment shipments in Q2 were $13.3 billion, down 20% year-on-year
I2C bus protocol (AT24c02) program
Main: STC89C54 From: AT24C02                                             Circuit Diagram                                                     Timing Diagram  Below is the code           #include reg51.h #define uchar unsigned char #define addr_x 0xae // write
[Microcontroller]
I2C bus protocol (AT24c02) program
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号