The PWM driver is implemented differently than the LED,PWM drive consists of multiple files. This is the standard way to implement most Linux drivers. A complex driver does not put all of the code in one file. The associated code is placed in the appropriate file, which is co-compiled when the Linux driver is compiled. When a Linux driver is developed, the Linux driver may fail to install when an error occurs in functions such as Init, exit, and so on. Even using the Rmmod command does not properly uninstall the Linux driver. In this case, the corresponding Linux-driven memory address needs to be modified to implement the Linux driver uninstall.
There are two ways to reuse Linux driver code, the first is static mode, that is, by include the corresponding header file, using standard C program. Another is called dynamic reuse, which allows a Linux driver to use resources from another Linux driver.
Forcibly uninstall the Linux driver. Scenario 1: The initialization function of the Linux drive module crashes due to some operation, which causes the initialization functions to not return properly. The performance of this situation is that the current Linux driver module is not used by any other Linux driver, but the display has been quoted once. Please state 2: The Unload function is blocked.
Buzzer driver. Principle: use pulse to control buzzer. First compile the PWM.C and pwm_fun.c files into PWM.O and PWM_FUN.O, then link the two *.o files to PWM_DRIVER.O and finally generate the Ko file.
Software 1308 class 31st Zhang Fan Blog Park address: http://home.cnblogs.com/u/sxauzzz/
Android Deep Exploration (Vol. 1) HAL and Driver Development chapter eighth let the Development Board sound: buzzer Drive reading notes