The Linux Kernel
  • The Linux kernel user’s and administrator’s guide
    • Linux kernel release 4.x <http://kernel.org/>
      • What is Linux?
      • On what hardware does it run?
      • Documentation
      • Installing the kernel source
      • Software requirements
      • Build directory for the kernel
      • Configuring the kernel
      • Compiling the kernel
      • If something goes wrong
    • The kernel’s command-line parameters
      • cpu lists:
      • Todo
    • Linux allocated devices (4.x+ version)
      • Additional /dev/ directory entries
        • Compulsory links
        • Recommended links
        • Locally defined links
        • Sockets and pipes
        • Mount points
      • Terminal devices
        • Virtual consoles and the console device
        • Serial ports
        • Pseudoterminals (PTYs)
    • Reporting bugs
      • Background
      • How to report Linux kernel bugs
        • Identify the problematic subsystem
        • Identify who to notify
        • Tips for reporting bugs
        • Gather information
      • Follow up
        • Expectations for bug reporters
        • Expectations for kernel maintainers
    • Security bugs
      • Contact
      • Disclosure
      • Non-disclosure agreements
    • Bug hunting
      • Where is the Oops message is located?
      • Finding the bug’s location
        • gdb
        • objdump
      • Reporting the bug
      • Fixing the bug
      • Notes on Oops tracing with klogd
    • Bisecting a bug
      • Introduction
      • Devices not appearing
      • Finding patch that caused a bug
    • Tainted kernels
    • Ramoops oops/panic logger
      • Introduction
      • Ramoops concepts
      • Setting the parameters
      • Dump format
      • Reading the data
      • Persistent function tracing
    • Dynamic debug
      • Introduction
      • Controlling dynamic debug Behaviour
      • Viewing Dynamic Debug Behaviour
      • Command Language Reference
      • Debug messages during Boot Process
      • Debug Messages at Module Initialization Time
      • Examples
    • Explaining the dreaded “No init found.” boot hang message
    • Rules on how to access information in sysfs
    • Using the initial RAM disk (initrd)
      • Operation
      • Boot command-line options
      • Compressed cpio images
      • Installation
      • Changing the root device
      • Usage scenarios
      • Obsolete root change mechanism
      • Mixed change_root and pivot_root mechanism
      • Resources
    • Linux Serial Console
    • Linux Braille Console
    • Parport
      • Parport as modules
        • modprobe
        • Parport probe [optional]
      • Parport linked into the kernel statically
      • Files in /proc
      • Device drivers
      • Reporting printer problems with parport
    • RAID arrays
      • Boot time assembly of RAID arrays
        • md device no.
        • raid level
        • chunk size factor
        • fault level
        • dev0 to devn
      • Boot time autodetection of RAID arrays
      • Boot time assembly of degraded/dirty arrays
      • Superblock formats
      • General Rules - apply for all superblock formats
      • Specific Rules that apply to format-0 super block arrays, and arrays with no superblock (non-persistent)
      • MD devices in sysfs
    • Kernel module signing facility
      • Overview
      • Configuring module signing
      • Generating signing keys
      • Public keys in the kernel
      • Manually signing modules
      • Signed modules and stripping
      • Loading signed modules
      • Non-valid signatures and unsigned modules
      • Administering/protecting the private key
    • Linux Magic System Request Key Hacks
      • What is the magic SysRq key?
      • How do I enable the magic SysRq key?
      • How do I use the magic SysRq key?
      • What are the ‘command’ keys?
      • Okay, so what can I use them for?
      • Sometimes SysRq seems to get ‘stuck’ after using it, what can I do?
      • I hit SysRq, but nothing seems to happen, what’s wrong?
      • I want to add SysRQ key events to a module, how does it work?
      • When I hit a SysRq key combination only the header appears on the console?
      • I have more questions, who can I ask?
      • Credits
    • Unicode support
      • Introduction
      • Actual characters assigned in the Linux Zone
      • Klingon language support
      • Other Fictional and Artificial Scripts
    • Software cursor for VGA
      • Examples
    • Kernel Support for miscellaneous (your favourite) Binary Formats v1.1
      • Hints
    • Mono(tm) Binary Kernel Support for Linux
    • Java(tm) Binary Kernel Support for Linux v1.03
    • Reliability, Availability and Serviceability
      • RAS concepts
        • Improving RAS
        • Types of errors
        • Identifying a bad hardware component
        • ECC memory
      • EDAC - Error Detection And Correction
        • Purpose
        • Memory
        • Other hardware elements
        • PCI bus scanning
        • Versioning
        • Loading
        • Sysfs interface
        • Memory Controller (mc) Model
        • mcX directories
        • dimmX or rankX directories
        • csrowX directories
        • System Logging
        • PCI Bus Parity Detection
        • Sysfs configuration
        • Module parameters
        • EDAC device type
        • Instances
        • Blocks
        • Usage of EDAC APIs on Nehalem and newer Intel CPUs
        • Reference documents used on amd64_edac
  • Working with the kernel development community
    • HOWTO do Linux kernel development
      • Introduction
      • Legal Issues
      • Documentation
      • Becoming A Kernel Developer
      • The development process
        • 4.x kernel tree
        • 4.x.y -stable kernel tree
        • 4.x -git patches
        • Subsystem Specific kernel trees and patches
        • 4.x -next kernel tree for integration tests
      • Bug Reporting
      • Managing bug reports
      • Mailing lists
      • Working with the community
      • Differences between the kernel community and corporate structures
      • Break up your changes
      • Justify your change
      • Document your change
    • Code of Conflict
    • A guide to the Kernel Development Process
      • 1. Introduction
        • 1.1. Executive summary
        • 1.2. What this document is about
        • 1.3. Credits
        • 1.4. The importance of getting code into the mainline
        • 1.5. Licensing
      • 2. How the development process works
        • 2.1. The big picture
        • 2.2. The lifecycle of a patch
        • 2.3. How patches get into the Kernel
        • 2.4. Next trees
        • 2.5. Staging trees
        • 2.6. Tools
        • 2.7. Mailing lists
        • 2.8. Getting started with Kernel development
      • 3. Early-stage planning
        • 3.1. Specifying the problem
        • 3.2. Early discussion
        • 3.3. Who do you talk to?
        • 3.4. When to post?
        • 3.5. Getting official buy-in
      • 4. Getting the code right
        • 4.1. Pitfalls
        • 4.2. Code checking tools
        • 4.3. Documentation
        • 4.4. Internal API changes
      • 5. Posting patches
        • 5.1. When to post
        • 5.2. Before creating patches
        • 5.3. Patch preparation
        • 5.4. Patch formatting and changelogs
        • 5.5. Sending the patch
      • 6. Followthrough
        • 6.1. Working with reviewers
        • 6.2. What happens next
        • 6.3. Other things that can happen
      • 7. Advanced topics
        • 7.1. Managing patches with git
        • 7.2. Reviewing patches
      • 8. For more information
      • 9. Conclusion
    • Submitting patches: the essential guide to getting your code into the kernel
      • 0) Obtain a current source tree
      • 1) diff -up
      • 2) Describe your changes
      • 3) Separate your changes
      • 4) Style-check your changes
      • 5) Select the recipients for your patch
      • 6) No MIME, no links, no compression, no attachments. Just plain text
      • 7) E-mail size
      • 8) Respond to review comments
      • 9) Don’t get discouraged - or impatient
      • 10) Include PATCH in the subject
      • 11) Sign your work — the Developer’s Certificate of Origin
        • Developer’s Certificate of Origin 1.1
      • 12) When to use Acked-by: and Cc:
      • 13) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes:
        • Reviewer’s statement of oversight
      • 14) The canonical patch format
      • 15) Explicit In-Reply-To headers
      • 16) Sending git pull requests
      • References
    • Linux kernel coding style
      • 1) Indentation
      • 2) Breaking long lines and strings
      • 3) Placing Braces and Spaces
        • 3.1) Spaces
      • 4) Naming
      • 5) Typedefs
      • 6) Functions
      • 7) Centralized exiting of functions
      • 8) Commenting
      • 9) You’ve made a mess of it
      • 10) Kconfig configuration files
      • 11) Data structures
      • 12) Macros, Enums and RTL
      • 13) Printing kernel messages
      • 14) Allocating memory
      • 15) The inline disease
      • 16) Function return values and names
      • 17) Don’t re-invent the kernel macros
      • 18) Editor modelines and other cruft
      • 19) Inline assembly
      • 20) Conditional Compilation
      • Appendix I) References
    • Email clients info for Linux
      • Git
      • General Preferences
      • Some email client (MUA) hints
        • Alpine (TUI)
        • Claws Mail (GUI)
        • Evolution (GUI)
        • Kmail (GUI)
        • Lotus Notes (GUI)
        • Mutt (TUI)
        • Pine (TUI)
        • Sylpheed (GUI)
        • Thunderbird (GUI)
        • TkRat (GUI)
        • Gmail (Web GUI)
    • Minimal requirements to compile the Kernel
      • Intro
        • Current Minimal Requirements
        • Kernel compilation
        • System utilities
        • Networking
        • Kernel documentation
      • Getting updated software
        • Kernel compilation
        • System utilities
        • Networking
        • Kernel documentation
    • Submitting Drivers For The Linux Kernel
      • Allocating Device Numbers
      • Who To Submit Drivers To
      • What Criteria Determine Acceptance
      • What Criteria Do Not Determine Acceptance
      • Resources
    • The Linux Kernel Driver Interface
      • Executive Summary
      • Intro
      • Binary Kernel Interface
      • Stable Kernel Source Interfaces
      • What to do
    • Linux kernel management style
      • 1) Decisions
      • 2) People
      • 3) People II - the Good Kind
      • 4) Placing blame
      • 5) Things to avoid
      • 6) Why me?
    • Everything you ever wanted to know about Linux -stable releases
      • Procedure for submitting patches to the -stable tree
      • For all other submissions, choose one of the following procedures
        • Option 1
        • Option 2
        • Option 3
      • Review cycle
      • Trees
      • Review committee
    • Linux Kernel patch submission checklist
    • Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel
      • Docs at the Linux Kernel tree
      • On-line docs
      • Published books
      • Miscellaneous
    • Applying Patches To The Linux Kernel
      • What is a patch?
      • How do I apply or revert a patch?
      • How do I feed a patch/diff file to patch?
      • Common errors when patching
      • Are there any alternatives to patch?
      • Where can I download the patches?
      • The 4.x kernels
      • The 4.x.y kernels
      • The -rc kernels
      • The -git kernels
      • The -mm patches and the linux-next tree
    • Adding a New System Call
      • System Call Alternatives
      • Designing the API: Planning for Extension
      • Designing the API: Other Considerations
      • Proposing the API
      • Generic System Call Implementation
      • x86 System Call Implementation
      • Compatibility System Calls (Generic)
      • Compatibility System Calls (x86)
      • System Calls Returning Elsewhere
      • Other Details
      • Testing
      • Man Page
      • References and Sources
    • Linux magic numbers
    • Why the “volatile” type class should not be used
      • References
      • Credits
  • Development tools for the kernel
    • Coccinelle
      • Getting Coccinelle
      • Supplemental documentation
      • Using Coccinelle on the Linux kernel
        • Examples
      • Coccinelle parallelization
      • Using Coccinelle with a single semantic patch
      • Controlling Which Files are Processed by Coccinelle
      • Debugging Coccinelle SmPL patches
      • .cocciconfig support
      • Additional flags
      • SmPL patch specific options
      • SmPL patch Coccinelle requirements
      • Proposing new semantic patches
      • Detailed description of the report mode
        • Example
      • Detailed description of the patch mode
        • Example
      • Detailed description of the context mode
        • Example
      • Detailed description of the org mode
        • Example
    • Sparse
      • Using sparse for typechecking
      • Using sparse for lock checking
      • Getting sparse
      • Using sparse
        • Checking RCU annotations
    • kcov: code coverage for fuzzing
      • Usage
    • Using gcov with the Linux kernel
      • Preparation
      • Customization
      • Files
      • Modules
      • Separated build and test machines
      • Troubleshooting
      • Appendix A: gather_on_build.sh
      • Appendix B: gather_on_test.sh
    • The Kernel Address Sanitizer (KASAN)
      • Overview
      • Usage
        • Error reports
      • Implementation details
    • The Undefined Behavior Sanitizer - UBSAN
      • Report example
      • Usage
      • References
    • Kernel Memory Leak Detector
      • Usage
      • Basic Algorithm
      • Testing specific sections with kmemleak
      • Freeing kmemleak internal objects
      • Kmemleak API
      • Dealing with false positives/negatives
      • Limitations and Drawbacks
    • Getting started with kmemcheck
      • Introduction
      • Downloading
      • Configuring and compiling
      • How to use
        • Booting
        • Run-time enable/disable
        • Debugging
        • Annotating false positives
      • Reporting errors
      • Technical description
    • Debugging kernel and modules via gdb
      • Requirements
      • Setup
      • Examples of using the Linux-provided gdb helpers
      • List of commands and functions
  • How to write kernel documentation
    • Introduction
    • Sphinx Build
    • Writing Documentation
      • Specific guidelines for the kernel documentation
      • the C domain
      • list tables
    • Including kernel-doc comments
    • Writing kernel-doc comments
      • How to format kernel-doc comments
      • Highlights and cross-references
        • Cross-referencing from reStructuredText
      • Function documentation
      • Structure, union, and enumeration documentation
        • In-line member documentation comments
        • Private members
      • Typedef documentation
      • Overview documentation comments
      • Recommendations
    • Including uAPI header files
      • parse_headers.pl
        • NAME
        • SYNOPSIS
        • OPTIONS
        • DESCRIPTION
        • EXAMPLES
        • BUGS
        • COPYRIGHT
    • DocBook XML [DEPRECATED]
      • Converting DocBook to Sphinx
      • Components of the kernel-doc system
      • How to use kernel-doc comments in DocBook XML template files
  • The Linux driver implementer’s API guide
    • Driver Basics
      • Driver Entry and Exit points
      • Atomic and pointer manipulation
      • Delaying, scheduling, and timer routines
      • Wait queues and Wake events
      • High-resolution timers
      • Workqueues and Kevents
      • Internal Functions
      • Kernel objects manipulation
      • Kernel utility functions
      • Device Resource Management
    • Device drivers infrastructure
      • The Basic Device Driver-Model Structures
      • Device Drivers Base
      • Device Drivers DMA Management
      • Device drivers PnP support
      • Userspace IO devices
    • Device Power Management
      • Device Power Management Basics
        • Two Models for Device Power Management
        • Interfaces for Entering System Sleep States
        • Calling Drivers to Enter and Leave System Sleep States
        • Power Management Notifiers
        • Device Low-Power (suspend) States
        • Device Power Management Domains
        • Runtime Power Management
      • Suspend/Hibernation Notifiers
      • Device Power Management Data Types
    • Bus-Independent Device Accesses
      • Introduction
      • Memory Mapped IO
        • Getting Access to the Device
        • Accessing the device
      • Port Space Accesses
        • Port Space Explained
        • Accessing Port Space
      • Public Functions Provided
    • Buffer Sharing and Synchronization
      • Shared DMA Buffers
        • Userspace Interface Notes
        • Basic Operation and Device DMA Access
        • CPU Access to DMA Buffer Objects
        • Fence Poll Support
        • Kernel Functions and Structures Reference
      • Reservation Objects
      • DMA Fences
        • Seqno Hardware Fences
        • DMA Fence Array
        • DMA Fence uABI/Sync File
    • Device links
      • Usage
      • Limitations
      • Examples
      • Alternatives
      • Implementation
      • State machine
      • API
    • Message-based devices
      • Fusion message devices
    • Sound Devices
    • Frame Buffer Library
      • Frame Buffer Memory
      • Frame Buffer Colormap
      • Frame Buffer Video Mode Database
      • Frame Buffer Macintosh Video Mode Database
      • Frame Buffer Fonts
    • Voltage and current regulator API
      • Introduction
        • Glossary
      • Consumer driver interface
        • Enabling and disabling
        • Configuration
        • Callbacks
      • Regulator driver interface
      • Machine interface
        • Supplies
        • Constraints
      • API reference
    • Industrial I/O
      • Introduction
      • Core elements
        • Industrial I/O Devices
      • Buffers
        • IIO buffer sysfs interface
        • IIO buffer setup
        • More details
      • Triggers
        • IIO trigger sysfs interface
        • IIO trigger setup
        • IIO trigger ops
        • More details
      • Triggered Buffers
        • IIO triggered buffer setup
        • More details
    • Input Subsystem
      • Input core
      • Multitouch Library
      • Polled input devices
      • Matrix keyboards/keypads
      • Sparse keymap support
    • The Linux-USB Host Side API
      • Introduction to USB on Linux
      • USB Host-Side API Model
      • USB-Standard Types
      • Host-Side Data Types and Macros
      • USB Core APIs
      • Host Controller APIs
      • The USB Filesystem (usbfs)
        • What files are in “usbfs”?
        • Mounting and Access Control
        • /proc/bus/usb/devices
        • /proc/bus/usb/BBB/DDD
        • Life Cycle of User Mode Drivers
        • The ioctl() Requests
    • Serial Peripheral Interface (SPI)
    • I2C and SMBus Subsystem
    • High Speed Synchronous Serial Interface (HSI)
      • Introduction
      • HSI Subsystem in Linux
      • hsi-char Device
      • The kernel HSI API
    • Error Detection And Correction (EDAC) Devices
      • Main Concepts used at the EDAC subsystem
      • Memory Controllers
      • PCI Controllers
      • EDAC Blocks
    • Parallel Port Devices
    • 16x50 UART Driver
    • Pulse-Width Modulation (PWM)
    • VME Device Drivers
      • Driver registration
      • Resource management
      • Master windows
        • Master window configuration
        • Master window access
      • Slave windows
        • Slave window configuration
        • Slave window buffer allocation
        • Slave window access
      • DMA channels
        • List Management
        • List Population
        • Transfer Attributes
        • List Execution
      • Interrupts
        • Attaching Interrupt Handlers
        • Interrupt Generation
      • Location monitors
        • Location Monitor Management
        • Location Monitor Configuration
        • Location Monitor Use
      • Slot Detection
      • Bus Detection
    • Linux 802.11 Driver Developer’s Guide
      • Introduction
      • cfg80211 subsystem
        • Device registration
        • Actions and configuration
        • Scanning and BSS list handling
        • Utility functions
        • Data path helpers
        • Regulatory enforcement infrastructure
        • RFkill integration
        • Test mode
      • mac80211 subsystem (basics)
        • Basic hardware handling
        • PHY configuration
        • Virtual interfaces
        • Receive and transmit processing
        • Frame filtering
        • The mac80211 workqueue
      • mac80211 subsystem (advanced)
        • LED support
        • Hardware crypto acceleration
        • Powersave support
        • Beacon filter support
        • Multiple queues and QoS support
        • Access point mode support
        • Supporting multiple virtual interfaces
        • Station handling
        • Hardware scan offload
        • Aggregation
        • Spatial Multiplexing Powersave (SMPS)
        • Rate Control API
        • Key handling
        • Receive processing
        • Transmit processing
        • Station info handling
        • Aggregation
        • Synchronisation
    • The Userspace I/O HOWTO
      • About this document
        • Translations
        • Preface
        • Acknowledgments
        • Feedback
      • About UIO
        • How UIO works
      • Writing your own kernel module
        • struct uio_info
        • Adding an interrupt handler
        • Using uio_pdrv for platform devices
        • Using uio_pdrv_genirq for platform devices
        • Using uio_dmem_genirq for platform devices
      • Writing a driver in userspace
        • Getting information about your UIO device
        • mmap() device memory
        • Waiting for interrupts
      • Generic PCI UIO driver
        • Making the driver recognize the device
        • Things to know about uio_pci_generic
        • Writing userspace driver using uio_pci_generic
        • Example code using uio_pci_generic
      • Generic Hyper-V UIO driver
        • Making the driver recognize the device
        • Things to know about uio_hv_generic
      • Further information
    • Linux Firmware API
      • Introduction
        • Types of firmware requests
      • Firmware API core features
        • Firmware search paths
        • Built-in firmware
        • Firmware cache
        • Direct filesystem lookup
        • Fallback mechanisms
        • Firmware lookup order
      • request_firmware API
        • Synchronous firmware requests
        • Asynchronous firmware requests
        • request firmware API expected driver use
  • Core API Documentation
    • Core utilities
      • Generic Associative Array Implementation
        • Overview
        • The Public API
        • Internal Workings
      • Semantics and Behavior of Atomic and Bitmask Operations
        • Atomic Type And Operations
        • Atomic Bitmask
      • CPU hotplug in the Kernel
        • Introduction
        • Command Line Switches
        • CPU maps
        • Using CPU hotplug
        • The CPU hotplug coordination
        • Testing of hotplug states
        • Architecture’s requirements
        • User Space Notification
        • Kernel Inline Documentations Reference
      • Semantics and Behavior of Local Atomic Operations
        • Purpose of local atomic operations
        • Implementation for a given architecture
        • Rules to follow when using local atomic operations
        • How to use local atomic operations
        • Counting
        • Reading the counters
      • Concurrency Managed Workqueue (cmwq)
        • Introduction
        • Why cmwq?
        • The Design
        • Application Programming Interface (API)
        • Example Execution Scenarios
        • Guidelines
        • Debugging
        • Kernel Inline Documentations Reference
    • Interfaces for kernel debugging
      • The object-lifetime debugging infrastructure
        • Introduction
        • Howto use debugobjects
        • Debug functions
        • Fixup functions
        • Known Bugs And Assumptions
      • The Linux Kernel Tracepoint API
        • Introduction
        • IRQ
        • SIGNAL
        • Block IO
        • Workqueue
  • Linux Media Subsystem Documentation
    • Linux Media Infrastructure userspace API
      • Introduction
      • Part I - Video for Linux API
        • 1. Common API Elements
        • 2. Image Formats
        • 3. Input/Output
        • 4. Interfaces
        • 5. V4L2 Driver Programming
        • 6. Libv4l Userspace Library
        • 7. Changes
        • 8. Function Reference
        • 9. Common definitions for V4L2 and V4L2 subdev interfaces
        • 10. Video For Linux Two Header File
        • 11. Video Capture Example
        • 12. Video Grabber example using libv4l
        • 13. References
        • Revision and Copyright
        • Revision History
      • Part II - Digital TV API
        • 1. Introduction
        • 2. DVB Frontend API
        • 3. DVB Demux Device
        • 4. DVB CA Device
        • 5. DVB Network API
        • 6. DVB net Function Calls
        • 7. DVB Deprecated APIs
        • 8. Examples
        • 9. DVB Audio Header File
        • 10. DVB Conditional Access Header File
        • 11. DVB Demux Header File
        • 12. DVB Frontend Header File
        • 13. DVB Network Header File
        • 14. DVB Video Header File
        • Revision and Copyright
        • Revision History
      • Part III - Remote Controller API
        • 1. Introduction
        • 2. Remote Controller’s sysfs nodes
        • 3. Remote controller tables
        • 4. Changing default Remote Controller mappings
        • 5. LIRC Device Interface
        • Revision and Copyright
        • Revision History
      • Part IV - Media Controller API
        • 1. Introduction
        • 2. Media device model
        • 3. Types and flags used to represent the media graph elements
        • 4. Function Reference
        • 5. Media Controller Header File
        • Revision and Copyright
        • Revision History
      • Part V - Consumer Electronics Control API
        • 1. Introduction
        • 2. Function Reference
        • 3. CEC Header File
        • Revision and Copyright
        • Revision History
      • Generic Error Codes
      • GNU Free Documentation License
        • 0. PREAMBLE
        • 1. APPLICABILITY AND DEFINITIONS
        • 2. VERBATIM COPYING
        • 3. COPYING IN QUANTITY
        • 4. MODIFICATIONS
        • 5. COMBINING DOCUMENTS
        • 6. COLLECTIONS OF DOCUMENTS
        • 7. AGGREGATION WITH INDEPENDENT WORKS
        • 8. TRANSLATION
        • 9. TERMINATION
        • 10. FUTURE REVISIONS OF THIS LICENSE
        • Addendum
    • Media subsystem kernel internal API
      • 1. Video2Linux devices
        • 1.1. Introduction
        • 1.2. Structure of a V4L driver
        • 1.3. Structure of the V4L2 framework
        • 1.4. Video device’ s internal representation
        • 1.5. V4L2 device instance
        • 1.6. V4L2 File handlers
        • 1.7. V4L2 sub-devices
        • 1.8. V4L2 sub-device userspace API
        • 1.9. I2C sub-device drivers
        • 1.10. V4L2 sub-device functions and data structures
        • 1.11. V4L2 events
        • 1.12. V4L2 Controls
        • 1.13. Videobuf Framework
        • 1.14. V4L2 videobuf2 functions and data structures
        • 1.15. V4L2 clocks
        • 1.16. V4L2 DV Timings functions
        • 1.17. V4L2 flash functions and data structures
        • 1.18. V4L2 Media Controller functions and data structures
        • 1.19. V4L2 Media Bus functions and data structures
        • 1.20. V4L2 Memory to Memory functions and data structures
        • 1.21. V4L2 Open Firmware kAPI
        • 1.22. V4L2 rect helper functions
        • 1.23. Tuner functions and data structures
        • 1.24. V4L2 common functions and data structures
        • 1.25. Hauppauge TV EEPROM functions and data structures
      • 2. Digital TV (DVB) devices
      • 3. Digital TV Common functions
      • 4. Digital TV Ring buffer
      • 5. Digital TV Frontend kABI
        • 5.1. Digital TV Frontend
      • 6. Digital TV Demux kABI
        • 6.1. Digital TV Demux
      • 7. Demux Callback API
        • 7.1. Demux Callback
      • 8. Digital TV Conditional Access kABI
      • 9. Remote Controller devices
        • 9.1. Remote Controller core
        • 9.2. LIRC
      • 10. Media Controller devices
        • 10.1. Media Controller
      • 11. CEC Kernel Support
        • 11.1. The CEC Protocol
      • 12. The Kernel Interface
        • 12.1. CEC Adapter
        • 12.2. Implementing the Low-Level CEC Adapter
        • 12.3. Implementing the interrupt handler
        • 12.4. Implementing the High-Level CEC Adapter
        • 12.5. CEC framework functions
      • 13. MIPI CSI-2
        • 13.1. Transmitter drivers
        • 13.2. Receiver drivers
    • Linux Digital TV driver-specific documentation
      • 1. Introduction
      • 2. HOWTO: Get An Avermedia DVB-T working under Linux
        • 2.1. Assumptions and Introduction
        • 2.2. The Avermedia DVB-T
        • 2.3. Getting the card going
        • 2.4. Receiving DVB-T in Australia
        • 2.5. Known Limitations
        • 2.6. Further Update
      • 3. How to get the bt8xx cards working
        • 3.1. General information
        • 3.2. Loading Modules
      • 4. Hardware supported by the linuxtv.org DVB drivers
      • 5. Digital TV Conditional Access Interface (CI API)
        • 5.1. ca_zap
        • 5.2. Cards that fall in this category
        • 5.3. CI modules that are supported
        • 5.4. The High level CI API
        • 5.5. Why the need for another CI interface?
      • 6. Idea behind the dvb-usb-framework
        • 6.1. Supported devices
        • 6.2. How to use?
        • 6.3. Known problems and bugs
        • 6.4. 3. Acknowledgements
      • 7. FAQ
      • 8. Firmware files for lmedm04 cards
        • 8.1. For DM04+/QQBOX LME2510C (Sharp 7395 Tuner)
        • 8.2. For DM04 LME2510 (LG Tuner)
        • 8.3. For DM04 LME2510C (LG Tuner)
        • 8.4. For LME2510
        • 8.5. For LME2510C
      • 9. Opera firmware
      • 10. How to set up the Technisat/B2C2 Flexcop devices
        • 10.1. Find out what device you have
        • 10.2. Kernel compilation:
      • 11. TechnoTrend/Hauppauge DEC USB Driver
        • 11.1. Driver Status
        • 11.2. Getting the Firmware
        • 11.3. Hotplug Firmware Loading
      • 12. UDEV rules for DVB
      • 13. Contributors
    • Video4Linux (V4L) driver-specific documentation
      • 1. Guidelines for Video4Linux pixel format 4CCs
        • 1.1. Raw bayer
      • 2. Infrared remote control support in video4linux drivers
        • 2.1. Basics
        • 2.2. How it works
      • 3. Using with lircd
      • 4. Using without lircd
      • 5. Tuner drivers
        • 5.1. Simple tuner Programming
        • 5.2. Tuner Manufacturers
      • 6. Cards List
        • 6.1. AU0828 cards list
        • 6.2. BTTV cards list
        • 6.3. cx23885 cards list
        • 6.4. CX88 cards list
        • 6.5. EM28xx cards list
        • 6.6. IVTV cards list
        • 6.7. SAA7134 cards list
        • 6.8. SAA7164 cards list
        • 6.9. TM6000 cards list
        • 6.10. Tuner cards list
        • 6.11. USBvision cards list
        • 6.12. The gspca cards list
      • 7. The bttv driver
        • 7.1. Release notes for bttv
        • 7.2. Make bttv work with your card
        • 7.3. Autodetecting cards
        • 7.4. Still doesn’t work?
        • 7.5. Modprobe options
        • 7.6. If the box freezes hard with bttv
        • 7.7. Bttv quirks
        • 7.8. bttv and sound mini howto
        • 7.9. Cards
        • 7.10. Chips used at bttv devices
        • 7.11. Specs
        • 7.12. Thanks
        • 7.13. Contributors
      • 8. The cafe_ccic driver
        • 8.1. Introduction
        • 8.2. Load time options
      • 9. The cpia2 driver
        • 9.1. Introduction
        • 9.2. Features
        • 9.3. Making and installing the stv672 driver modules
      • 10. The cx18 driver
      • 11. The cx2341x driver
        • 11.1. Memory at cx2341x chips
        • 11.2. Missing documentation
        • 11.3. The cx2341x firmware upload
        • 11.4. How to call the firmware API
        • 11.5. OSD firmware API description
        • 11.6. Encoder firmware API description
        • 11.7. Decoder firmware API description
        • 11.8. PVR350 Video decoder registers 0x02002800 -> 0x02002B00
        • 11.9. The cx231xx DMA engine
        • 11.10. Non-compressed file format
        • 11.11. Format of embedded V4L2_MPEG_STREAM_VBI_FMT_IVTV VBI data
      • 12. The cx88 driver
        • 12.1. Current status
        • 12.2. How to add support for new cards
        • 12.3. Documentation missing at the cx88 datasheet
        • 12.4. Hauppauge WinTV cx88 IR information
      • 13. The VPBE V4L2 driver design
        • 13.1. File partitioning
        • 13.2. Functional partitioning
        • 13.3. Current status
        • 13.4. To be done
      • 14. The Samsung S5P/EXYNOS4 FIMC driver
        • 14.1. Supported SoCs
        • 14.2. Supported features
        • 14.3. Not currently supported
        • 14.4. Files partitioning
        • 14.5. User space interfaces
        • 14.6. 5. Device mapping to video and subdev device nodes
        • 14.7. 7. Build
      • 15. The ivtv driver
        • 15.1. Features
        • 15.2. Additional features for the PVR-350 (CX23415 based)
        • 15.3. See also
        • 15.4. IRC
        • 15.5. Devices
        • 15.6. Base devices
      • 16. Vaio Picturebook Motion Eye Camera Driver
        • 16.1. Hardware supported
        • 16.2. Driver options
        • 16.3. Module use
        • 16.4. Usage:
        • 16.5. Private API
        • 16.6. Bugs / Todo
      • 17. OMAP 3 Image Signal Processor (ISP) driver
        • 17.1. Introduction
        • 17.2. Split to subdevs
        • 17.3. Controlling the OMAP 3 ISP
        • 17.4. Events
        • 17.5. Private IOCTLs
        • 17.6. CCDC and preview block IOCTLs
        • 17.7. Statistic blocks IOCTLs
        • 17.8. VIDIOC_OMAP3ISP_STAT_EN
        • 17.9. VIDIOC_OMAP3ISP_AEWB_CFG, VIDIOC_OMAP3ISP_HIST_CFG and VIDIOC_OMAP3ISP_AF_CFG
        • 17.10. VIDIOC_OMAP3ISP_STAT_REQ
        • 17.11. Technical reference manuals (TRMs) and other documentation
        • 17.12. References
      • 18. OMAP4 ISS Driver
        • 18.1. Introduction
        • 18.2. Tested platforms
        • 18.3. File list
        • 18.4. References
      • 19. The pvrusb2 driver
        • 19.1. Background
        • 19.2. Building
        • 19.3. Source file list / functional overview
      • 20. PXA-Camera Host Driver
        • 20.1. Constraints
        • 20.2. Global video workflow
        • 20.3. DMA usage
      • 21. The Radiotrack radio driver
        • 21.1. ACKNOWLEDGMENTS
        • 21.2. WHY THIS DOCUMENT?
        • 21.3. PHYSICAL DESCRIPTION
        • 21.4. CONTROLLING THE CARD WITH IOPORT
        • 21.5. PROGRAMMING EXAMPLES
      • 22. Renesas R-Car Fine Display Processor (FDP1) Driver
      • 23. The saa7134 driver
        • 23.1. Status
        • 23.2. Build
        • 23.3. Changes / Fixes
        • 23.4. Known Problems
        • 23.5. Card Variations:
        • 23.6. LifeView GPIOs
        • 23.7. Credits
      • 24. Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
        • 24.1. Terminology
        • 24.2. Generic scaling / cropping scheme
        • 24.3. S_FMT
        • 24.4. S_CROP
      • 25. The Silicon Labs Si470x FM Radio Receivers driver
        • 25.1. Information from Silicon Labs
        • 25.2. Supported ICs
        • 25.3. Supported USB devices
        • 25.4. Software
        • 25.5. Audio Listing
        • 25.6. Module Parameters
        • 25.7. Errors
        • 25.8. Open Issues
        • 25.9. Other useful information and links
      • 26. The Silicon Labs Si4713 FM Radio Transmitter Driver
        • 26.1. Information about the Device
        • 26.2. Device driver description
        • 26.3. Properties description
        • 26.4. RNL
        • 26.5. Stereo/Mono and RDS subchannels
        • 26.6. Testing
      • 27. The SI476x Driver
        • 27.1. TODO for the driver
        • 27.2. Parameters exposed over debugfs
      • 28. The Soc-Camera Drivers
        • 28.1. Terminology
        • 28.2. Purpose of the soc-camera subsystem
        • 28.3. Existing drivers
        • 28.4. Camera host API
        • 28.5. Camera API
        • 28.6. VIDIOC_S_CROP and VIDIOC_S_FMT behaviour
        • 28.7. Format conversion
      • 29. The Linux USB Video Class (UVC) driver
        • 29.1. Extension Unit (XU) support
      • 30. The Virtual Video Test Driver (vivid)
        • 30.1. Configuring the driver
        • 30.2. Video Capture
        • 30.3. Video Output
        • 30.4. VBI Capture
        • 30.5. VBI Output
        • 30.6. Radio Receiver
        • 30.7. Radio Transmitter
        • 30.8. Software Defined Radio Receiver
        • 30.9. Controls
        • 30.10. Video, VBI and RDS Looping
        • 30.11. Cropping, Composing, Scaling
        • 30.12. Formats
        • 30.13. Capture Overlay
        • 30.14. Output Overlay
        • 30.15. CEC (Consumer Electronics Control)
        • 30.16. Some Future Improvements
      • 31. The Zoran driver
        • 31.1. Frequently Asked Questions
        • 31.2. What cards are supported
        • 31.3. 1.1 What the TV decoder can do an what not
        • 31.4. What the TV encoder can do an what not
        • 31.5. How do I get this damn thing to work
        • 31.6. What mainboard should I use (or why doesn’t my card work)
        • 31.7. Programming interface
        • 31.8. Applications
        • 31.9. Concerning buffer sizes, quality, output size etc.
        • 31.10. It hangs/crashes/fails/whatevers! Help!
        • 31.11. Maintainers/Contacting
        • 31.12. Driver’s License
      • 32. Zoran 364xx based USB webcam module
        • 32.1. Introduction
        • 32.2. Install
        • 32.3. Usage
        • 32.4. links
        • 32.5. Supported devices
  • Linux GPU Driver Developer’s Guide
    • Introduction
      • Style Guidelines
    • DRM Internals
      • Driver Initialization
        • Driver Information
        • Device Instance and Driver Handling
        • Driver Load
        • Bus-specific Device Registration and PCI Support
      • Open/Close, File Operations and IOCTLs
        • Open and Close
        • File Operations
        • IOCTLs
      • Misc Utilities
        • Printer
      • Legacy Support Code
        • Legacy Suspend/Resume
        • Legacy DMA Services
    • DRM Memory Management
      • The Translation Table Manager (TTM)
        • TTM initialization
      • The Graphics Execution Manager (GEM)
        • GEM Initialization
        • GEM Objects Creation
        • GEM Objects Lifetime
        • GEM Objects Naming
        • GEM Objects Mapping
        • Memory Coherency
        • Command Execution
        • GEM Function Reference
        • GEM CMA Helper Functions Reference
      • VMA Offset Manager
      • PRIME Buffer Sharing
        • Overview and Driver Interface
        • PRIME Helper Functions
        • PRIME Function References
      • DRM MM Range Allocator
        • Overview
        • LRU Scan/Eviction Support
        • DRM MM Range Allocator Function References
      • DRM Cache Handling
    • Kernel Mode Setting (KMS)
      • KMS Core Structures and Functions
      • Modeset Base Object Abstraction
      • Atomic Mode Setting Function Reference
      • CRTC Abstraction
        • CRTC Functions Reference
      • Frame Buffer Abstraction
        • Frame Buffer Functions Reference
      • DRM Format Handling
      • Dumb Buffer Objects
      • Plane Abstraction
        • Plane Functions Reference
      • Display Modes Function Reference
      • Connector Abstraction
        • Connector Functions Reference
      • Encoder Abstraction
        • Encoder Functions Reference
      • KMS Initialization and Cleanup
        • CRTCs (struct drm_crtc)
        • Cleanup
        • Output discovery and initialization example
      • KMS Locking
      • KMS Properties
        • Property Types and Blob Property Support
        • Standard Connector Properties
        • Plane Composition Properties
        • Color Management Properties
        • Tile Group Property
        • Explicit Fencing Properties
        • Existing KMS Properties
      • Vertical Blanking
        • Vertical Blanking and Interrupt Handling Functions Reference
    • Mode Setting Helper Functions
      • Modeset Helper Reference for Common Vtables
      • Atomic Modeset Helper Functions Reference
        • Overview
        • Implementing Asynchronous Atomic Commit
        • Atomic State Reset and Initialization
        • Helper Functions Reference
      • Legacy CRTC/Modeset Helper Functions Reference
      • Simple KMS Helper Reference
      • fbdev Helper Functions Reference
      • Framebuffer CMA Helper Functions Reference
      • Bridges
        • Overview
        • Default bridge callback sequence
        • Bridge Helper Reference
      • Panel Helper Reference
      • Display Port Helper Functions Reference
      • Display Port Dual Mode Adaptor Helper Functions Reference
      • Display Port MST Helper Functions Reference
      • MIPI DSI Helper Functions Reference
      • Output Probing Helper Functions Reference
      • EDID Helper Functions Reference
      • Rectangle Utilities Reference
      • HDMI Infoframes Helper Reference
      • Flip-work Helper Reference
      • Plane Helper Reference
      • Auxiliary Modeset Helpers
    • Userland interfaces
      • libdrm Device Lookup
      • Primary Nodes, DRM Master and Authentication
      • Open-Source Userspace Requirements
      • Render nodes
      • Testing and validation
        • Validating changes with IGT
        • Display CRC Support
      • VBlank event handling
    • drm/i915 Intel GFX Driver
      • Core Driver Infrastructure
        • Runtime Power Management
        • Interrupt Handling
        • Intel GVT-g Guest Support(vGPU)
        • Intel GVT-g Host Support(vGPU device model)
      • Display Hardware Handling
        • Mode Setting Infrastructure
        • Frontbuffer Tracking
        • Display FIFO Underrun Reporting
        • Plane Configuration
        • Atomic Plane Helpers
        • Output Probing
        • Hotplug
        • High Definition Audio
        • Intel HDMI LPE Audio Support
        • Panel Self Refresh PSR (PSR/SRD)
        • Frame Buffer Compression (FBC)
        • Display Refresh Rate Switching (DRRS)
        • DPIO
        • CSR firmware support for DMC
        • Video BIOS Table (VBT)
        • Display PLLs
      • Memory Management and Command Submission
        • Batchbuffer Parsing
        • Batchbuffer Pools
        • Logical Rings, Logical Ring Contexts and Execlists
        • Global GTT views
        • GTT Fences and Swizzling
        • Object Tiling IOCTLs
        • Buffer Object Eviction
        • Buffer Object Memory Shrinking
      • GuC
        • GuC-specific firmware loader
        • GuC-based command submission
        • GuC Firmware Layout
      • Tracing
        • i915_ppgtt_create and i915_ppgtt_release
        • i915_context_create and i915_context_free
        • switch_mm
      • Perf
        • Overview
        • Comparison with Core Perf
        • i915 Driver Entry Points
        • i915 Perf Stream
        • i915 Perf Observation Architecture Stream
        • All i915 Perf Internals
    • drm/tinydrm Driver library
      • Core functionality
      • Additional helpers
      • MIPI DBI Compatible Controllers
    • VGA Switcheroo
      • Modes of Use
        • Manual switching and manual power control
        • Driver power control
      • API
        • Public functions
        • Public structures
        • Public constants
        • Private structures
      • Handlers
        • apple-gmux Handler
    • VGA Arbiter
      • vgaarb kernel/userspace ABI
      • In-kernel interface
      • libpciaccess
      • xf86VGAArbiter (X server implementation)
      • References
  • Security documentation
    • Trusted Platform Module documentation
      • Virtual TPM Proxy Driver for Linux Containers
        • Introduction
        • Design
        • UAPI
  • Linux Sound Subsystem Documentation
    • ALSA Kernel API Documentation
      • The ALSA Driver API
        • Management of Cards and Devices
        • PCM API
        • Control/Mixer API
        • MIDI API
        • Proc Info API
        • Compress Offload
        • ASoC
        • Miscellaneous Functions
      • Writing an ALSA Driver
        • Preface
        • File Tree Structure
        • Basic Flow for PCI Drivers
        • Management of Cards and Components
        • PCI Resource Management
        • PCM Interface
        • Control Interface
        • API for AC97 Codec
        • MIDI (MPU401-UART) Interface
        • RawMIDI Interface
        • Miscellaneous Devices
        • Buffer and Memory Management
        • Proc Interface
        • Power Management
        • Module Parameters
        • How To Put Your Driver Into ALSA Tree
        • Useful Functions
        • Acknowledgments
    • Designs and Implementations
      • Standard ALSA Control Names
        • Standard Syntax
        • Exceptions (deprecated)
        • PCM interface
        • IEC958 (S/PDIF) interface
      • ALSA PCM channel-mapping API
        • General
        • Design
      • ALSA Compress-Offload API
        • Overview
        • Requirements
        • Design
        • Gapless Playback
        • Not supported
        • Credits
      • ALSA PCM Timestamping
      • ALSA Jack Controls
        • Why we need Jack kcontrols
        • Jack Kcontrol Internals
        • How to use jack kcontrols
      • Proc Files of ALSA Drivers
        • General
        • Global Information
        • Card Specific Files
        • PCM Proc Files
        • AC97 Codec Information
        • USB Audio Streams
        • HD-Audio Codecs
        • Sequencer Information
        • Help For Debugging?
      • Notes on Power-Saving Mode
      • Notes on Kernel OSS-Emulation
        • Modules
        • Device Mapping
        • PCM Mode
        • Mixer Elements
        • Duplex Streams
        • Unsupported Features
      • OSS Sequencer Emulation on ALSA
        • Description
        • Installation
        • Using Synthesizer Devices
        • Using MIDI Devices
        • Module Options
        • Queue Mechanism
        • Interface to Synthesizer Device
        • Events
        • Interface to MIDI Device
        • Known Problems / TODO’s
    • ALSA SoC Layer
      • ALSA SoC Layer Overview
        • ASoC Design
      • ASoC Codec Class Driver
        • ASoC Codec driver breakdown
      • ASoC Digital Audio Interface (DAI)
        • AC97
        • I2S
        • PCM
      • Dynamic Audio Power Management for Portable Devices
        • Description
        • DAPM Widgets
        • Codec/DSP Widget Interconnections
        • Endpoint Widgets
        • DAPM Widget Events
      • ASoC Platform Driver
        • Audio DMA
        • SoC DAI Drivers
        • SoC DSP Drivers
      • ASoC Machine Driver
        • probe()/remove()
        • suspend()/resume()
        • Machine DAI Configuration
        • Machine Power Map
        • Machine Controls
      • Audio Pops and Clicks
        • Minimising Playback Pops and Clicks
        • Minimising Capture Pops and Clicks
        • Zipper Noise
      • Audio Clocking
        • Master Clock
        • DAI Clocks
      • ASoC jack detection
        • The jack - struct snd_soc_jack
        • snd_soc_jack_pin
        • Jack detection methods
        • Machine drivers
      • Dynamic PCM
        • Description
        • DPCM machine driver
        • Writing a DPCM DSP driver
        • Hostless PCM streams
      • Creating codec to codec dai link for ALSA dapm
    • Advanced Linux Sound Architecture - Driver Configuration guide
      • Kernel Configuration
      • Module parameters
        • Module snd
        • Module snd-pcm-oss
        • Module snd-rawmidi
        • Common parameters for top sound card modules
        • Module snd-adlib
        • Module snd-ad1816a
        • Module snd-ad1848
        • Module snd-ad1889
        • Module snd-ali5451
        • Module snd-als100
        • Module snd-als300
        • Module snd-als4000
        • Module snd-asihpi
        • Module snd-atiixp
        • Module snd-atiixp-modem
        • Module snd-au8810, snd-au8820, snd-au8830
        • Module snd-azt1605
        • Module snd-azt2316
        • Module snd-aw2
        • Module snd-azt2320
        • Module snd-azt3328
        • Module snd-bt87x
        • Module snd-ca0106
        • Module snd-cmi8330
        • Module snd-cmipci
        • Module snd-cs4231
        • Module snd-cs4236
        • Module snd-cs4281
        • Module snd-cs46xx
        • Module snd-cs5530
        • Module snd-cs5535audio
        • Module snd-ctxfi
        • Module snd-darla20
        • Module snd-darla24
        • Module snd-dt019x
        • Module snd-dummy
        • Module snd-echo3g
        • Module snd-emu10k1
        • Module snd-emu10k1x
        • Module snd-ens1370
        • Module snd-ens1371
        • Module snd-es1688
        • Module snd-es18xx
        • Module snd-es1938
        • Module snd-es1968
        • Module snd-fm801
        • Module snd-gina20
        • Module snd-gina24
        • Module snd-gusclassic
        • Module snd-gusextreme
        • Module snd-gusmax
        • Module snd-hda-intel
        • Module snd-hdsp
        • Module snd-hdspm
        • Module snd-ice1712
        • Module snd-ice1724
        • Module snd-indigo
        • Module snd-indigodj
        • Module snd-indigoio
        • Module snd-intel8x0
        • Module snd-intel8x0m
        • Module snd-interwave
        • Module snd-interwave-stb
        • Module snd-jazz16
        • Module snd-korg1212
        • Module snd-layla20
        • Module snd-layla24
        • Module snd-lola
        • Module snd-lx6464es
        • Module snd-maestro3
        • Module snd-mia
        • Module snd-miro
        • Module snd-mixart
        • Module snd-mona
        • Module snd-mpu401
        • Module snd-msnd-classic
        • Module snd-msnd-pinnacle
        • Module snd-mtpav
        • Module snd-mts64
        • Module snd-nm256
        • Module snd-opl3sa2
        • Module snd-opti92x-ad1848
        • Module snd-opti92x-cs4231
        • Module snd-opti93x
        • Module snd-oxygen
        • Module snd-pcsp
        • Module snd-pcxhr
        • Module snd-portman2x4
        • Module snd-powermac (on ppc only)
        • Module snd-pxa2xx-ac97 (on arm only)
        • Module snd-riptide
        • Module snd-rme32
        • Module snd-rme96
        • Module snd-rme9652
        • Module snd-sa11xx-uda1341 (on arm only)
        • Module snd-sb8
        • Module snd-sb16 and snd-sbawe
        • Module snd-sc6000
        • Module snd-sscape
        • Module snd-sun-amd7930 (on sparc only)
        • Module snd-sun-cs4231 (on sparc only)
        • Module snd-sun-dbri (on sparc only)
        • Module snd-wavefront
        • Module snd-sonicvibes
        • Module snd-serial-u16550
        • Module snd-trident
        • Module snd-ua101
        • Module snd-usb-audio
        • Module snd-usb-caiaq
        • Module snd-usb-usx2y
        • Module snd-via82xx
        • Module snd-via82xx-modem
        • Module snd-virmidi
        • Module snd-virtuoso
        • Module snd-vx222
        • Module snd-vxpocket
        • Module snd-ymfpci
        • Module snd-pdaudiocf
      • AC97 Quirk Option
      • Configuring Non-ISAPNP Cards
      • Module Autoloading Support
      • ALSA PCM devices to OSS devices mapping
      • Proc interfaces (/proc/asound)
        • /proc/asound/card#/pcm#[cp]/oss
      • Early Buffer Allocation
      • Links and Addresses
    • HD-Audio
      • More Notes on HD-Audio Driver
        • General
        • HD-Audio Controller
        • HD-Audio Codec
        • Other Issues
        • Debug Tools
      • HD-Audio Codec-Specific Models
        • ALC880
        • ALC260
        • ALC262
        • ALC267/268
        • ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models)
        • ALC66x/67x/892
        • ALC680
        • ALC88x/898/1150
        • ALC861/660
        • ALC861VD/660VD
        • CMI9880
        • AD1882 / AD1882A
        • AD1884A / AD1883 / AD1984A / AD1984B
        • AD1884
        • AD1981
        • AD1983
        • AD1984
        • AD1986A
        • AD1988/AD1988B/AD1989A/AD1989B
        • Conexant 5045
        • Conexant 5047
        • Conexant 5051
        • Conexant 5066
        • STAC9200
        • STAC9205/9254
        • STAC9220/9221
        • STAC9202/9250/9251
        • STAC9227/9228/9229/927x
        • STAC92HD71B*
        • STAC92HD73*
        • STAC92HD83*
        • STAC92HD95
        • STAC9872
        • Cirrus Logic CS4206/4207
        • Cirrus Logic CS4208
        • VIA VT17xx/VT18xx/VT20xx
      • HD-Audio Codec-Specific Mixer Controls
        • Realtek codecs
        • IDT/Sigmatel codecs
        • VIA codecs
        • Conexant codecs
        • Analog codecs
      • HD-Audio DP-MST Support
        • PCM
        • Pin Initialization
        • Connection list
        • Jack
        • Others to be added later
    • Card-Specific Information
      • Analog Joystick Support on ALSA Drivers
        • General
        • PCI Cards
        • ISA Cards
      • Brief Notes on C-Media 8338/8738/8768/8770 Driver
        • Front/Rear Multi-channel Playback
        • 4/6 Multi-Channel Playback
        • Digital I/O
        • The AC3 (RAW DIGITAL) OUTPUT
        • ANALOG MIXER INTERFACE
        • MIDI CONTROLLER
        • FM OPL/3 Synth
        • Joystick and Modem
        • Debugging Information
      • Sound Blaster Live mixer / default DSP code
        • IEC958 (S/PDIF) raw PCM
        • Digital mixer controls
        • PCM stream related controls
        • MANUALS/PATENTS
      • Sound Blaster Audigy mixer / default DSP code
        • Digital mixer controls
        • PCM stream related controls
        • MANUALS/PATENTS
      • Low latency, multichannel audio with JACK and the emu10k1/emu10k2
      • VIA82xx mixer
      • Guide to using M-Audio Audiophile USB with ALSA and Jack
        • History
        • Audiophile USB Specs and correct usage
        • Audiophile USB MIDI support in ALSA
        • Audiophile USB Audio support in ALSA
        • Audiophile USB and Jack support
      • Alsa driver for Digigram miXart8 and miXart8AES/EBU soundcards
        • GENERAL
        • VERSION 0.1.0
        • NOT YET IMPLEMENTED
        • FIRMWARE
        • COPYRIGHT
      • ALSA BT87x Driver
        • Intro
        • Driver Status
        • Audio modes
        • Digital audio mode
        • Analog audio mode (A/D)
      • Notes on Maya44 USB Audio Support
        • STATE OF DEVELOPMENT
        • DRIVER DETAILS
        • SAMPLING RATES
        • SOUND DEVICES
        • NAMING OF MIXER CONTROLS
      • Software Interface ALSA-DSP MADI Driver
        • Hardware functionality
        • Calling Parameter
      • Serial UART 16450/16550 MIDI driver
      • Imagination Technologies SPDIF Input Controllers
  • Linux Kernel Crypto API
    • Kernel Crypto API Interface Specification
      • Introduction
      • Terminology
    • Kernel Crypto API Architecture
      • Cipher algorithm types
      • Ciphers And Templates
      • Synchronous And Asynchronous Operation
      • Crypto API Cipher References And Priority
      • Key Sizes
      • Cipher Allocation Type And Masks
      • Internal Structure of Kernel Crypto API
        • Generic AEAD Cipher Structure
        • Generic Block Cipher Structure
        • Generic Keyed Message Digest Structure
    • Developing Cipher Algorithms
      • Registering And Unregistering Transformation
      • Single-Block Symmetric Ciphers [CIPHER]
        • Registration specifics
        • Cipher Definition With struct cipher_alg
      • Multi-Block Ciphers
        • Registration Specifics
        • Cipher Definition With struct blkcipher_alg and ablkcipher_alg
        • Specifics Of Asynchronous Multi-Block Cipher
      • Hashing [HASH]
        • Registering And Unregistering The Transformation
        • Cipher Definition With struct shash_alg and ahash_alg
        • Specifics Of Asynchronous HASH Transformation
    • User Space Interface
      • Introduction
      • User Space API General Remarks
      • In-place Cipher operation
      • Message Digest API
      • Symmetric Cipher API
      • AEAD Cipher API
        • AEAD Memory Structure
      • Random Number Generator API
      • Zero-Copy Interface
      • Setsockopt Interface
      • User space API example
    • Programming Interface
      • Block Cipher Algorithm Definitions
      • Symmetric Key Cipher API
      • Symmetric Key Cipher Request Handle
      • Single Block Cipher API
      • Asynchronous Block Cipher API - Deprecated
      • Asynchronous Cipher Request Handle - Deprecated
      • Synchronous Block Cipher API - Deprecated
      • Authenticated Encryption With Associated Data (AEAD) Algorithm Definitions
      • Authenticated Encryption With Associated Data (AEAD) Cipher API
      • Asynchronous AEAD Request Handle
      • Message Digest Algorithm Definitions
      • Asynchronous Message Digest API
      • Asynchronous Hash Request Handle
      • Synchronous Message Digest API
      • Random Number Algorithm Definitions
      • Crypto API Random Number API
      • Asymmetric Cipher Algorithm Definitions
      • Asymmetric Cipher API
      • Asymmetric Cipher Request Handle
      • Key-agreement Protocol Primitives (KPP) Cipher Algorithm Definitions
      • Key-agreement Protocol Primitives (KPP) Cipher API
      • Key-agreement Protocol Primitives (KPP) Cipher Request Handle
      • ECDH Helper Functions
      • DH Helper Functions
    • Code Examples
      • Code Example For Symmetric Key Cipher Operation
      • Code Example For Use of Operational State Memory With SHASH
      • Code Example For Random Number Generator Usage
  • Korean translations
    • 어떻게 리눅스 커널 개발을 하는가
      • 소개
      • 법적 문제
      • 문서
      • 커널 개발자가 되는 것
      • 개발 프로세스
        • 4.x 커널 트리
        • 4.x.y - 안정 커널 트리
        • 4.x -git 패치들
        • 서브시스템 커널 트리들과 패치들
      • 4.x - 통합 테스트를 위한 next 커널 트리
      • 버그 보고
      • 버그 리포트들의 관리
      • 메일링 리스트들
      • 커뮤니티와 협력하는 법
      • 커널 커뮤니티와 기업 조직간의 차이점
      • 여러분의 변경을 나누어라
      • 변경을 정당화해라
      • 변경을 문서화해라
  • Chinese translations
    • Linux 内核代码风格
      • 1) 缩进
      • 2) 把长的行和字符串打散
      • 3) 大括号和空格的放置
        • 3.1) 空格
      • 4) 命名
      • 5) Typedef
      • 6) 函数
      • 7) 集中的函数退出途径
      • 8) 注释
      • 9) 你已经把事情弄糟了
      • 10) Kconfig 配置文件
      • 11) 数据结构
      • 12) 宏,枚举和RTL
      • 13) 打印内核消息
      • 14) 分配内存
      • 15) 内联弊病
      • 16) 函数返回值及命名
      • 17) 不要重新发明内核宏
      • 18) 编辑器模式行和其他需要罗嗦的事情
      • 19) 内联汇编
      • 20) 条件编译
      • 附录 I) 参考
 
The Linux Kernel
  • Docs »
  • The Linux driver implementer’s API guide »
  • Device links
  • View page source

Device links¶

By default, the driver core only enforces dependencies between devices that are borne out of a parent/child relationship within the device hierarchy: When suspending, resuming or shutting down the system, devices are ordered based on this relationship, i.e. children are always suspended before their parent, and the parent is always resumed before its children.

Sometimes there is a need to represent device dependencies beyond the mere parent/child relationship, e.g. between siblings, and have the driver core automatically take care of them.

Secondly, the driver core by default does not enforce any driver presence dependencies, i.e. that one device must be bound to a driver before another one can probe or function correctly.

Often these two dependency types come together, so a device depends on another one both with regards to driver presence and with regards to suspend/resume and shutdown ordering.

Device links allow representation of such dependencies in the driver core.

In its standard form, a device link combines both dependency types: It guarantees correct suspend/resume and shutdown ordering between a “supplier” device and its “consumer” devices, and it guarantees driver presence on the supplier. The consumer devices are not probed before the supplier is bound to a driver, and they’re unbound before the supplier is unbound.

When driver presence on the supplier is irrelevant and only correct suspend/resume and shutdown ordering is needed, the device link may simply be set up with the DL_FLAG_STATELESS flag. In other words, enforcing driver presence on the supplier is optional.

Another optional feature is runtime PM integration: By setting the DL_FLAG_PM_RUNTIME flag on addition of the device link, the PM core is instructed to runtime resume the supplier and keep it active whenever and for as long as the consumer is runtime resumed.

Usage¶

The earliest point in time when device links can be added is after device_add() has been called for the supplier and device_initialize() has been called for the consumer.

It is legal to add them later, but care must be taken that the system remains in a consistent state: E.g. a device link cannot be added in the midst of a suspend/resume transition, so either commencement of such a transition needs to be prevented with lock_system_sleep(), or the device link needs to be added from a function which is guaranteed not to run in parallel to a suspend/resume transition, such as from a device ->probe callback or a boot-time PCI quirk.

Another example for an inconsistent state would be a device link that represents a driver presence dependency, yet is added from the consumer’s ->probe callback while the supplier hasn’t probed yet: Had the driver core known about the device link earlier, it wouldn’t have probed the consumer in the first place. The onus is thus on the consumer to check presence of the supplier after adding the link, and defer probing on non-presence.

If a device link is added in the ->probe callback of the supplier or consumer driver, it is typically deleted in its ->remove callback for symmetry. That way, if the driver is compiled as a module, the device link is added on module load and orderly deleted on unload. The same restrictions that apply to device link addition (e.g. exclusion of a parallel suspend/resume transition) apply equally to deletion.

Several flags may be specified on device link addition, two of which have already been mentioned above: DL_FLAG_STATELESS to express that no driver presence dependency is needed (but only correct suspend/resume and shutdown ordering) and DL_FLAG_PM_RUNTIME to express that runtime PM integration is desired.

Two other flags are specifically targeted at use cases where the device link is added from the consumer’s ->probe callback: DL_FLAG_RPM_ACTIVE can be specified to runtime resume the supplier upon addition of the device link. DL_FLAG_AUTOREMOVE causes the device link to be automatically purged when the consumer fails to probe or later unbinds. This obviates the need to explicitly delete the link in the ->remove callback or in the error path of the ->probe callback.

Limitations¶

Driver authors should be aware that a driver presence dependency (i.e. when DL_FLAG_STATELESS is not specified on link addition) may cause probing of the consumer to be deferred indefinitely. This can become a problem if the consumer is required to probe before a certain initcall level is reached. Worse, if the supplier driver is blacklisted or missing, the consumer will never be probed.

Sometimes drivers depend on optional resources. They are able to operate in a degraded mode (reduced feature set or performance) when those resources are not present. An example is an SPI controller that can use a DMA engine or work in PIO mode. The controller can determine presence of the optional resources at probe time but on non-presence there is no way to know whether they will become available in the near future (due to a supplier driver probing) or never. Consequently it cannot be determined whether to defer probing or not. It would be possible to notify drivers when optional resources become available after probing, but it would come at a high cost for drivers as switching between modes of operation at runtime based on the availability of such resources would be much more complex than a mechanism based on probe deferral. In any case optional resources are beyond the scope of device links.

Examples¶

  • An MMU device exists alongside a busmaster device, both are in the same power domain. The MMU implements DMA address translation for the busmaster device and shall be runtime resumed and kept active whenever and as long as the busmaster device is active. The busmaster device’s driver shall not bind before the MMU is bound. To achieve this, a device link with runtime PM integration is added from the busmaster device (consumer) to the MMU device (supplier). The effect with regards to runtime PM is the same as if the MMU was the parent of the master device.

    The fact that both devices share the same power domain would normally suggest usage of a struct dev_pm_domain or struct generic_pm_domain, however these are not independent devices that happen to share a power switch, but rather the MMU device serves the busmaster device and is useless without it. A device link creates a synthetic hierarchical relationship between the devices and is thus more apt.

  • A Thunderbolt host controller comprises a number of PCIe hotplug ports and an NHI device to manage the PCIe switch. On resume from system sleep, the NHI device needs to re-establish PCI tunnels to attached devices before the hotplug ports can resume. If the hotplug ports were children of the NHI, this resume order would automatically be enforced by the PM core, but unfortunately they’re aunts. The solution is to add device links from the hotplug ports (consumers) to the NHI device (supplier). A driver presence dependency is not necessary for this use case.

  • Discrete GPUs in hybrid graphics laptops often feature an HDA controller for HDMI/DP audio. In the device hierarchy the HDA controller is a sibling of the VGA device, yet both share the same power domain and the HDA controller is only ever needed when an HDMI/DP display is attached to the VGA device. A device link from the HDA controller (consumer) to the VGA device (supplier) aptly represents this relationship.

  • ACPI allows definition of a device start order by way of _DEP objects. A classical example is when ACPI power management methods on one device are implemented in terms of I2C accesses and require a specific I2C controller to be present and functional for the power management of the device in question to work.

  • In some SoCs a functional dependency exists from display, video codec and video processing IP cores on transparent memory access IP cores that handle burst access and compression/decompression.

Alternatives¶

  • A struct dev_pm_domain can be used to override the bus, class or device type callbacks. It is intended for devices sharing a single on/off switch, however it does not guarantee a specific suspend/resume ordering, this needs to be implemented separately. It also does not by itself track the runtime PM status of the involved devices and turn off the power switch only when all of them are runtime suspended. Furthermore it cannot be used to enforce a specific shutdown ordering or a driver presence dependency.
  • A struct generic_pm_domain is a lot more heavyweight than a device link and does not allow for shutdown ordering or driver presence dependencies. It also cannot be used on ACPI systems.

Implementation¶

The device hierarchy, which – as the name implies – is a tree, becomes a directed acyclic graph once device links are added.

Ordering of these devices during suspend/resume is determined by the dpm_list. During shutdown it is determined by the devices_kset. With no device links present, the two lists are a flattened, one-dimensional representations of the device tree such that a device is placed behind all its ancestors. That is achieved by traversing the ACPI namespace or OpenFirmware device tree top-down and appending devices to the lists as they are discovered.

Once device links are added, the lists need to satisfy the additional constraint that a device is placed behind all its suppliers, recursively. To ensure this, upon addition of the device link the consumer and the entire sub-graph below it (all children and consumers of the consumer) are moved to the end of the list. (Call to device_reorder_to_tail() from device_link_add().)

To prevent introduction of dependency loops into the graph, it is verified upon device link addition that the supplier is not dependent on the consumer or any children or consumers of the consumer. (Call to device_is_dependent() from device_link_add().) If that constraint is violated, device_link_add() will return NULL and a WARNING will be logged.

Notably this also prevents the addition of a device link from a parent device to a child. However the converse is allowed, i.e. a device link from a child to a parent. Since the driver core already guarantees correct suspend/resume and shutdown ordering between parent and child, such a device link only makes sense if a driver presence dependency is needed on top of that. In this case driver authors should weigh carefully if a device link is at all the right tool for the purpose. A more suitable approach might be to simply use deferred probing or add a device flag causing the parent driver to be probed before the child one.

State machine¶

enum device_link_state¶

Device link states.

Constants

DL_STATE_NONE
The presence of the drivers is not being tracked.
DL_STATE_DORMANT
None of the supplier/consumer drivers is present.
DL_STATE_AVAILABLE
The supplier driver is present, but the consumer is not.
DL_STATE_CONSUMER_PROBE
The consumer is probing (supplier driver present).
DL_STATE_ACTIVE
Both the supplier and consumer drivers are present.
DL_STATE_SUPPLIER_UNBIND
The supplier driver is unbinding.
                .=============================.
                |                             |
                v                             |
DORMANT <=> AVAILABLE <=> CONSUMER_PROBE => ACTIVE
   ^                                          |
   |                                          |
   '============ SUPPLIER_UNBIND <============'
  • The initial state of a device link is automatically determined by device_link_add() based on the driver presence on the supplier and consumer. If the link is created before any devices are probed, it is set to DL_STATE_DORMANT.
  • When a supplier device is bound to a driver, links to its consumers progress to DL_STATE_AVAILABLE. (Call to device_links_driver_bound() from driver_bound().)
  • Before a consumer device is probed, presence of supplier drivers is verified by checking that links to suppliers are in DL_STATE_AVAILABLE state. The state of the links is updated to DL_STATE_CONSUMER_PROBE. (Call to device_links_check_suppliers() from really_probe().) This prevents the supplier from unbinding. (Call to wait_for_device_probe() from device_links_unbind_consumers().)
  • If the probe fails, links to suppliers revert back to DL_STATE_AVAILABLE. (Call to device_links_no_driver() from really_probe().)
  • If the probe succeeds, links to suppliers progress to DL_STATE_ACTIVE. (Call to device_links_driver_bound() from driver_bound().)
  • When the consumer’s driver is later on removed, links to suppliers revert back to DL_STATE_AVAILABLE. (Call to __device_links_no_driver() from device_links_driver_cleanup(), which in turn is called from __device_release_driver().)
  • Before a supplier’s driver is removed, links to consumers that are not bound to a driver are updated to DL_STATE_SUPPLIER_UNBIND. (Call to device_links_busy() from __device_release_driver().) This prevents the consumers from binding. (Call to device_links_check_suppliers() from really_probe().) Consumers that are bound are freed from their driver; consumers that are probing are waited for until they are done. (Call to device_links_unbind_consumers() from __device_release_driver().) Once all links to consumers are in DL_STATE_SUPPLIER_UNBIND state, the supplier driver is released and the links revert to DL_STATE_DORMANT. (Call to device_links_driver_cleanup() from __device_release_driver().)

API¶

struct device_link * device_link_add(struct device * consumer, struct device * supplier, u32 flags)¶

Create a link between two devices.

Parameters

struct device * consumer
Consumer end of the link.
struct device * supplier
Supplier end of the link.
u32 flags
Link flags.

Description

The caller is responsible for the proper synchronization of the link creation with runtime PM. First, setting the DL_FLAG_PM_RUNTIME flag will cause the runtime PM framework to take the link into account. Second, if the DL_FLAG_RPM_ACTIVE flag is set in addition to it, the supplier devices will be forced into the active metastate and reference-counted upon the creation of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be ignored.

If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically when the consumer device driver unbinds from it. The combination of both DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL to be returned.

A side effect of the link creation is re-ordering of dpm_list and the devices_kset list by moving the consumer device and all devices depending on it to the ends of these lists (that does not happen to devices that have not been registered when this function is called).

The supplier device is required to be registered when this function is called and NULL will be returned if that is not the case. The consumer device need not be registered, however.

void device_link_del(struct device_link * link)¶

Delete a link between two devices.

Parameters

struct device_link * link
Device link to delete.

Description

The caller must ensure proper synchronization of this function with runtime PM.

Next Previous

© Copyright The kernel development community.

Built with Sphinx using a theme provided by Read the Docs.