Linux Driver Development Misc device and buzzer driver (i.)

Source: Internet
Author: User

1. Driver test of onboard buzzer


I have a BSP, jiuding BSP, which has a buzzer driver, we first test it well. When we get a BSP, if we want to do or transplant the driver of the buzzer, first determine the next core

There is no buzzer driver, we can use Sourceinsight to put the kernel in, search buzzer this file, see if there is no, if not, you can also enter make menuconfig in the kernel, using this configuration interface to search buzzer English, See can not find the corresponding information, so also know this device under which path, through the jiuding kernel make menuconfig, after searching buzzer, know buzzer driver in/driver/char/buzzer/directory, go to this directory, Found x210-buzzer.c such a file and makefile and Kconfig, that this file is the driver file, so we find the driver code, but also that there is a buzzer in this kernel driver code. You can also search for the location containing the buzzer typeface by typing the grep "buzzer" *-nr in the kernel source directory to determine which buzzer driver is on your board, or not.


We jiuding the driver source code of the buzzer in the kernel in/driver/char/buzzer/x210-buzzer.c. This driver has no job, or is compiled into the kernel, it depends on the directory in the makefile file

obj-$ (config_buzzer_driver) + = X210-BUZZER.O

CONFIG_BUZZER_DRIVER macro is defined, whether this macro is defined depends on the Kconfig file in this directory

Config X210_buzzer_driverbool "x210 buzzer driver" default yhelpcompile for buzzer driver,y for kernel,m for module.

Whether the value given is Y or N. This kconfig gives the value of the macro is Y or N, depending on make menuconfig, whether you choose this buzzer driver. You can also see in the. config file in the kernel source directory whether the value of the Config_buzzer_driver macro is y to determine if it is to be compiled into the kernel.

Buzzer this device should belong to the misc device, so according to the reason that make menuconfig should be in the misc device to find, but because the jiuding transplant is very messy, and did not put the buzzer driver in the Misc device directory, but placed in the Char directory, So make menuconfig when we want to find the driver of this buzzer device under the char type device, see if it is enabled, if enable to explain that the Config_buzzer_driver macro is to be enabled, We can also observe the confirmation in the. config file in the source directory.

This article from "Whylinux" blog, declined reprint!

Linux Driver Development Misc device and buzzer driver (i.)

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.