1、 Steps for compiling drivers into the kernel Adding programs to the Linux kernel requires the following three tasks: 1. Copy the source code to the corresponding directory of the Linux kernel source code; 2. Add the compilation configuration option of the project corresponding to the new source code in the Kconfig file of the directory; 3. Add a compilation entry for the new source code in the Makefile file of the directory.
The specific steps for compiling the bq27501 driver into the kernel are as follows: 1. First copy the driver code bq27501 folder to the ti navinci/drivers/directory. Determine where the bq27501 driver module should be in the kernel source code tree. The device drivers are stored in the subdirectory of the root directory drivers/of the kernel source tree. Inside, the device driver files are further organized by category, type, etc. a. The character device exists in the drivers/char/directory b. Block devices are stored in the drivers/block/directory c. USB devices are stored in the drivers/usb/directory.