1, Enter the directory linux-kernel-samsung-dev \ drivers \ char
2, the new target directory 01.led, will drive the associated files to this directory
Note: Please ensure that drivers are able to replicate the normal operation of the drive
3, write Kconfig file in the directory where 01.led
The led water made by xxx which was used by platform!
4, write Makefile file in the directory where 01.led
obj - $ (CONFIG_XXX_LED) + = led_dev.o led_drv.o
5, modify 01.led parent directory char in the Makefile file
Increase: obj - $ (CONFIG_XXX_LED) + = 01.led /
6, to modify the parent directory 01.led char in the file Kconfig
Increase: source "drivers / char / 01.led / Kconfig"
7. When properly configured, execute make menuconfig command pop-up menu, and then follow the steps below to enter eleven
-> Device Drivers
-> Character devices
< > Xxx_ggg210_led (NEW)
8, use the "space" key to select "*" sign:
< *> Xxx_ggg210_led (NEW) indicates the module compiled into the kernel
9, execute the command: make -j 2 uImage
( "-j 2" represents open two threads to speed up the compilation speed)
10, the generated uImage files to burn to the development board
11, after the completion of the development board to start the kernel, use "ls / dev" command to see if there is a device node to confirm whether to add success
12, remove the drive module.
01.led first remove the drivers file directory folder, and then delete before adding in the corresponding Makefile and Kconfig in the statement.
Device drivers stored in a subfolder of the kernel source tree root directory drivers /, and in its interior, device drivers to be further organized by category, type, and so on up.
a. character devices exist in the drivers / char / directory
b. stored in a block device drivers / block / directory
c. USB devices are stored in the drivers / usb / directory.
(1) document the rules of the organization here is not absolutely the same, such as: USB devices are character devices can also be stored in the drivers / usb / directory.
(2) in drivers / char / directory, while the presence of a large number of C source code files, and many other directories in the directory. All for only one or two source files for a device driver can be directly stored in the directory, but if the driver contains many source files and other supporting documents, you can create a new subdirectory.