Block Diagram
The following figure shows the block diagram of the PWM driver for JH7110.
As in the above diagram, besides the general layer of user space for all Linux modules,
the PWM subsystem has the following sub-modules.
- interface: The sub-module provides the sysfs interface to interact with pwm-core.
- pwm-core: The sub-module builds the core functions of PWM
subsystem. It provides PWM control APIs. pwm-core has the
following two key components.
- pwm_chip represents the module which controls PWM generation.
- pwm_device represents a single physical PWM channel.
The PWM subsystem communicates with the StarFive PWM driver to achieve the PWM functions. The driver registers a pwm_chip through API and provide operation functions (ops) for the pwm-core, which implements the underlying operations such as reading or writing register values and generating PWM signals within the specified time period.